UrbanDAO is a blockchain-powered smart-city management platform built as an Angular PWA with a gasless, role-based decentralized governance system. The project combines on-chain transparency, operational efficiency, and frictionless user experience to coordinate every aspect of municipal interaction—from citizen grievances and taxation to project funding and feedback—through a multi-level DAO fueled by Ethereum (Sepolia, Polygon mainnet soon) and a robust Hardhat development environment.
- Overview
- Key Features
- System Architecture
- Roles & Permissions
- Core Smart Contracts
- Workflow Lifecycles
- Gasless Meta-Transactions
- Security Practices
- Tech Stack & Setup
- UI/UX Guidelines
- Contributing
- License
UrbanDAO is designed as an operating layer for smart cities, modernizing traditional grievance and tax management into an on-chain, trustless, and democratic system. Every major civic process is coordinated through carefully tiered roles in a DAO, ensuring accountability, efficiency, and accessibility with gasless transactions.
UrbanDAO’s entire governance, project management, and transaction lifecycles are enforced by smart contracts and powered by ERC-20 and NFT incentives. The project demonstrates advanced mastery of Solidity, DAO patterns, meta-transaction relayer systems, and seamless UI engineering.
| Feature | Description |
|---|---|
| Multilevel DAO | 8-tiered roles for fine-grained, decentralized municipal management. |
| Gasless UX | ERC-2771/relayer system for frictionless onboarding; citizens never pay gas directly. |
| Grievance Management | File, escalate, and track issues with off-chain/IPFS storage for extensibility and privacy. |
| Quadratic Voting | No single participant can dominate project funding or policy votes. |
| Tax Automation | Tax assessment and NFT “TaxReceipt” generation; on-chain evidence ensures voting rights. |
| Project Registry & Funding | Milestone-based funding with escrow—fully auditable, abuse-resistant, and transparent. |
| Upgradeable Contracts | Uses UUPS proxies for upgradability of all major modules. |
| Role-based Access Control | One address per role (OpenZeppelin AccessControl); strictly hierarchical privileges. |
| IPFS Integration | Critical citizen and project docs stored off-chain; hashes are referenced on-chain for verifiability. |
| Operational Security | Timelocks, reentrancy guards, oracle integration (Chainlink) for milestone proofs, and anti-abuse. |
- Frontend: Angular PWA, mobile-first, optimal responsiveness, no sidebar, smooth navigation.
- Blockchain Layer: Solidity smart contracts, Hardhat environment (v2.16.0+), deployed on Ethereum Sepolia testnet (Polygon and other L1/L2s planned), all contracts designed for upgradeability (UUPS).
- Interaction Layer: Ethers.js v6.15.0+, ERC-2771 meta-transactions using OpenGSN/Biconomy for gasless calls.
- Storage Layer: Event logs on-chain, text bodies/proofs on IPFS via Pinata.
- Access Control: Each role mapped to one EOA; OpenZeppelin’s AccessControl keeps admin hierarchy enforceable.
- Relayer Module: Trusted "Tx Payer" account for all contract gas.
| Role Name | Responsibility | Admin By | UI Access | Notes |
|---|---|---|---|---|
| Owner | Project owner (top tier) | — | No | Assigns adminGovt |
| adminGovt | Supervises all zones, funds, policy | Owner | Yes | Appoints adminHead |
| adminHead | City-level manager, appoints validators | adminGovt | Yes | Assigns TaxCollector, etc. |
| ProjectManager | Executes projects | adminHead | Yes | Escrow fund withdrawal |
| TaxCollector | Assesses/collects tax, issues NFT | adminHead | Yes | TaxReceipt NFT issuer |
| Validator | KYC, grievance & feedback approval | adminHead | Yes | Screens citizens/grievances |
| Citizen | Registers, files grievances, pays taxes | Validator | Yes | Can object to taxes |
| Tx Payer | Relayer for all gas payments | Owner | No | Only one account |
Note: Each role = one address, except Citizen: multiple citizens per city/district. See roles.png for a diagram.
- Enforced by OpenZeppelin AccessControl (on contract level).
- Each role’s admin is its immediate superior.
- All addresses can be changed/rotated only by their respective admins.
| Contract Name | Functionality |
|---|---|
| UrbanToken.sol | ERC-20 governance + utility token, stake for voting/discounts, onboarding rewards |
| UrbanDAO.sol | Governor + Timelock Controller; handles proposals, fund release, appointment |
| GrievanceHub.sol | Files, validates, tracks grievances and citizen feedback |
| TaxModule.sol | Tax assessment, ERC-20 SBT TaxReceipt NFT issuance, compliance tracking |
| ProjectRegistry.sol | Tracks projects from proposal to funds release to completion |
| MetaForwarder.sol | ERC-2771 Trusted Forwarder for all meta-transactions (gasless UX) |
- Use of mappings (vs arrays) for O(1) lookups.
- Packed enums for status (vs strings).
- All event logs (no large text) on-chain; heavy data stored on IPFS.
- Upgradable (UUPS) proxies throughout.
- Register on UI with KYC details (IPFS hash upload).
- Validator checks documents and approves/rejects.
- UrbanToken mints minimal reward for every new successful onboard.
- TaxCollector assigns annual tax post KYC (per address/user).
- Citizen pays using payTax() (meta-tx, so no gas paid directly).
- Receipt minted as ERC-721 SBT; proves tax paid (required for DAO votes).
- Citizen files up to 3 grievances/month.
- Validator reviews for spam/abuse.
- adminHead adjudicates, may open new project if valid.
- Project proposal is open for quadratic vote.
- If passed, ProjectManager handles execution and fund tranches released on milestone proofs.
- Citizens can send feedback after resolution.
- Unresolved status = grievance reopens; three reopens auto-escalate to adminGovt.
- Meta-tx Framework: ERC-2771 (OpenGSN/Biconomy) for relayed, gasless txs.
- Contract Engineering: Inherit
ERC2771Context, override_msgSender()for identity recovery. - Security: Nonce mapping to prevent replay, trusted forwarder address timelocked, permissioned.
Relayer Workflow:
- Citizen signs tx offline.
- Tx Payer (forwarder/relayer) pays gas, forwards tx to contracts.
- Contract authenticates sender and processes.
- Fees reclaimed/reimbursed via stablecoin from treasury.
- Hierarchical Role Control: Tiered getRoleAdmin() prevents privilege escalation.
- Timelock: All treasury transfers have a 24-hour delay.
- Reentrancy Guards: All sensitive functions (
payTax, milestone withdrawal) protected. - Oracle Integration: Milestone claims use Chainlink proofs if required.
- Gas Relayer Hardening: Nonce + signature checks for anti-replay; relayer address changes require DAO vote.
- Solidity: ^0.8.22
- Hardhat: ^2.16.0
- ethers.js: ^6.15.0
- OpenZeppelin Contracts: AccessControl, ERC-20, ERC-721, UUPS proxies, ERC-2771Context
- Pinata/IPFS: Citizen data, project docs off-chain (see
PinataAPI-KEYS.txt)
- Angular PWA: Mobile-first, responsive PWA (no sidebar, all rounded corners).
- Theming: Primary color is linear-gradient(135deg, #a259d9, #5e239d), with dark background.
# Clone the repo
git clone https://github.com/yourusername/UrbanDAO.git
cd UrbanDAO
# Install dependencies
npm install
# Start the Angular App (with proxy if needed)
ng serve --open
# For contracts, enter /contracts and run Hardhat locally:
cd contracts
npm install
npx hardhat compile
npx hardhat test
npx hardhat nodeFirst-Time Setup:
- Populate
.envfiles for Angular and Hardhat. - Place
PinataAPI-KEYS.txtfor IPFS key provisioning.
| Principle | Details |
|---|---|
| Clean, Minimal UI | Reference parse.bot for simplicity, clarity, and smoothness. |
| Colors | Primary: linear-gradient(135deg, #a259d9, #5e239d); Bg: Black/Dark. |
| No Sidebar | Navigation is tabbed/modal-based for ultimate UX. |
| Responsiveness | Works perfectly across all device viewports and browsers. |
| All Elements Rounded | Buttons, containers, modals, inputs all have rounded corners. |
| Fast, No Lag Experience | Optimize for zero jank in navigation or transitions. |
- Index / Home
- Login
- Register
- Registration Status
-
Citizens:
- Dashboard
- File/check grievances, view project status, KYC/tax module
-
Validator:
- Dashboard
- Approve citizens, filter grievances, validate feedback
-
Tax Collector:
- Dashboard
- Assign/read taxes, issue receipts
-
Project Manager:
- Dashboard
- Project milestones, fund requests
-
adminHead:
- Dashboard
- Appoint roles, accept/reject grievances, curate projects
-
adminGovt:
- Dashboard
- Manage zones, funds, all project/tax/citizen records
-
Tx Payer & Owner:
- No UI (fully backend/blockchain roles)
- Fork the repo; create your branch (
git checkout -b my-feature). - Commit changes with clear messages.
- Submit a PR and describe what your changes add/improve.
Please follow Conventional Commits for all commit messages.
UrbanDAO is released under the MIT License.
UrbanDAO brings transparency, efficiency, and inclusivity to smart-city governance—by the people, for the people, on-chain.