Skip to main content

Encoding

When calling remote contracts using callRemote, 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 call callRemote 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. The getRemoteInterchainAccount 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.
If you are using #overrides to specify remote chains, pass those overrides when computing the remote ICA address.