Build Cross-Chain Smart Contracts Simply & Quickly With the Axelar Foundry GMP Example

This repository showcases an example of integrating with Axelar’s General Message Passing using the Foundry framework.

November 8, 2023
Idris Olubisi
November 8, 2023

Table of Contents

Back to blog

After many developer requests over the past few months it's finally here: 🚨 The Foundry GMP Example! 🚨

Now, developers can save dozens of hours and significantly reduce the complexity of their codebase when integrating with Axelar General Message Passing (GMP) using the Foundry framework.

The Foundry framework, known for its efficiency and ease of use, is a comprehensive toolkit for Ethereum Virtual Machine (EVM) compatible smart contract development. The Foundry GMP Example example not only simplifies the process but also enhances a developer's capability to create interoperable smart contracts that communicate across multiple blockchain networks.

The provided example encapsulates best practices and delivers a hands-on approach to demonstrate the potential and flexibility of such integrations, enabling you to kickstart your development without the typical groundwork required.

How does it work?

The Foundry GMP Example is a toolkit for developers looking to let smart contracts talk to each other across different blockchain networks using Foundry. You'll start by making sure you have Foundry set up on your computer, then grab the example code and set it all up with just a few commands.

Once you're set up, you'll use a simple list of make commands that do every setup required, build and compile the project, and send it off to the blockchains you choose. Before you send your contracts into the wild, you'll need some tokens from a faucet to test things out on networks like Polygon Mumbai, Avalanche Fuji, Scroll Sepolia, etc. And don't forget, your secret phrase is the ultimate key to your contracts, so keep it safe and never share it online.


This repository provides a set of Makefile commands to facilitate common tasks:

  • make all: Install dependencies, build, and update the project.
  • make setup-env: Create a .env file from .env.example.
  • make install: Install the dependencies.
  • make build: Compile the contracts.
  • make update: Update the project.
  • make deploy: Deploy a specific contract to a given network.
  • make execute: Execute a specific contract on a given network.
  • make format: Format the codebase using the Foundry formatter.
  • make clean: Clean any generated artifacts.
  • make rpc: Display RPC URLs for various networks.
  • make help: Display the help menu.

What next?

Start building with Foundry and Axelar GMP. You'll find detailed documentation and code examples to help you get started on your own projects.

Prefer Hardhat? We've got you covered in our Axelar Examples repository.

Don't hesitate to join our developer community on Discord; we are happy to answer your questions and concerns.