Docs
IntegrationsEVM

Overview

Send and receive GMP messages from Solidity contracts on EVM chains.

On EVM chains, a contract sends a message by calling callContract on Axelar's gateway contract, and receives one by implementing _execute from AxelarExecutable. The contracts are in axelar-gmp-sdk-solidity.

EVM contracts can exchange messages with every connected chain, not only other EVM chains. To send tokens, use the Interchain Token Service.

💡

Using an AI agent?

Copy this page with Copy Markdown at the top and give it to your agent, with what you want to build or the contract you want to make cross-chain. The copied page links to the Markdown of the other pages it refers to, so the agent can read them too. Review what it writes, and test on testnet before mainnet.

Message flow

Sending, on the source chain:

  1. Your contract pays gas to the gas service (payNativeGasForContractCall).
  2. Your contract calls callContract on the gateway, which emits a ContractCall event.

Receiving, on the destination chain:

  1. Axelar verifies the event and approves the message on the gateway.
  2. A relayer calls execute on your contract.
  3. AxelarExecutable asks the gateway to validate the message, which marks it executed, then calls your _execute.

Consensus and Amplifier chains

EVM chains connect to Axelar in one of two ways (see Amplifier), with a different gateway contract. Contracts that send and receive plain messages work the same way on both: AxelarExecutable supports both gateways.

Consensus chainsAmplifier chains
Gateway contractAxelarGatewayAxelarAmplifierGateway
callContractYesYes
callContractWithTokenYesNo
Command IDAssigned by Axelarkeccak256(sourceChain + "_" + messageId)
Approval eventContractCallApprovedMessageApproved

Chains and contracts shows each chain's type. The contract reference has the details.

Setup

Install the SDK:

# npm
npm install @axelar-network/axelar-gmp-sdk-solidity

# Foundry
forge install axelarnetwork/axelar-gmp-sdk-solidity

With Foundry, add a remapping so the imports in these docs resolve:

@axelar-network/axelar-gmp-sdk-solidity/=lib/axelar-gmp-sdk-solidity/

Your contract needs two addresses on each chain it's deployed to, the gateway and the gas service. Both are on Chains and contracts.

Chain names

Contracts identify chains by their Axelar name, such as arbitrum or base, not by EVM chain ID. Names are listed on Axelarscan: mainnet | testnet.

When sending, chain names are case-insensitive. When receiving, sourceChain is the name exactly as the chain was registered, and some older chains were registered capitalized: Ethereum, Avalanche, Polygon, Fantom and Moonbeam. Compare it to the exact string. The source chain of a message is shown on its Axelarscan page.

Next steps

Resources

On this page