Interface for the Base Axelar Amplifier Gateway that supports cross-chain messaging.
error InvalidMessages()
event MessageApproved(bytes32 commandId, string sourceChain, string messageId, string sourceAddress, address contractAddress, bytes32 payloadHash)
Emitted when a cross-chain message is approved.
| Name | Type | Description |
|---|---|---|
| commandId | bytes32 | The identifier of the command to execute. |
| sourceChain | string | The name of the source chain from whence the command came. |
| messageId | string | The message id for the message. |
| 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 approved payload data. |
event MessageExecuted(bytes32 commandId)
Emitted when a message has been executed.
Logs the execution of an approved message.
sourceChain and messageId aren’t included in the event due to backwards compatibility with validateContractCall.
| Name | Type | Description |
|---|---|---|
| commandId | bytes32 | The commandId for the message that was executed. |
function isMessageApproved(string sourceChain, string messageId, string sourceAddress, address contractAddress, bytes32 payloadHash) external view returns (bool)
Checks if a message is approved.
Determines whether a given message, identified by the sourceChain and messageId, is approved.
| Name | Type | Description |
|---|---|---|
| sourceChain | string | The name of the source chain. |
| messageId | string | The unique identifier of the message. |
| 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 isMessageExecuted(string sourceChain, string messageId) external view returns (bool)
Checks if a message is executed.
Determines whether a given message, identified by the sourceChain and messageId is executed.
| Name | Type | Description |
|---|---|---|
| sourceChain | string | The name of the source chain. |
| messageId | string | The unique identifier of the message. |
| Name | Type | Description |
|---|---|---|
| [0] | bool | True if the message is executed, false otherwise. |
function validateMessage(string sourceChain, string messageId, string sourceAddress, bytes32 payloadHash) external returns (bool valid)
Validates if a message is approved. If message was in approved status, status is updated to executed to avoid replay.
| Name | Type | Description |
|---|---|---|
| sourceChain | string | The name of the source chain. |
| messageId | string | The unique identifier of the message. |
| sourceAddress | string | The address of the sender on the source chain. |
| payloadHash | bytes32 | The keccak256 hash of the payload data. |
| Name | Type | Description |
|---|---|---|
| valid | bool | True if the message is approved, false otherwise. |
function messageToCommandId(string sourceChain, string messageId) external pure returns (bytes32)
Compute the commandId for a message.
| Name | Type | Description |
|---|---|---|
| sourceChain | string | The name of the source chain as registered on Axelar. |
| messageId | string | The unique message id for the message. |
| Name | Type | Description |
|---|---|---|
| [0] | bytes32 | The commandId for the message. |