axelar-gmp-sdk-solidity

Solidity API

IAxelarExecutable

Interface for a contract that is executable by Axelar Gateway’s cross-chain message passing. It defines a standard interface to execute commands sent from another chain.

InvalidAddress

error InvalidAddress()

Thrown when a function is called with an invalid address.

NotApprovedByGateway

error NotApprovedByGateway()

Thrown when the call is not approved by the Axelar Gateway.

gateway

function gateway() external view returns (contract IAxelarGateway)

Returns the address of the AxelarGateway contract.

Return Values

Name Type Description
[0] contract IAxelarGateway The Axelar Gateway contract associated with this executable contract.

execute

function execute(bytes32 commandId, string sourceChain, string sourceAddress, bytes payload) external

Executes the specified command sent from another chain.

This function is called by the Axelar Gateway to carry out cross-chain commands. Reverts if the call is not approved by the gateway or other checks fail.

Parameters

Name Type Description
commandId bytes32 The identifier of the command to execute.
sourceChain string The name of the source chain from where the command originated.
sourceAddress string The address on the source chain that sent the command.
payload bytes The payload of the command to be executed. This typically includes the function selector and encoded arguments.