Skip to content

Commit

Permalink
output erc-20 addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Nov 8, 2024
1 parent 5a09844 commit 17276c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/localnet/src/handleOnEVMDepositedAndCalled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ export const handleOnEVMDepositedAndCalled = async ({
const zrc20 = foreignCoin.zrc20_contract_address;
try {
const context = {
origin: sender,
sender: await fungibleModuleSigner.getAddress(),
origin: ethers.ZeroAddress,
sender: sender,
chainID: chainID,
};

log(
"ZetaChain",
`Universal contract ${receiver} executing onCrossChainCall (context: ${JSON.stringify(
`Universal contract ${receiver} executing onCall (context: ${JSON.stringify(
context
)}), zrc20: ${zrc20}, amount: ${amount}, message: ${message})`
);

console.log("!!!", context, zrc20, amount, receiver, message, deployOpts);
const tx = await protocolContracts.gatewayZEVM
.connect(fungibleModuleSigner)
.depositAndCall(context, zrc20, amount, receiver, message, deployOpts);
Expand All @@ -78,7 +78,7 @@ export const handleOnEVMDepositedAndCalled = async ({
});

logs.forEach((data) => {
log("ZetaChain", `Event from onCrossChainCall: ${JSON.stringify(data)}`);
log("ZetaChain", `Event from onCall: ${JSON.stringify(data)}`);
});
} catch (err) {
logErr("ZetaChain", `Error depositing: ${err}`);
Expand Down
11 changes: 11 additions & 0 deletions packages/localnet/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,17 @@ export const initLocalnet = async ({
address: value.zrc20_contract_address,
};
}),
...Object.entries(foreignCoins)
.map(([key, value]) => {
if (value.asset) {
return {
chain: value.foreign_chain_id === "5" ? "ethereum" : "bnb",
type: `ERC-20 ${value.symbol}`,
address: value.asset,
};
}
})
.filter(Boolean),
{
chain: "zetachain",
type: "tss",
Expand Down

0 comments on commit 17276c3

Please sign in to comment.