This project implements a frontend for a DAO (Decentralized Autonomous Organization) voting system, built on top of OpenZeppelin's governance contracts.
The system is built using OpenZeppelin's modular governance system, which allows for flexible and customizable on-chain voting protocols. The implementation includes:
-
Governor Contract
- Core contract containing all governance logic and primitives
- Abstract contract that requires implementation of specific modules
- Handles proposal creation, voting, and execution
-
Voting Modules
GovernorVotes: Extracts voting weight from an IVotes contractGovernorVotesQuorumFraction: Sets quorum as a fraction of total token supplyGovernorVotesSuperQuorumFraction: Implements super quorum functionality
-
Counting Modules
GovernorCountingSimple: Basic voting with 3 options (Against, For, Abstain)GovernorCountingFractional: Advanced voting allowing partial voting power allocationGovernorCountingOverridable: Extended version allowing delegate overrides
-
Voting System
- Configurable voting delay and period
- Flexible quorum requirements
- Support for different voting mechanisms
- Vote delegation capabilities
-
Security Features
- Reentrancy protection
- Access control mechanisms
- Timelock functionality for proposal execution
-
Token Integration
- ERC-20 token support for voting power
- Token delegation system
- Vote tracking and history
-
Proposal Creation
- Proposals can be created by token holders
- Each proposal includes targets, values, and calldata
- Proposals require a minimum threshold of voting power
-
Voting Period
- Configurable delay before voting starts
- Set duration for voting period
- Quorum requirements must be met
-
Execution
- Successful proposals can be executed after voting period
- Optional timelock delay for execution
- Execution through timelock controller
votingDelay(): Time between proposal submission and voting startvotingPeriod(): Duration of the voting periodquorum(): Required voting power for proposal successproposalThreshold(): Minimum voting power to create proposals
- Node.js
- Foundry
- Solidity ^0.8.20
- Install dependencies:
npm install- Configure environment variables in foundry folder (LOCAL_PRIVATE_KEY):
cp .env.example .env- Run tests:
forge test- All governance functions require proper access control
- Timelock delays should be carefully configured
- Quorum requirements should be set appropriately
- Consider using OpenZeppelin's security features
MIT License
First, run the development server:
npm run dev
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## Learn More
npx -y @upstash/context7-mcp@latest
## Deployed to Vercel
https://web3-dao-app.vercel.app/
###Initial Distribution Strategy:
Keep 40% for DAO treasury Distribute 30% to founding members Reserve 20% for future contributors Use 10% for incentives/rewards
###Governance Participation:
Require token delegation for voting Set minimum proposal thresholds Create discussion forums Regular community calls