From d61f6b3cef9ad4706624aebccc78236639f268cd Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Fri, 13 Sep 2024 01:16:00 +0800 Subject: [PATCH 1/2] fix: evm-call --- packages/localnet/src/handleOnEVMCalled.ts | 7 ++++++- packages/localnet/src/index.ts | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/localnet/src/handleOnEVMCalled.ts b/packages/localnet/src/handleOnEVMCalled.ts index 0051946..ae1ad46 100644 --- a/packages/localnet/src/handleOnEVMCalled.ts +++ b/packages/localnet/src/handleOnEVMCalled.ts @@ -11,6 +11,7 @@ export const handleOnEVMCalled = async ({ args, deployer, fungibleModuleSigner, + foreignCoins, }: { tss: any; provider: ethers.JsonRpcProvider; @@ -18,6 +19,7 @@ export const handleOnEVMCalled = async ({ args: any; deployer: any; fungibleModuleSigner: any; + foreignCoins: any[]; }) => { log("EVM", "Gateway: 'Called' event emitted"); try { @@ -30,7 +32,10 @@ export const handleOnEVMCalled = async ({ sender: await fungibleModuleSigner.getAddress(), chainID: 1, }; - const zrc20 = protocolContracts.zrc20Eth.target; + const zrc20 = foreignCoins.find( + (coin) => coin.foreign_chain_id === "1" && coin.coin_type === "Gas" + )?.zrc20_contract_address; + log( "ZetaChain", `Universal contract ${receiver} executing onCrossChainCall (context: ${JSON.stringify( diff --git a/packages/localnet/src/index.ts b/packages/localnet/src/index.ts index b3d6c68..3960738 100755 --- a/packages/localnet/src/index.ts +++ b/packages/localnet/src/index.ts @@ -321,6 +321,7 @@ export const initLocalnet = async (port: number) => { args, deployer, fungibleModuleSigner, + foreignCoins, }); }); @@ -335,6 +336,7 @@ export const initLocalnet = async (port: number) => { foreignCoins, }); }); + console.log(foreignCoins); process.stdin.resume(); From ddd12be5e065039d46f987bc0a35dd18a4183a24 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Fri, 13 Sep 2024 01:24:16 +0800 Subject: [PATCH 2/2] remove console log --- packages/localnet/src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/localnet/src/index.ts b/packages/localnet/src/index.ts index 3960738..9942ec4 100755 --- a/packages/localnet/src/index.ts +++ b/packages/localnet/src/index.ts @@ -336,7 +336,6 @@ export const initLocalnet = async (port: number) => { foreignCoins, }); }); - console.log(foreignCoins); process.stdin.resume();