logoAcademy

Transfer Tokens

Transfer an ERC20 from C-chain to your own blockchain

Transfer the Token Cross-chain

Now that all the bridge contracts have been deployed, send a native token from your Avalanche L1 to C-Chain with the cast send foundry command.

cast send --rpc-url local-c --private-key $PK $ERC20_HOME_C_CHAIN "send((bytes32, address, address, address, uint256, uint256, uint256, address), uint256)" "(${SOURCE_BLOCKCHAIN_ID_HEX}, ${ERC20_TOKEN_REMOTE_L1}, ${FUNDED_ADDRESS}, ${ERC20_C_CHAIN}, 0, 0, 250000, 0x0000000000000000000000000000000000000000)" 1000000000000000000000

Check Balances

To confirm the token was bridged from C-Chain to a Avalanche L1, we will check the recipient's balance of wrapped tokens on the Avalanche L1 with the cast call foundry command:

cast call --rpc-url myblockchain $ERC20_TOKEN_REMOTE_L1 "balanceOf(address)(uint)" $FUNDED_ADDRESS

On this page