logoAcademy

Native Token Bridge Transfer

Perform a transfer of a native Avalanche L1 token to the C-Chain as an ERC-20 token.

Transfer the L1's Native Token to the C-Chain

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

cast send --rpc-url myblockchain --private-key $PK $ERC20_HOME_BRIDGE_L1 \
"send((bytes32, address, address, address, uint256, uint256, uint256, address))" \
"(${C_CHAIN_BLOCKCHAIN_ID_HEX}, ${ERC20_TOKEN_REMOTE_C_CHAIN}, ${FUNDED_ADDRESS}, 0x0000000000000000000000000000000000000000, 0, 0, 250000, 0x0000000000000000000000000000000000000000)"  --value 1ether

Check Balance

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

cast call --rpc-url local-c $ERC20_TOKEN_REMOTE_C_CHAIN "balanceOf(address)(uint)" $FUNDED_ADDRESS
1000000000000000000

Success! We have bridged 1 native token from our Avalanche L1 to the C-Chain as an ERC-20 token.

On this page