Governance Contracts
ℹ Source files
contracts/governance/VarlaGovernor.solcontracts/governance/VarlaTimelock.sol VarlaGovernor
Standard OpenZeppelin Governor with voting, quorum, and timelock execution. Uses the VRLA token for voting power.
solidity
contract VarlaGovernor is
Governor,
GovernorVotes, // VRLA token for voting power
GovernorCountingSimple, // For/Against/Abstain
GovernorVotesQuorumFraction, // Quorum as % of total supply
GovernorTimelockControl // Execute via timelock
{ ... } | Parameter | Description |
|---|---|
votingDelay | Blocks between proposal creation and voting start (immutable) |
votingPeriod | Duration of voting in blocks (immutable) |
proposalThreshold | Minimum VRLA tokens required to create a proposal (immutable) |
quorumNumerator | Quorum as a percentage of total VRLA supply (e.g. 4%) |
VarlaTimelock
A standard OpenZeppelin TimelockController. All governance-approved proposals are executed through this contract after a mandatory delay.
solidity
contract VarlaTimelock is TimelockController {
constructor(
uint256 minDelay,
address[] memory proposers,
address[] memory executors,
address admin
) TimelockController(minDelay, proposers, executors, admin) { }
} | Parameter | Description |
|---|---|
minDelay | Minimum seconds between queueing and execution |
proposers | Addresses allowed to queue proposals (typically the Governor) |
executors | Addresses allowed to execute queued proposals |
Governance Flow
text
1. VRLA holder creates proposal → VarlaGovernor.propose()
2. Wait votingDelay blocks
3. VRLA holders vote → VarlaGovernor.castVote()
4. Wait votingPeriod blocks
5. If quorum met + majority For → VarlaGovernor.queue()
6. Wait minDelay (timelock) → VarlaTimelock
7. Execute → VarlaGovernor.execute() ✦ Key Takeaways
- Standard OpenZeppelin Governor + TimelockController pattern
- Voting power from VRLA token (ERC20Votes)
- All parameters (delay, period, threshold) are immutable after deployment
- Timelock enforces mandatory delay between approval and execution