When to activate
- Designing DAO governance structures and voting systems
- Building treasury management contracts with multi-sig
- Implementing token-weighted or quadratic voting
- Creating proposal lifecycle (draft → vote → execute)
- Setting up governance delegation and representative systems
When NOT to use
- For centralized organization management
- For simple multi-sig wallets without governance
- For off-chain voting tools (Snapshot is sufficient alone)
Instructions
- Define governance model. Token-weighted (1 token = 1 vote), quadratic (sqrt), conviction voting, or hybrid.
- Design proposal lifecycle. Draft → Discussion → Voting → Timelock → Execution. Define quorum and thresholds.
- Implement voting. Governor contract (OpenZeppelin), delegation, vote snapping, late quorum extension.
- Treasury management. Multi-sig (Gnosis Safe), timelock controller, spending limits, budget allocation.
- Delegation. Delegate votes without transferring tokens. Partial delegation. Liquid democracy patterns.
- Execution. Timelock for approved proposals. Optimistic governance (execute unless vetoed). Module-based execution.
- Security. Prevent vote buying (snapshot at proposal time), flash loan governance attacks, delegation cycles.
Example
// OpenZeppelin Governor with Timelock
contract MyDAO is Governor, GovernorSettings, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction, GovernorTimelockControl {
constructor(IVotes _token, TimelockController _timelock)
Governor("MyDAO")
GovernorSettings(1, 50400, 1000e18) // 1 block delay, 1 week voting, 1000 token threshold
GovernorVotes(_token)
GovernorVotesQuorumFraction(4) // 4% quorum
GovernorTimelockControl(_timelock)
{}
}
1---2name: dao-governance3description: Build DAO governance systems — voting mechanisms, treasury management, delegation, and proposal lifecycle4allowed-tools: [Read, Write, Bash, Grep]5effort: high6metadata:7 source: https://skillmd.com/skills/uitbreidenos/dao-governance8---910## When to activate1112- Designing DAO governance structures and voting systems13- Building treasury management contracts with multi-sig14- Implementing token-weighted or quadratic voting15- Creating proposal lifecycle (draft → vote → execute)16- Setting up governance delegation and representative systems1718## When NOT to use1920- For centralized organization management21- For simple multi-sig wallets without governance22- For off-chain voting tools (Snapshot is sufficient alone)2324## Instructions25261. **Define governance model.** Token-weighted (1 token = 1 vote), quadratic (sqrt), conviction voting, or hybrid.272. **Design proposal lifecycle.** Draft → Discussion → Voting → Timelock → Execution. Define quorum and thresholds.283. **Implement voting.** Governor contract (OpenZeppelin), delegation, vote snapping, late quorum extension.294. **Treasury management.** Multi-sig (Gnosis Safe), timelock controller, spending limits, budget allocation.305. **Delegation.** Delegate votes without transferring tokens. Partial delegation. Liquid democracy patterns.316. **Execution.** Timelock for approved proposals. Optimistic governance (execute unless vetoed). Module-based execution.327. **Security.** Prevent vote buying (snapshot at proposal time), flash loan governance attacks, delegation cycles.3334## Example3536```solidity37// OpenZeppelin Governor with Timelock38contract MyDAO is Governor, GovernorSettings, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction, GovernorTimelockControl {39 constructor(IVotes _token, TimelockController _timelock)40 Governor("MyDAO")41 GovernorSettings(1, 50400, 1000e18) // 1 block delay, 1 week voting, 1000 token threshold42 GovernorVotes(_token)43 GovernorVotesQuorumFraction(4) // 4% quorum44 GovernorTimelockControl(_timelock)45 {}46}47```