IAxelarGatewayAdapter
Title: IAxelarGatewayAdapter
Authors: David Dada <daveproxy80@gmail.com> (https://github.com/dadadave80), Adapted for EIP-2535 from OpenZeppelin community-contracts AxelarGatewayAdapter (https://github.com/OpenZeppelin/openzeppelin-community-contracts)
Admin/read/inbound surface of the Axelar ERC-7786 gateway adapter. The standard source-gateway
ABI (sendMessage/supportsAttribute) is declared by IERC7786GatewaySource; this adds the
Axelar chain-name ↔ ERC-7930 equivalence registry, the trusted remote-gateway registry, and the
Axelar inbound execute entrypoint. EVM chains only.
Functions
gateway
The configured Axelar gateway contract.
function gateway() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
getAxelarChain
Returns the Axelar chain name for a "chain-only" ERC-7930 interoperable address.
function getAxelarChain(bytes calldata chain) external view returns (string memory);Parameters
| Name | Type | Description |
|---|---|---|
| chain | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
getErc7930Chain
Returns the "chain-only" ERC-7930 interoperable address for an Axelar chain name.
function getErc7930Chain(string calldata axelar) external view returns (bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| axelar | string |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
getRemoteGateway
Returns the trusted remote gateway address-bytes registered for a "chain-only" address.
function getRemoteGateway(bytes calldata chain) external view returns (bytes memory);Parameters
| Name | Type | Description |
|---|---|---|
| chain | bytes |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
registerChainEquivalence
Registers a CAIP-2 ↔ Axelar chain-name equivalence (both directions). Admin only.
function registerChainEquivalence(bytes calldata chain, string calldata axelar) external;Parameters
| Name | Type | Description |
|---|---|---|
| chain | bytes | A "chain-only" ERC-7930 interoperable address (empty address part). |
| axelar | string | The Axelar chain name (e.g. "ethereum", "optimism"). |
registerRemoteGateway
Registers a trusted remote gateway adapter. Admin only.
function registerRemoteGateway(bytes calldata remote) external;Parameters
| Name | Type | Description |
|---|---|---|
| remote | bytes | The full ERC-7930 interoperable address of the remote adapter (chain + address). |
execute
Axelar inbound entrypoint. Validates the approved call + the source gateway, then delivers to the ERC-7786 recipient. Called by the Axelar relayer.
function execute(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload
) external;Parameters
| Name | Type | Description |
|---|---|---|
| commandId | bytes32 | |
| sourceChain | string | |
| sourceAddress | string | |
| payload | bytes |
Events
RegisteredChainEquivalence
Emitted when a CAIP-2 ↔ Axelar chain-name equivalence is registered.
event RegisteredChainEquivalence(bytes chain, string axelar);Parameters
| Name | Type | Description |
|---|---|---|
| chain | bytes | |
| axelar | string |
RegisteredRemoteGateway
Emitted when a trusted remote gateway adapter is registered for a chain.
event RegisteredRemoteGateway(bytes remote);Parameters
| Name | Type | Description |
|---|---|---|
| remote | bytes |
Errors
UnsupportedNativeTransfer
sendMessage was called with non-zero msg.value (native transfer is unsupported).
error UnsupportedNativeTransfer();UnsupportedChainType
The interoperable chain type is not supported (only EVM / chainType 0x0000).
error UnsupportedChainType(bytes2 chainType);Parameters
| Name | Type | Description |
|---|---|---|
| chainType | bytes2 |
ChainEquivalenceAlreadyRegistered
A chain equivalence is already registered for this CAIP-2 chain or Axelar name.
error ChainEquivalenceAlreadyRegistered(bytes chain);Parameters
| Name | Type | Description |
|---|---|---|
| chain | bytes |
RemoteGatewayAlreadyRegistered
A remote gateway is already registered for this chain.
error RemoteGatewayAlreadyRegistered(bytes chain);Parameters
| Name | Type | Description |
|---|---|---|
| chain | bytes |
InvalidOriginGateway
The inbound call's source did not match the registered remote gateway for its chain.
error InvalidOriginGateway(string sourceChain, string sourceAddress);Parameters
| Name | Type | Description |
|---|---|---|
| sourceChain | string | |
| sourceAddress | string |
NotApprovedByGateway
The Axelar gateway has not approved this inbound contract call.
error NotApprovedByGateway();RecipientExecutionFailed
The recipient's receiveMessage did not return the ERC-7786 magic value.
error RecipientExecutionFailed();