Skip to content

An example repository showcasing the integration of Foundry with Axelar General Message Passing (GMP)

Notifications You must be signed in to change notification settings

axelarnetwork/foundry-axelar-gmp-example

Repository files navigation

Foundry Axelar GMP Example

This repository showcases an example of integrating with the Axelar GMP using the Foundry framework. The Foundry framework aids in deploying, testing, and interacting with smart contracts on various blockchains. This example provides a hands-on approach to demonstrate the potential and flexibility of such integrations.

In this example, the supported testnet networks are

  • Ethereum
  • Avalanche
  • Moonbeam
  • Fantom
  • Polygon

Note: Additional networks can be added based on your specific needs.

Getting Started

Requirements

  • Foundry: Confirm installation by running forge --version and you should see a response like
forge 0.2.0 (a839414 2023-10-26T09:23:16.997527000Z)
  • Make: Confirm installation by running make --version and you should see a response like
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty, not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program was built for i386-apple-darwin11.3.0
  • Node version >= 18.19.0

Installation

  1. Clone the repository:
git clone https://github.com/axelarnetwork/foundry-axelar-gmp-example.git
  1. Navigate into the project directory:
cd foundry-axelar-gmp-example
  1. Install the dependencies and build the project:
make all

The command above will install the required dependencies, create a .env file from .env.example, and update and build the project.

Local

Start the Local Chains

To get started in testing Axelar GMP locally, you need to start local chains with the following command:

make local-chain-start

Leave this node running on a separate terminal before deploying and testing the dApp.

Deployment

To deploy the contracts (ExecutableSample, DistributionExecutable etc.) locally, you need to run the following command:

make local-chain-deploy

Execution

Additionally, we have an example using Hardhat available here. Check it out.

Available Commands

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

  1. make all: Clean, set up the environment, install dependencies, and build the project.
  2. make setup-env: Create a .env file from .env.example.
  3. make init-submodules: Initialize and update git submodules.
  4. make install: Install dependencies.
  5. make update: Update dependencies.
  6. make build: Compile the contracts.
  7. make format: Format the codebase using the Foundry formatter.
  8. make test: Run tests with increased verbosity.
  9. make clean: Clean any generated artifacts.
  10. make rpc: Display RPC URLs for various networks.
  11. make deploy: Deploy a specific contract to a given testnet.
  12. make execute-gmp-on-testnet: Execute GMP (General Message Passing) contracts on testnet.
  13. make local-chain-start: Start the local chains.
  14. make clean-ports: Clean up ports used by local chains.
  15. make local-chain-deploy: Deploy all contracts to local chains.
  16. make local-chain-execute: Execute commands to test GMP on local chains.

Interchain Token Service (ITS) commands for local chains:

  1. make deploy-interchain-token: Deploy an interchain token on local chains.
  2. make deploy-mint-burn-token-manager-and-transfer: Set up token managers and perform a transfer on local chains.
  3. make deploy-canonical-token: Deploy a canonical token on local chains.

Interchain Token Service (ITS) commands for testnet:

  1. make deploy-canonical-token-testnet: Deploy and register a canonical token on testnet.

  2. make transfer-canonical-token-testnet: Perform interchain transfer of a canonical token on testnet.

  3. make deploy-interchain-token-testnet: Deploy an interchain token on testnet.

  4. make transfer-interchain-token-testnet: Perform interchain transfer of an interchain token on testnet.

  5. make deploy-custom-token-testnet: Deploy a custom token on testnet.

  6. make transfer-custom-token-testnet: Perform interchain transfer of a custom token on testnet.

  7. make help: Display the help menu with available commands and descriptions.

About

An example repository showcasing the integration of Foundry with Axelar General Message Passing (GMP)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published