logoAcademy

Native Token Bridge Transfer

Perform a transfer of a native Dijets ECC token to the Utility Chain as an ERC-20 token.

Transfer the ECC's Native Token to the Utility Chain

Now that all the bridge contracts have been deployed and configured, send some native tokens from your Dijets ECC to Utility Chain with the cast send foundry command.

cast send --rpc-url mydijetschain --private-key $PK $ERC20_HOME_BRIDGE_ECC \
"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 Dijets ECC to Utility Chain, we will check the recipient's balance of wrapped tokens on the Utility 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 Dijets ECC to the Utility Chain as an ERC-20 token.

On this page