This Solidity smart contract implements an airdrop functionality for distributing tokens to multiple users based on a Merkle tree. Users can claim their portion of tokens by providing a valid Merkle proof.
- Airdrop Initialization: Owner can initialize a new airdrop by providing the Merkle root, number of users, and amount of tokens to be distributed.
- Token Revision: Owner can update the token contract address if needed.
- Claim: Users can claim their tokens by providing a valid Merkle proof.
- Deploy the contract to the Ethereum blockchain.
- Ensure you have a
.env
file with the following variables:ARB_SEPOLIA_API_KEY
=<Your_Arb_Sepolia_Alchemy_Node_API_Key>AIRDROP_CONTRACT_OWNER_PRIVATE_KEY
=<Airdrop_Contract_Owner_Private_Key>
- Run
shell npx hardhat deploy --network arbSepolia
- Ensure you have a
- Initialize a new airdrop using the
init
function. - Distribute the tokens to the contract address.
- Users can claim their tokens using the
claim
function.
Initialize a new airdrop with the Merkle root, number of users, and amount of tokens to be distributed.
Update the token contract address.
Claim tokens by providing a valid Merkle proof.
- Ensure that enough tokens are deposited to the contract address before users claim their tokens.
- Users cannot claim tokens multiple times in same airdrop.
- Ensure the validity of Merkle proofs before processing claims.