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.
First retrieve the address of the ERC-20 token on C-Chain.
echo $ERC20_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.
avalanche interchain tokenTransferrer deploy
✔ Local Network✔ C-Chain✔ Deploy a new Home for the token✔ An ERC-20 tokenEnter the address of the ERC-20 Token: 0x5DB9A7629912EBF95876228C24A848de0bfB43A9...Home Deployed to http://127.0.0.1:9650/ext/bc/C/rpcHome Address: 0x4Ac1d98D9cEF99EC6546dEd4Bd550b0b287aaD6DRemote Deployed to http://127.0.0.1:9650/ext/bc/2u9Hu7Noja3Z1kbZyrztTMZcDeqb6acwyPyqP4BbVDjoT8ZaYc/rpcRemote Address: 0x0D189a705c1FFe77F1bF3ee834931b6b9B356c05
Save the Remote contract address in the environment variables.
Now that the Avalanche Interchain Token Transfer contracts have been deployed, transfer some ERC20 tokens TOK from C-Chain to myblockchain
avalanche key transfer
✔ Local Network✔ C-Chain✔ Blockchain myblockchainEnter the address of the Token Transferrer on c-chain: 0x4Ac1d98D9cEF99EC6546dEd4Bd550b0b287aaD6DEnter the address of the Token Transferrer on myblockchain: 0x0D189a705c1FFe77F1bF3ee834931b6b9B356c05✔ ewoq✔ Key✔ ewoqAmount to send (TOKEN units): 100