This is a cross-chain airdrop DApp that allows users to airdrop tokens from one chain to another. This DApp is built using Solidity, Next.js and Axelar General Message Passing.
- Token airdrop from one chain to another
- Airdrop stats
- User-friendly interface with dark mode support
- Integration with Axelar General Message Passing
- Real-time response and airdrop status updates
To install and run this application locally, follow these steps:
-
Clone the repository:
git clone https://github.com/axelarnetwork/cross-chain-airdrop-dapp.git
-
Navigate to the project directory:
cd cross-chain-airdrop-dapp
-
Install the dependencies:
npm install
-
Navigate to the hardhat directory:
cd hardhat
-
Set up the environment variables to deploy the smart contracts:
- Create a
.env
file in the hardhat directory. - Define the following variables in the
.env
file:ReplacePRIVATE_KEY=<Your Wallet Private Key>
<Your Wallet Private Key>
with your wallet private key.
- Create a
-
Compile and Deploy the smart contracts:
npx hardhat run scripts/deploy.js --network <network>
Replace
<network>
with the desired network (e.g.polygon
andavalancheFujiTestnet
in this case). Copy the contract address once the deployment is complete.Ensure you update the Axelar gateway and gas service address for Binance and Avalanche respectively in
deploy.js
file under thescripts
directory and deploy them separately. You can find the gateway and gas service address here. -
Set up the environment variables:
- Create a
.env.local
file in the root directory. - Define the following variables in the
.env.local
file:ReplaceNEXT_PUBLIC_POLYGON_CONTRACT_ADDRESS=<Polygon contract address> NEXT_PUBLIC_AVALANCHE_CONTRACT_ADDRESS=<Avalanche contract address> NEXT_PUBLIC_AVALANCHE_RPC_URL=https://avalanche-fuji-c-chain.publicnode.com
<Polygon contract address>
and<Avalanche contract address>
, with the respective values.
- Create a
-
Start the development server:
cd ..
npm run dev
- Access the application in your browser:
Open your web browser and visit http://localhost:3000
to see the application running.
- Connect your wallet to the DApp. Ensure you have some test tokens in your wallet.
- Approve the DApp to spend your tokens.
- Enter the amount of tokens you want to airdrop, receivers addresses and click on the
Send
button. - Confirm the transaction in your wallet.
- Wait for the transaction to be confirmed. You can check the status of the transaction in the
Airdrop Stats
section.
- React
- Solidity
- Axelar General Message Passing
- @rainbow-me/rainbowkit
- wagmi
- ethers.js
- Next.js
- Toastify
- CSS (Tailwind CSS)
Contributions are welcome! If you find any issues or want to contribute to the project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your forked repository.
- Submit a pull request detailing your changes.