DropDis Documentation
v1.0Where privacy meets payroll. DropDis is a groundbreaking DApp that leverages Zama's fhEVM to enable fully confidential salary distributions.
Key Features
End-to-End Encryption
Employee addresses and salaries are encrypted on the client-side and remain private throughout the entire process.
Efficient Batch Processing
Distribute salaries to hundreds of employees in a single, gas-optimized transaction.
Real-Time UI Feedback
Watch as each employee's data is encrypted with a beautiful, responsive interface that shows live status updates.
Interactive Dashboard
Get a complete, historical overview of all salary batches, their status, and detailed payout information.
How It Works: The Magic of FHE
Traditional blockchains are public. With fhEVM, DropDis can perform calculations on encrypted data. Think of it like sending a locked box to the blockchain. The contract can verify the total amount inside the box is correct, but it can't see what's inside until you, the owner, provide the special key.
Add Employee Data
User inputs employee information through the frontend
Encrypt Data Locally
Frontend encrypts data using FHE before sending to blockchain
Submit Encrypted Batch
Encrypted data is submitted to the smart contract
Request Decryption
Contract requests decryption from FHE Oracle
Secure Decryption
Oracle securely decrypts data off-chain
Execute Transfers
Contract distributes salaries with decrypted data
Technology Stack
Blockchain Layer
| Technology | Description |
|---|---|
| Blockchain | Zama fhEVM (Sepolia Testnet) |
| Language | Solidity ^0.8.24 |
| Environment | Hardhat |
| Core Library | @fhevm/contracts |
Frontend Layer
| Technology | Description |
|---|---|
| Framework | Next.js 16 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS |
| Web3 Library | Ethers.js v6 |
| FHE Library | @zama-fhe/relayer-sdk/bundle |
| Notifications | Sonner |
Getting Started
Prerequisites
- Node.js v18+
- pnpm (recommended), npm, or yarn
- A Web3 wallet (e.g., MetaMask) with the Zama Sepolia network configured
- Some Sepolia testnet ETH
Clone & Install
git clone https://github.com/unamul/drop-dis.git
cd drop-dis
# Install dependencies
pnpm installEnvironment Setup
Create environment file:
frontend/.env.localMNEMONIC=
INFURA_API_KEY=
ETHERSCAN_API_KEY=
NEXT_PUBLIC_CONTRACT_ADDRESS=0x684468E7fe477AaB7525573106eB88F3D18B9Ce2
PRIVATE_KEY=
BATCH_SIZE=50Compile & Deploy Contract
# Compile the Solidity code
pnpm compile
# Deploy to Sepolia testnet
pnpm deploy:sepoliaRun the Frontend
From the frontend directory:
pnpm devNavigate to http://localhost:3000 to start using DropDis!
Usage Guide
- 1Connect Wallet: Ensure your wallet is connected to the Sepolia network.
- 2Add Employees: Enter an employee's address and salary. Click Add Employee.
- 3Monitor Encryption: The employee appears in the list with a loading spinner. Once encrypted, it turns green. You can add multiple employees simultaneously.
- 4Distribute: Once all employees are encrypted, the Distribute Now button becomes active. Click it to submit the batch to the blockchain.
- 5Track Progress: The UI shows the live status of the decryption and payment process.
- 6View History: Visit the
/dashboardto see a complete history of all salary batches. #ComingSoon
Project Structure
DROP-DIS/
│
├── app/ # Next.js 16 App Router (frontend pages)
│ ├── favicon.ico # Website favicon
│ ├── globals.css # Global Tailwind / CSS styles
│ ├── layout.tsx # Root layout wrapper for pages
│ ├── page.tsx # Main landing page of the DApp
│ └── docs/ # Documentation pages
│ └── page.tsx # GitBook-style documentation
│
├── components/ # Reusable React components for UI
│ ├── BatchStatus.tsx # Component to show batch processing status
│ ├── Card.tsx # UI card to display employee info
│ ├── EmployeeForm.tsx # Form to add new employees with encryption
│ ├── EmployeeList.tsx # List displaying all employees
│ └── FHEVM.tsx # Handles Zama FHEVM initialization logic
│
├── contracts/ # Solidity smart contracts
│ └── DropDis.sol # Main contract handling encrypted distribution
│
├── deploy/ # Deployment scripts for Hardhat
│ └── deploy.ts # Script to deploy DropDis.sol to the network
│
├── deployments/ # Stores deployed contract addresses & metadata
│
├── ignition/ # Hardhat Ignition scripts (structured deployment)
│
├── lib/ # Custom libraries (optional utilities or hooks)
│
├── public/ # Static assets (images, fonts, etc.)
│
├── test/ # Smart contract tests
│ └── dropDis.test.ts # Unit tests for DropDis contract
│
├── types/ # TypeScript type definitions (e.g. contract types)
│
├── utils/ # Helper functions and config files
│ ├── abi/
│ │ ├── DropDis.json # Compiled ABI of DropDis.sol
│ │ └── ABI.ts # ABI export helper for frontend
│ ├── contract.ts # Ethers.js contract interaction setup
│ └── fheClient.ts # Zama FHEVM client initialization (encrypt/decrypt)
│
├── .env # Environment variables (private keys, RPC URLs)
│
├── package.json # NPM dependencies and scripts
├── hardhat.config.ts # Hardhat configuration file
├── tsconfig.json # TypeScript configuration
├── next.config.js # Next.js configuration
└── README.md # Project documentation (GitHub)Running Tests
This project uses the Zama FHE mock environment for testing, which simulates the entire encryption/decryption flow.
#
pnpm testContributing
We welcome contributions! Whether it's a bug fix, a new feature, or an improvement to the documentation, your help is appreciated.
- 1Fork the repository.
- 2Create your feature branch (
git checkout -b feature/amazing-feature). - 3Commit your changes (
git commit -m 'Add some amazing feature'). - 4Push to the branch (
git push origin feature/amazing-feature). - 5Open a Pull Request.
References
A huge thanks to the Zama team for building the future of confidential smart contracts.
Built with the amazing tools from Hardhat , Next.js , and Tailwind CSS .
© 2025 DropDis. Built with ❤️ for privacy-preserving payroll.