(Next.js 16 + React 19 + Solidity 0.8.28 + IPFS)
Airdrop Builder is a production-ready, decentralized web application that enables anyone to create and participate in token airdrops without requiring a centralized backend. Built with modern web3 technologies, it provides a seamless experience for both airdrop creators and recipients.
π https://ac-capstone-project.vercel.app
For Creators:
- π Upload CSV files with recipient data and automatic token decimal detection
- π³ Generate Merkle trees and proofs automatically
- π¦ Store airdrop metadata on IPFS for decentralization
- β‘ Deploy and fund airdrops in a single transaction
- π Automatic 7-day withdrawal lock for security
For Recipients:
- π Browse and discover available airdrops
- β Check eligibility automatically
- π Claim tokens directly from the interface
- π± Mobile-friendly responsive design
Next.js 16 DApp (App Router + API Routes)
β
βββ π CSV Upload β π Token Decimal Detection β π³ Merkle Tree Generation
β
βββ π¦ IPFS Upload (claims.json + metadata) β π Smart Contract Interaction
β
βββ π AirdropFactory.createAirdropAndFund(token, root, ipfsURI, amount)
β β
β βββ πͺ Deploy MerkleAirdrop (EIP-1167 minimal proxy)
β βββ β
claim() - users claim with Merkle proof
β βββ π 7-day withdrawal lock
β βββ π° withdrawRemaining() - creator withdraws after lock
β
βββ π Real-time Event Monitoring (AirdropCreated, Claimed)
βββ π¨ Modern UI (TailwindCSS + RainbowKit + Wagmi)
βββ π± Mobile-responsive design
The following diagram illustrates the complete smart contract interaction workflow:
Key Components:
- π AirdropFactory Contract - Deploys and manages airdrop campaigns
- πͺ MerkleAirdrop Implementation - Core logic for individual airdrops
- π Proxy (Clone) Contracts - Gas-efficient EIP-1167 minimal proxies
- π€ Users - Interact with the system to create and claim airdrops
Workflow:
- User calls
createAirdropAndFund()on Factory - Factory deploys Proxy Clone using EIP-1167 pattern
- Proxy Clone delegates calls to MerkleAirdrop Implementation
- Users claim tokens by calling
claim()on Proxy Clone - Proxy Clone verifies Merkle proofs and transfers tokens
| Feature | Description |
|---|---|
| π§© Merkle Proof Verification | Efficient on-chain eligibility checks using Merkle root verification |
| πΈ Auto Funding | Creator funds the airdrop in the same transaction |
| π 7-Day Lock | Creator can only withdraw unclaimed tokens after 7 days |
| π¦ IPFS Integration | All claim data (proofs) stored on decentralized IPFS |
| β‘ Minimal Proxy Deployment | Uses EIP-1167 Clones for low-gas contract creation (~45k gas vs 2M gas) |
| π» Frontend-Only | Entirely built on Next.js 16 (no backend server required) |
| π Smart Search & Filtering | Find airdrops with eligibility detection and advanced filtering |
| π Multi-Token Support | Automatic decimal detection for any ERC20 token (6, 8, 18+ decimals) |
| β‘ Real-time Updates | Live blockchain event monitoring and automatic UI updates |
| π¨ Modern UI/UX | Beautiful, responsive interface with TailwindCSS and RainbowKit |
Handles individual airdrop logic with Merkle proof verification and time-locked withdrawals.
Key Functions
function initialize(address token, address owner, bytes32 merkleRoot, string memory metadataURI, uint256 totalAmount) external;
function claim(uint256 index, address account, uint256 amount, bytes32[] calldata proof) external;
function withdrawRemaining() external;
function isClaimed(uint256 index) external view returns (bool);Security Features
- β
Merkle proof verification via OpenZeppelin
MerkleProof - β Bitmap-based claim tracking (gas efficient)
- β 7-day withdrawal lock prevents rug pulls
- β Event emission for indexing and monitoring
Deploys and funds airdrop contracts using EIP-1167 minimal proxy pattern.
Core Functions
function createAirdropAndFund(address token, bytes32 merkleRoot, string calldata metadataURI, uint256 totalAmount) external returns (address);
function createDeterministicAirdropAndFund(bytes32 salt, address token, bytes32 merkleRoot, string calldata metadataURI, uint256 totalAmount) external returns (address);Deployment Flow
- Creator approves Factory to spend tokens
- Factory clones
MerkleAirdropimplementation - Initializes clone with airdrop parameters
- Transfers tokens to the airdrop contract
- Emits
AirdropCreatedevent for frontend indexing
Gas Optimization
- π ~45,000 gas for airdrop deployment (vs ~2,000,000 gas for full deployment)
- π ~200,000 gas for create + fund transaction
- π ~80,000 gas for token claiming
| Layer | Technology | Version |
|---|---|---|
| Framework | Next.js | 16.0.0 (App Router) |
| React | React | 19.2.0 |
| Blockchain | Wagmi | 2.12.0 |
| Blockchain | Viem | 2.21.0 |
| Styling | TailwindCSS | 4.0.0 |
| Wallet | RainbowKit | 2.0.0 |
| IPFS | Custom API | - |
| CSV Parsing | PapaParse | 5.4.1 |
| Merkle Tree | merkletreejs | 0.4.0 |
| Route | Description | Features |
|---|---|---|
/create |
Multi-step airdrop creation | CSV upload, token decimal detection, Merkle generation, IPFS upload, contract deployment |
/airdrops |
Browse and discover airdrops | Real-time data fetching, smart search, eligibility filtering, direct claiming |
/claim/[address] |
Individual airdrop claiming | IPFS data loading, Merkle proof verification, one-click claiming |
/api/ipfs-upload |
Secure IPFS upload API | Serverless route for decentralized storage |
- π± Responsive Design - Mobile-first approach with TailwindCSS
- π Smart Search - Full-text search across airdrop names and descriptions
- β Eligibility Detection - Automatic checking of user eligibility
- π Direct Claiming - Claim tokens without leaving the airdrops page
- π Token-Specific Formatting - Correct decimal display for all ERC20 tokens
π https://ac-capstone-project.vercel.app
- Node.js 18+ - Required for Next.js 16
- MetaMask - Web3 wallet for blockchain interactions
- Sepolia ETH - For testnet transactions (Get from Sepolia Faucet)
1. Clone the repository
git clone https://github.com/Pasonnn/ac-capstone-project.git
cd ac-capstone-project2. Frontend Setup
cd front-end
npm install
cp env.example .env.local
# Configure your environment variables
npm run dev3. Smart Contract Setup
cd smart-contract
npm install
cp .env.example .env
# Configure your environment variables
npm run compile
npm run testFrontend (.env.local)
# Contract Addresses
NEXT_PUBLIC_AIRDROP_FACTORY_ADDRESS=0x83c3860EcD9981f582434Ed67036db90D5375032
# Network Configuration
NEXT_PUBLIC_CHAIN_ID=11155111 # Sepolia testnet
NEXT_PUBLIC_RPC_URL=https://eth-sepolia.public.blastapi.io
# IPFS Configuration
NEXT_PUBLIC_IPFS_GATEWAY_URL=your_ipfs_gateway_url
NEXT_IPFS_GATEWAY_URL_POST=your_ipfs_upload_urlSmart Contract (.env)
# Private Keys (NEVER commit these!)
PRIVATE_KEY=your_private_key_here
# Network Configuration
SEPOLIA_RPC_URL=https://eth-sepolia.public.blastapi.io
ETHERSCAN_API_KEY=your_etherscan_api_key
# IPFS Configuration
IPFS_POST_URL=your_ipfs_upload_url
IPFS_GET_URL=your_ipfs_gateway_urlDevelopment Mode
cd front-end
npm run dev
# Visit http://localhost:3000Production Build
cd front-end
npm run build
npm run startSmart Contract Deployment
cd smart-contract
npm run deploy:sepolia- Connect Wallet - Connect MetaMask to Sepolia testnet
- Upload CSV - Upload recipient list with automatic parsing and validation
- Configure Token - Enter token address with automatic decimal detection
- Generate Merkle Tree - Automatic generation of Merkle root and proofs
- Upload to IPFS - Store claims data and metadata on decentralized storage
- Deploy & Fund - Two-step transaction (approve + create) with gas estimation
- Monitor Airdrop - Track claims and manage the airdrop from
/airdrops
- Browse Airdrops - Visit
/airdropsto see all available airdrops - Check Eligibility - System automatically checks if wallet is eligible
- View Details - Click on airdrop to see full details and claim amount
- Claim Tokens - One-click claiming directly from the interface
- Track Status - Monitor claim status and transaction confirmations
Creator Uploads CSV
β
Token Decimal Detection
β
Merkle Tree Generation
β
IPFS Metadata Upload
β
Smart Contract Deployment
β
Real-time Event Monitoring
β
Recipient Discovery & Claiming
| Risk | Mitigation | Implementation |
|---|---|---|
| Creator rug-pulls funds | 7-day withdrawal lock | Time-locked withdrawals prevent immediate fund extraction |
| Double-claiming | Bitmap verification | Gas-efficient bitmap tracks claimed indices |
| Empty contracts | Auto-funding on creation | Factory transfers tokens during deployment |
| Invalid proofs | Merkle proof verification | OpenZeppelin MerkleProof library validation |
| Expired claims | Time-based restrictions | 7-day claim deadline enforcement |
| Unauthorized access | Owner-only functions | Proper access control on sensitive functions |
- β OpenZeppelin Integration - Battle-tested security libraries
- β Gas Optimization - Efficient storage patterns prevent DoS attacks
- β Event Emission - Transparent on-chain activity logging
- β Input Validation - All parameters validated before processing
ac-capstone-project/
βββ front-end/ # Next.js 16 DApp
β βββ app/ # App Router pages
β β βββ create/page.tsx # Airdrop creation flow
β β βββ airdrops/page.tsx # Browse airdrops
β β βββ claim/[address]/page.tsx # Individual claiming
β β βββ api/ipfs-upload/route.ts # IPFS upload API
β βββ components/ # React components
β βββ hooks/ # Custom Wagmi hooks
β βββ lib/ # Utilities and configurations
β βββ public/ # Static assets
βββ smart-contract/ # Solidity contracts
β βββ contracts/ # Smart contract source
β βββ scripts/ # Deployment and utility scripts
β βββ test/ # Comprehensive test suite
β βββ deployments/ # Deployment artifacts
β βββ test-data/ # Sample data for testing
βββ README.md # This file
cd smart-contract
npm run test # Run all tests
npm run test:flow # Run comprehensive flow tests
REPORT_GAS=true npm run test # Run with gas reportingcd front-end
npm run build # Test production build
npm run lint # Run ESLint- β Unit Tests - Individual function testing
- β Integration Tests - End-to-end airdrop flow
- β Edge Case Testing - Error conditions and boundaries
- β Gas Optimization - Cost analysis and optimization
- β Security Testing - Access control and validation
- URL: https://ac-capstone-project.vercel.app
- Network: Ethereum Sepolia Testnet
- Chain ID: 11155111
- Factory Contract:
0x83c3860EcD9981f582434Ed67036db90D5375032
- Factory: View on Etherscan
- Implementation: Check
smart-contract/deployments/sepolia_deployment.json
- Core smart contracts (Merkle Airdrop + Factory)
- Next.js 16 DApp with App Router
- Auto funding + 7-day lock
- Real-time blockchain event monitoring
- Multi-token decimal support
- IPFS integration for decentralized storage
- Smart search and filtering
- Direct claiming functionality
- Analytics Dashboard - Claim statistics and analytics
- NFT Airdrop Support - ERC-721 token airdrops
- Batch Operations - Multiple airdrop management
- DAO Integration - Community governance features
- Mobile App - React Native mobile application
- Advanced Analytics - Detailed claim tracking and reporting
- Frontend Documentation - Complete Next.js DApp guide
- Smart Contract Documentation - Solidity contracts and deployment guide
- Live Application: https://ac-capstone-project.vercel.app
- GitHub Repository: https://github.com/Pasonnn/ac-capstone-project
- Etherscan Factory: View on Sepolia Etherscan
Pason.Dev
- π§ Email: [email protected]
- π‘ Mission: "Building open, decentralized ecosystems for transparent growth."
- π Website: pason.dev
MIT License Β© 2025 Pason.Dev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- OpenZeppelin - Battle-tested smart contract libraries
- Viem - Type-safe Ethereum library
- Wagmi - React hooks for Ethereum
- Next.js - The React framework for production
- TailwindCSS - Utility-first CSS framework
- RainbowKit - Beautiful wallet connection UI
- Ethereum Foundation - Core protocol development
