DEV Community

Konstadinos Chonas
Konstadinos Chonas

Posted on

🚀 Building a Token Vesting & Airdrop DApp with Solidity, Hardhat, and React

Introduction

Over the past month, I worked on a project that combined three fundamental building blocks of blockchain applications:

  1. An ERC-20 token
  2. A vesting schedule for stakeholders
  3. A Merkle tree-based airdrop system

The result is a full-stack decentralized application (DApp) where users can connect their wallet, check vesting schedules, and claim airdropped tokens directly from the UI.
This post is both a showcase of what I built and a reflection on what I learned while developing it.


Why This Project?

Almost every blockchain team that issues its own token needs to solve the same problems:

  • Secure token contracts that comply with ERC-20 standards
  • Fair vesting schedules to gradually release tokens to founders and investors
  • Efficient airdrops to reward community members without wasting gas

By building all three in one application, I created something that mirrors real-world use cases while giving me hands-on experience with both smart contracts and frontend integration.


🔧 Tech Stack

  • Smart Contracts: Solidity + OpenZeppelin libraries
  • Development: Hardhat (compiling, testing, deploying) + Foundry (fuzz and invariant testing)
  • Security: Slither (static analysis)
  • Frontend: React.js, Ethers.js, Web3React
  • Deployment: Sepolia Testnet (via Alchemy/Infura)

Backend: Smart Contracts

The backend consists of three core contracts:

  • MyToken.sol → ERC-20 token with a fixed supply
  • Vesting.sol → releases tokens incrementally over time (cliff + duration)
  • AirdropMerkle.sol → verifies Merkle proofs so eligible wallets can claim tokens without storing a massive on-chain list

I used Hardhat for compilation and testing, while Foundry allowed me to perform fuzz testing and invariant testing, ensuring the contracts behaved correctly under edge cases.
Static analysis with Slither helped identify possible vulnerabilities early on.

Deployed contracts on Sepolia Testnet:

  • ERC-20 Token → 0x5C4Ce5240D563f76cA2af86dff446eb888897Ad5
  • Vesting → 0x0B549f2c07Bccd36E2CD82bdCEF35ac2694DEFF9
  • Airdrop → 0xE6C8d1770846FB0cDCCDD84d6163F663C3f56285

Frontend: User Interface

On the frontend, I built a React-based UI with wallet connectivity via MetaMask.
Key features include:

🦊 Wallet integration (MetaMask)
📜 View vesting schedules (with human-readable dates)
🎁 Claim vested tokens directly from the UI
Merkle proof verification for airdrop eligibility
💰 Check balances and transfer tokens
🔄 Automatic refresh after transactions

This gave me practice with React state management, ethers.js contract calls, and ensuring smooth UX flows for blockchain interactions.


Challenges & Lessons Learned

  1. Gas efficiency → Merkle trees significantly cut down gas costs compared to naive storage.
  2. Security-first mindset → Reentrancy and invariant testing became part of my workflow.
  3. Tooling matters → Hardhat is excellent for development, but Foundry made fuzz and invariant testing far easier.
  4. Frontend + Blockchain = Friction → Handling async blockchain calls and state refreshes is trickier than it looks.

Closing Thoughts

This project helped me grow from just experimenting with Solidity to building a complete DApp that solves a real-world problem.

It reinforced the importance of:

  • Writing secure and efficient contracts
  • Testing beyond unit tests (fuzz + invariants)
  • Creating a smooth frontend experience for blockchain users

👉 You can find the full project here on GitHub

If you're also working on blockchain projects or interested in collaborating, feel free to connect with me on LinkedIn. 🚀

Top comments (0)