Encoding
When calling remote contracts usingcallRemote
, the function parameters must be encoded into an array of Call
structs.
Each Call
struct contains:
to
: The target contract address (converted to bytes32).value
: The ETH or native token amount to send with the call.data
: The function call data, which can be encoded using abi.encodeCall.
Call.data
can be easily encoded with the abi.encodeCall
function.
Typescript Usage
We also have Typescript tooling to easily deploy ICA accounts and callcallRemote
on the origin chain:
Determine addresses
In some cases, you may need to compute the ICA address on a remote chain before making a call. For example, if your ICA needs funding before executing transactions, you can retrieve its address and transfer assets to it in advance. See the Transfer and Call Pattern section for more information. ThegetRemoteInterchainAccount
function can be used to get the address of an ICA given the destination chain and owner address.
An example is included below of a contract precomputing its own Interchain Account address.