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.
- 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
- Clone the repository:
git clone https://github.com/axelarnetwork/foundry-axelar-gmp-example.git
- Navigate into the project directory:
cd foundry-axelar-gmp-example
- 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.
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.
To deploy the contracts (ExecutableSample,
DistributionExecutable
etc.) locally, you need to run the following command:
make local-chain-deploy
- Call Contract Example
- Call Contract with Token Example
- Send Ack Example
- New Interchain Token Example
- Canonical Token Deployment Example
- Interchain Custom Token Example
Additionally, we have an example using Hardhat available here. Check it out.
The repository provides a set of Makefile commands to facilitate common tasks:
make all
: Clean, set up the environment, install dependencies, and build the project.make setup-env
: Create a.env
file from.env.example
.make init-submodules
: Initialize and update git submodules.make install
: Install dependencies.make update
: Update dependencies.make build
: Compile the contracts.make format
: Format the codebase using the Foundry formatter.make test
: Run tests with increased verbosity.make clean
: Clean any generated artifacts.make rpc
: Display RPC URLs for various networks.make deploy
: Deploy a specific contract to a given testnet.make execute-gmp-on-testnet
: Execute GMP (General Message Passing) contracts on testnet.make local-chain-start
: Start the local chains.make clean-ports
: Clean up ports used by local chains.make local-chain-deploy
: Deploy all contracts to local chains.make local-chain-execute
: Execute commands to test GMP on local chains.
make deploy-interchain-token
: Deploy an interchain token on local chains.make deploy-mint-burn-token-manager-and-transfer
: Set up token managers and perform a transfer on local chains.make deploy-canonical-token
: Deploy a canonical token on local chains.
-
make deploy-canonical-token-testnet
: Deploy and register a canonical token on testnet. -
make transfer-canonical-token-testnet
: Perform interchain transfer of a canonical token on testnet. -
make deploy-interchain-token-testnet
: Deploy an interchain token on testnet. -
make transfer-interchain-token-testnet
: Perform interchain transfer of an interchain token on testnet. -
make deploy-custom-token-testnet
: Deploy a custom token on testnet. -
make transfer-custom-token-testnet
: Perform interchain transfer of a custom token on testnet. -
make help
: Display the help menu with available commands and descriptions.