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.
error InvalidAddress()
Thrown when a function is called with an invalid address.
error NotApprovedByGateway()
Thrown when the call is not approved by the Axelar Gateway.
function gateway() external view returns (contract IAxelarGateway)
Returns the address of the AxelarGateway contract.
Name | Type | Description |
---|---|---|
[0] | contract IAxelarGateway | The Axelar Gateway contract associated with this executable contract. |
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.
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. |