Skip to content
Developers
General Message Passing
Examples

Example cross-chain dApps using GMP

The axelar-examples (opens in a new tab) repo has an array of examples to show the ease of integrating Axelar's GMP protocol into any dApp to bring it cross-chain. The examples range in use cases and complexity but ultimately leverage the two fundamental building blocks for GMP:

  • callContract
  • callContractWithToken

"Hello World!"

Say hello to your first dApp on Axelar. The dApp sends a message -- "Hello World" -- from a source to a destination chain using the callContract function.

Source code (opens in a new tab) | Deploy instructions (opens in a new tab)

Airdrop

Send axlUSDC from a source chain to a list of recipients on a destination chain using the callContractWithToken function. Each recipient will receive an equal portion of the total tokens sent.

Source code (opens in a new tab) | Deploy instructions (opens in a new tab)

Watch Axelar engineers demo an end-to-end walkthrough of our Airdrop example, which sends axlUSDC from a source chain to a list of recipients on a destination chain using the callContractWithToken function. The full-stack example includes running the examples locally, deploying to testnet, and reviewing analytics tools in testnet ... all run with a simple bootstrapped front end.


Mint tokens and send cross-chain

Mints some amount of ERC-20 tokens at a source chain and sends it using the callContract function to a destination chain. Tokens are burned on the source-chain contract and minted on the destination-chain contract.

Source code (opens in a new tab) | Deploy instructions (opens in a new tab)

NFT linker

Send an NFT on a source chain to a recipient on a destination chain using the callContract function. If the source chain is where the NFT was originally created, the NFT gets locked in the contract and minted on the destination chain; in the reverse direction, the NFT is burned and transferred to its final recipient on the destination (/original home) chain.

Source code (opens in a new tab) | Deploy instructions (opens in a new tab)


Two-way example: send back

A two-way example using callContract in both directions where a message is sent from a source chain to a destination chain, and an "executed" acknowledgement is sent back to the source chain.

Source code (opens in a new tab) | Deploy instructions (opens in a new tab)

Composable USDC

For a more complex example of using native USDC cross-chain, check out our Composable USDC Example.