This tutorial demonstrates how to make a simple interchain call using the Accounts API to a pre-deployed
TestRecipientcontract on a remote chain.
$RECIPIENT: The address of the
TestRecipientcontract on the destination chain,
$CALLDATA: The calldata of the call to make on
TestRecipient, which we generate using
$ cast calldata "fooBar(uint256,string)" 1 "HelloWorld from an ICA"
- 1.Navigate to the
InterchainAccountRoutercontract page on Etherscan (or whatever chain you want to send from). See Contract addresses for
- 2.Under the
Contracttab, find the
Write as Proxybutton.
- 3.Click on the
Connect to Web3button to connect your Wallet (i.e. Metamask). Make sure that you are on the correct network.
- 4.Expand the
- 5.For destination domain, enter
$DESTINATION_DOMAIN. You could use
137to send to mainnet Polygon, or see other Domain identifiers
- 6.For the
_toargument, enter the
- 7.For the
_valueargument, enter 0
- 8.For the
_dataargument, enter the
- 9.Submit the transaction via your wallet/Metamask
You can call the
cast. Make sure that you have a valid RPC URL for the origin chain and a private key with which you can pay for gas.
cast send 0xE0Be420779cAd6E2bEA1E4F7C02F996D9ED1fCB5 \
$DESTINATION_DOMAIN $RECIPIENT 0 $CALLDATA \
--rpc-url $RPC_URL --private-key $PRIVATE_KEY
If you view the transaction on a block explorer, you should be able to see the
Dispatchevent. You can see an example message sending transaction here.
For your call to be executed on the destination chain, you must Manually pay for interchain gas, using
550000for the gas amount