A decentralized autonomous organization (DAO) governance system for managing grants and treasury funds. Built with Solidity and Foundry, leveraging OpenZeppelin's battle-tested governance contracts.
Grant DAO enables token holders to propose, vote on, and execute grant distributions from a managed treasury. The system implements a robust governance framework with timelock controls, ensuring transparent and democratic fund allocation.
- Token-Based Voting: ERC20Votes governance token (GDT) with checkpointed voting power
- Proposal Creation: Token holders can create proposals for fund distribution
- Democratic Voting: Simple counting mechanism (For/Against/Abstain)
- Quorum Requirements: Configurable quorum percentage to ensure sufficient participation
- Timelock Protection: All approved proposals execute through a timelock delay for security
- ETH Grant Proposals: Distribute native ETH from the treasury
- ERC20 Grant Proposals: Distribute any ERC20 tokens held by the treasury
- Secure Execution: Only timelock-controlled execution of treasury operations
- Reentrancy Protection: Built-in security measures for all treasury operations
- Linear Vesting: Create vesting wallets for beneficiaries
- Flexible Configuration: Customizable start times and durations
- Token & ETH Support: Vest both native ETH and ERC20 tokens
- Timelock Controller: Mandatory delay before proposal execution
- Role-Based Access: Granular permission system for governance operations
- Proposal Thresholds: Minimum token requirements to create proposals
- Voting Delays & Periods: Configurable timing for fair participation
- GrantToken: ERC20 governance token with permit and voting extensions
- GrantGovernor: OpenZeppelin Governor with Settings, Counting, Votes, Quorum, and Timelock
- Treasury: Secure vault for DAO funds, controlled exclusively by the Timelock
- GrantVesting: Vesting wallet implementation for scheduled token releases
- ProposalBuilder: Utility library for constructing proposal transactions
- Solidity: ^0.8.24
- Foundry: Development framework and testing
- OpenZeppelin Contracts: v5.4.0 for governance and security primitives
- EVM: Cancun compatible
forge buildforge testforge script script/Deploy.s.sol --rpc-url <RPC_URL> --broadcastThe project includes ready-to-use scripts for common operations:
Deploy.s.sol: Deploy complete DAO systemProposeEthGrant.s.sol: Create ETH grant proposalsProposeErc20Grant.s.sol: Create ERC20 grant proposalsCastVote.s.sol: Vote on active proposalsQueueProposal.s.sol: Queue approved proposalsExecuteProposal.s.sol: Execute queued proposalsDeployVesting.s.sol: Create vesting wallets
Comprehensive test suite covering:
- Complete governance flow (propose → vote → queue → execute)
- Treasury security and access controls
- Vesting functionality
- Edge cases and failure scenarios
MIT