The Merkle Airdrop system enables the distribution of tokens via airdrops in a secure and gas-efficient manner using Merkle proofs to verify claims. This repository contains the smart contracts, testing suite, and deployment scripts necessary for setting up and managing a Merkle Airdrop.
- Secure Token Distribution: Uses Merkle proofs to ensure that airdrops are claimed only by eligible addresses.
- Gas Efficiency: Reduces the gas cost by allowing users to prove their token claim without the need for on-chain storage of all possible claimants.
- EIP712 Signing: Implements EIP712 for secure and verifiable signatures.
- Comprehensive Tests: Includes a full suite of tests to ensure functionality and robustness.
- Script Automation: Scripts to generate airdrop input data and Merkle proofs for deployment.
Before you begin, ensure you have the following installed:
- Foundry for Solidity testing and deployment
Clone the repository and install dependencies:
git clone https://your-repository-url.git
cd merkle-airdrop-system
forge install
Generate input data and Merkle proofs by running:
forge script script/GenerateInput.s.sol
forge script script/MakeMerkle.s.sol
Execute the tests with Foundry:
forge test
- MerkleAirdrop.sol: Main contract for handling the airdrop.
- MockToken.sol: Mock ERC20 token for testing purposes.
- GenerateInput.s.sol: Generates the input data for the Merkle tree.
- MakeMerkle.s.sol: Generates the Merkle tree root and proofs from the input data.
Distributed under the MIT License. See LICENSE
for more information.