This test demonstrates how to deposit tokens from one chain to another using a deposit address.
Make sure you've already followed the following steps:
To execute the example, use the following command:
npm run execute evm/deposit-address [local|testnet] ${srcChain} ${destChain} ${amount}
Default Values:
srcChain
isAvalanche
. Valid values are Moonbeam, Avalanche, Fantom, Ethereum, and PolygondestChain
isFantom
. Valid values are Moonbeam, Avalanche, Fantom, Ethereum, and Polygonamount
is10e6
- If running on testnet, ensure that
0xBa86A5719722B02a5D5e388999C25f3333c7A9fb
is funded with aUSDC. This address is used to deploy and test all examples and is funded by default in the local environment when you run start. To make sure that it's funded on all five supported testnets, runnode/printBalances
.
npm run execute evm/deposit-address local
The output will be:
--- Initially ---
Balance at Avalanche is 100000000
Balance at Fantom is 100000000
0xb54eA64537F3307907E06d3B93ccd4A3E711623f
--- After ---
Balance at Avalanche is 90000000
Balance at Fantom is 109000000
This example demonstrates how to deposit 10e6 tokens from Avalanche chain to Fantom chain using a deposit address. The initial balance of the Avalanche chain and Fantom chain is 100000000
. After the execution, the balance of Avalanche chain is 90000000
and the balance of Fantom chain is 109000000
. The deposit address is 0xb54eA64537F3307907E06d3B93ccd4A3E711623f
.