Deploy and Use ICTT with Avalanche CLI
Alternative and simplified way to deploy ICTT to transfer ERC-20 to ERC-20 assets
In the previous sections of this chapter we manually deployed and interacted with the Interchain Token Transfer contracts. In this section we will use the Avalanche CLI to deploy the contracts and transfer the tokens.
What we will do
- Create an Avalanche L1 and Deploy on Local Network
- Deploy an ERC-20 Contract on C-chain
- Deploy the Avalanche Interchain Token Transfer Contracts on C-chain and Avalanche L1
- Start Sending Tokens
Deploy Avalanche Interchain Token Transfer Contracts
First retrieve the address of the ERC-20 token on C-Chain.
Next we will deploy two Interchain Token Transfer contracts using the Avalanche CLI. It will deploy the contracts on the source chain (C-Chain) and on the destination chain (myblockchain) for us.
Save the Remote contract address in the environment variables.
Get Balances
Before transfering some funds Cross-Chain, check the current balances of both the ERC20 Home token and the Remote one.
Transfer the Token Cross-chain
Now that the Avalanche Interchain Token Transfer contracts have been deployed, transfer some ERC20 tokens TOK
from C-Chain to myblockchain
Check Balances
Now we can check the balances of both the ERC-20 Home token and the Remote one.
Success! We have transferred 100 tokens from C-Chain to myblockchain using the Avalanche CLI.