A modern, multi-tenant automated payroll system built on Arc Network, enabling seamless USDC payments to employees with a beautiful fintech-style interface. Self-service employer registration allows unlimited companies to share the same smart contracts.
- Multi-Tenant Architecture: Unlimited companies share the same smart contracts with isolated operations
- Self-Service Registration: Any wallet can register as an employer - no admin needed
- Modern UI: Clean, fintech-inspired interface built with Next.js 14 and TailwindCSS
- Employee Management: Add, edit, and manage employee profiles with wallet addresses
- Automated Payroll: Schedule and execute automated USDC payments
- Dashboard Analytics: Real-time overview of payroll metrics and balances
- Smart Contracts: Solidity contracts built with Foundry for secure payments
- Arc Network Integration: Leveraging Arc Network for fast, low-cost transactions
- Role-Based Access Control: HR_ROLE for employers, ADMIN_ROLE for platform owner
1. Connect Wallet
β Your wallet address is your identity
2. Register as Employer
β Click "Register as Employer" button
β Calls registerAsEmployer() contract function
β Automatically granted HR_ROLE
β Cost: ~$0.08 in gas
3. Add Your Employees
β Go to Employees page
β Click "Add Employee"
β Enter: Name, Wallet Address, Salary, Role
β Employee linked to your employer address
β Only YOU can manage your employees
β Cost: ~$0.19 per employee
4. Deposit USDC for Payroll
β Go to Payroll page
β Approve USDC spending (one-time)
β Deposit desired amount
β Funds tracked in your employer balance
β Cost: ~$0.17 (approve + deposit)
5. Execute Payroll
β Click "Pay All Employees"
β Contract pays only YOUR employees
β Deducts from your employer balance
β Instant USDC transfers to employee wallets
β Cost: ~$0.24 per employee
All employers share the same contracts but operate independently:
// Each employer has their own balance
employerBalances[companyA] = 10_000 USDC
employerBalances[companyB] = 5_000 USDC
// Each employer manages only their employees
getEmployerEmployees(companyA) β [emp1, emp2, emp3]
getEmployerEmployees(companyB) β [emp4, emp5]
// Payroll is isolated
companyA.executePayroll() β pays emp1, emp2, emp3
companyB.executePayroll() β pays emp4, emp5EmployeeRegistry (0x20B3dB45a351E92673112064A3F01951115eD6B7)
- Manages employee records
- Links employees to employers
- Handles employer registration
- Tracks employer-employee relationships
PayrollManager (0x1739715A3452BF1e336305cf8f9542d177cEa03A)
- Manages USDC deposits
- Executes payroll per employer
- Tracks employer balances
- Handles payroll history
frontend/
βββ app/
β βββ dashboard/ # Platform overview & statistics
β βββ employees/ # Employee management with employer registration
β βββ payroll/ # USDC deposits & payroll execution
β βββ settings/ # User preferences
βββ components/
β βββ ui/ # shadcn/ui components
β βββ providers/ # Wallet & context providers
βββ lib/
βββ abi/ # Smart contract ABIs
| Contract | Est. Gas | Cost (USDC) |
|---|---|---|
| EmployeeRegistry | ~1.5M | $2.40 |
| PayrollManager | ~2.6M | $4.16 |
| Total Deployment | ~4.1M | $6.56 |
| Operation | Est. Gas | Cost (USDC) |
|---|---|---|
| Register as Employer | 50,000 | $0.08 |
| Add Employee | 120,000 | $0.19 |
| Update Employee | 90,000 | $0.14 |
| Deactivate Employee | 80,000 | $0.13 |
| Approve USDC (once) | 40,000 | $0.06 |
| Deposit Payroll | 70,000 | $0.11 |
| Execute Payroll (per employee) | 150,000 | $0.24 |
Assumptions: 160 gwei gas price, $0.0016 per gas unit on Arc Network
- Register as employer: $0.08
- Add 5 employees: $0.95
- Approve USDC (one-time): $0.06
- Deposit $10,000: $0.11
- Execute payroll (5 employees): $1.20
- Total: $2.40 per payroll run
- Node.js 18+ installed
- Foundry installed (for smart contract development)
- Wallet with Arc Network USDC
cd Backend
forge install
forge build
forge test
# Deploy to Arc Network
forge script script/DeployDirect.s.sol --rpc-url $RPC_URL --broadcastcd frontend
npm install
npm run devOpen http://localhost:3000 to view the application.
- Connect your wallet - Click the connect button in the top right
- Register as employer - Go to Employees page and click "Register as Employer"
- Add your team - Add employees with their wallet addresses and salaries
- Fund your payroll - Go to Payroll page and deposit USDC
- Pay your team - Click "Pay All Employees" to execute payroll
- Next.js 14 - React framework with app router
- TypeScript - Type-safe development
- TailwindCSS - Utility-first styling
- shadcn/ui - Modern component library
- Privy - Embedded wallet authentication
- Wagmi - React hooks for Ethereum
- Lucide React - Beautiful icons
- Foundry - Smart contract development framework
- Solidity - Smart contract programming language
- OpenZeppelin - Security libraries (AccessControl, ReentrancyGuard, Pausable)
- Arc Network - Layer 2 blockchain for fast, cheap transactions
- Platform-wide statistics
- Recent payroll runs
- Total contract balance (admin view)
- Employer Registration - Self-service onboarding
- Employee List - View your team members
- Add Employee - Add new team members
- Edit Employee - Update employee details
- Activate/Deactivate - Manage employee status
- Deposit USDC - Fund your payroll account
- View Balance - Check your available funds
- Execute Payroll - Pay all active employees
- Payroll History - View past runs
- Company information
- Payment preferences
- Wallet management
- Wallet-based authentication - Secure login via Privy
- Role-based access control - Employers only manage their employees
- Isolated employer balances - Funds separated per employer
- ReentrancyGuard - Prevent reentrancy attacks
- Pausable - Emergency pause functionality
- Audit-ready code - Clean, well-documented contracts
- Multi-Tenant Design - Scalable to unlimited companies
- Self-Service - No manual onboarding required
- Gas Efficient - Shared contracts = lower costs for users
- Real Utility - Actual payroll management use case
- Production Ready - Complete frontend + backend
- Low Barrier - $0.08 to become an employer
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
For support and questions, please open an issue in this repository.