Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
fix: update unlock original token
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Mar 29, 2024
1 parent 4f02fa1 commit f5fb3e6
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions src/bridges/xtoken-next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,35 +208,28 @@ export class XTokenNextBridge extends BaseBridge {
const originalSender = this.convertor?.source ?? sender;
const { recipient: pRecipient, extData } = await this._getExtDataAndRecipient(recipient);

const args = [
BigInt(this.sourceChain.id),
this.sourceToken.inner,
originalSender,
pRecipient,
sender,
amount,
nonce,
extData,
] as const;

if (this.crossInfo?.action === "issue") {
message = encodeFunctionData({
abi: (await import("@/abi/xtoken-issuing-next")).default,
functionName: "issue",
args: [
BigInt(this.sourceChain.id),
this.sourceToken.inner,
originalSender,
pRecipient,
sender,
amount,
nonce,
extData,
],
args,
});
} else if (this.crossInfo?.action === "redeem") {
message = encodeFunctionData({
abi: (await import("@/abi/xtoken-backing-next")).default,
functionName: "unlock",
args: [
BigInt(this.sourceChain.id),
this.targetToken.inner,
originalSender,
pRecipient,
sender,
amount,
nonce,
extData,
],
args,
});
}

Expand Down

0 comments on commit f5fb3e6

Please sign in to comment.