Skip to content

Commit

Permalink
feat(core): fix evmxt 'to' address for dvm to evm transferdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
lykalabrada committed Sep 27, 2023
1 parent 0c68bb3 commit 8183f5d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mobile-app/app/api/transaction/transfer_domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export async function transferDomainSigner(
): Promise<CTransactionSegWit> {
const dvmScript = await account.getScript();
const evmScript = await account.getEvmScript();
const evmAddress = await account.getEvmAddress();
const builder = account.withTransactionBuilder();

const [sourceScript, dstScript] =
Expand All @@ -50,11 +51,11 @@ export async function transferDomainSigner(
const TD_CONTRACT_ADDR = "0x0000000000000000000000000000000000000302";
const tdIFace = new utils.Interface(TransferDomain.abi);

const from =
const from = evmAddress;
const to =
convertDirection === ConvertDirection.evmToDvm
? await account.getEvmAddress()
: await account.getAddress();
const to = TD_CONTRACT_ADDR;
? TD_CONTRACT_ADDR
: evmAddress;
const evmAmount = BN.from(amount.toString()).toHexString(); // "0x29a2241af62c0000"; // 3_000_000_000_000_000_000
const native = await account.getAddress();
const data = tdIFace.encodeFunctionData("transfer", [
Expand Down

0 comments on commit 8183f5d

Please sign in to comment.