Interface for the Axelar Gateway that supports general message passing and contract call execution.
event ContractCall(address sender, string destinationChain, string destinationContractAddress, bytes32 payloadHash, bytes payload)
Emitted when a contract call is made through the gateway.
Logs the attempt to call a contract on another chain.
Name | Type | Description |
---|---|---|
sender | address | The address of the sender who initiated the contract call. |
destinationChain | string | The name of the destination chain. |
destinationContractAddress | string | The address of the contract on the destination chain. |
payloadHash | bytes32 | The keccak256 hash of the sent payload data. |
payload | bytes | The payload data used for the contract call. |
function callContract(string destinationChain, string contractAddress, bytes payload) external
Sends a contract call to another chain.
Initiates a cross-chain contract call through the gateway to the specified destination chain and contract.
Name | Type | Description |
---|---|---|
destinationChain | string | The name of the destination chain. |
contractAddress | string | The address of the contract on the destination chain. |
payload | bytes | The payload data to be used in the contract call. |
function isContractCallApproved(bytes32 commandId, string sourceChain, string sourceAddress, address contractAddress, bytes32 payloadHash) external view returns (bool)
Checks if a contract call is approved.
Determines whether a given contract call, identified by the commandId and payloadHash, is approved.
Name | Type | Description |
---|---|---|
commandId | bytes32 | The identifier of the command to check. |
sourceChain | string | The name of the source chain. |
sourceAddress | string | The address of the sender on the source chain. |
contractAddress | address | The address of the contract where the call will be executed. |
payloadHash | bytes32 | The keccak256 hash of the payload data. |
Name | Type | Description |
---|---|---|
[0] | bool | True if the contract call is approved, false otherwise. |
function validateContractCall(bytes32 commandId, string sourceChain, string sourceAddress, bytes32 payloadHash) external returns (bool)
Validates and approves a contract call.
Validates the given contract call information and marks it as approved if valid.
Name | Type | Description |
---|---|---|
commandId | bytes32 | The identifier of the command to validate. |
sourceChain | string | The name of the source chain. |
sourceAddress | string | The address of the sender on the source chain. |
payloadHash | bytes32 | The keccak256 hash of the payload data. |
Name | Type | Description |
---|---|---|
[0] | bool | True if the contract call is validated and approved, false otherwise. |
function isCommandExecuted(bytes32 commandId) external view returns (bool)
Checks if a command has been executed.
Determines whether a command, identified by the commandId, has been executed.
Name | Type | Description |
---|---|---|
commandId | bytes32 | The identifier of the command to check. |
Name | Type | Description |
---|---|---|
[0] | bool | True if the command has been executed, false otherwise. |