Legacy 02: ExtraArgsV2 Token Transfer (CLI allowOutOfOrderExecution)
This example sends a token transfer using ExtraArgsV2 from an EOA.
Task: legacy02 (implementation: tasks/Legacy02.ts).
You can toggle allowOutOfOrderExecution via the --allow-out-of-order-execution option.
What You Will Do
- Mint test token(s) to your EOA on the source chain with the
faucettask. - Send token(s) using
ExtraArgsV2with thelegacy02task. - Set out-of-order execution with
--allow-out-of-order-execution trueorfalse. - Observe the message on CCIP Explorer.
Before You Start
Important: Keystore first
Use a local keystore account for task execution:
npx hardhat keystore set SEPOLIA_PRIVATE_KEY npx hardhat keystore set FUJI_PRIVATE_KEY npx hardhat keystore set SEPOLIA_RPC_URL npx hardhat keystore set FUJI_RPC_URL
You do not need to deploy a receiver contract for this token-only example.
Use a destination EOA as the receiver and pass --gas-limit 0.
Step 1: Get 1 CCIP-BnM Token on Source Chain
npx hardhat faucet --network <NETWORK_NAME> --ccip-bnm <CCIP_BNM_SOURCE_TOKEN_ADDRESS>
Step 2: Send Token With ExtraArgsV2
npx hardhat legacy02 --network <NETWORK_NAME> \
--source-router <SOURCE_ROUTER> \
--destination-chain-selector <DESTINATION_CHAIN_SELECTOR> \
--receiver <DESTINATION_EOA_ADDRESS> \
--token-to-send <CCIP_BNM_SOURCE_TOKEN_ADDRESS> \
--amount <AMOUNT> \
--gas-limit <GAS_LIMIT> \
--allow-out-of-order-execution <true|false> \
--fee-token-address <FEE_TOKEN_ADDRESS>
Parameter notes:
--amount: token amount in wei (for 18 decimals,1000000000000000000is 1 token).--gas-limit: set0for token-only transfer to an EOA receiver. Use> 0for contract callback.--allow-out-of-order-execution:trueorfalse.--fee-token-address: LINK token address on the source chain to pay in LINK, or0x0000000000000000000000000000000000000000to pay in native coin.
Verify Result
Use the logged message ID in:
- https://ccip.chain.link