Accounts
Last updated
Last updated
This tutorial demonstrates how to make a simple interchain call using the Accounts API to a pre-deployed contract on a remote chain.
You can also check out the repo for running this out of the box.
$DESTINATION_DOMAIN
: The domain ID of the destination chain. See Domain identifiers
$RECIPIENT
: The address of the TestRecipient
contract on the destination chain,0x36FdA966CfffF8a9Cdc814f546db0e6378bFef35
$CALLDATA
: The calldata of the call to make on TestRecipient
, which we generate using cast
: 0xf07c1f4700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001648656c6c6f576f726c642066726f6d20616e2049434100000000000000000000
Sending a message is a simple matter of calling InterchainAccountRouter.callRemote()
. This function can be called easily using Etherscan+ or .
Navigate to the InterchainAccountRouter
contract page on Etherscan (or whatever chain you want to send from). See Contract addresses for InterchainAccountRouter
addresses
Under the Contract
tab, find the Write as Proxy
button.
Click on the Connect to Web3
button to connect your Wallet (i.e. Metamask). Make sure that you are on the correct network.
Expand the callRemote
box
For destination domain, enter $DESTINATION_DOMAIN
. You could use 137
to send to mainnet Polygon, or see other Domain identifiers
For the _to
argument, enter the $RECIPIENT
For the _value
argument, enter 0
For the _data
argument, enter the $CALLDATA
Submit the transaction via your wallet/Metamask
For your call to be executed on the destination chain, you must Manually pay for interchain gas, using 550000
for the gas amount
If you view the transaction on a block explorer, you should be able to see the Dispatch
event. You can see an example message sending transaction .