From 8183f5ddbe72ed1fbeb47706339d451def96c360 Mon Sep 17 00:00:00 2001 From: Lyka Labrada Date: Wed, 27 Sep 2023 15:33:30 +0800 Subject: [PATCH] feat(core): fix evmxt 'to' address for dvm to evm transferdomain --- mobile-app/app/api/transaction/transfer_domain.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mobile-app/app/api/transaction/transfer_domain.ts b/mobile-app/app/api/transaction/transfer_domain.ts index 79566adf75..c9b39e0ed8 100644 --- a/mobile-app/app/api/transaction/transfer_domain.ts +++ b/mobile-app/app/api/transaction/transfer_domain.ts @@ -32,6 +32,7 @@ export async function transferDomainSigner( ): Promise { const dvmScript = await account.getScript(); const evmScript = await account.getEvmScript(); + const evmAddress = await account.getEvmAddress(); const builder = account.withTransactionBuilder(); const [sourceScript, dstScript] = @@ -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", [