Documentation Index
Fetch the complete documentation index at: https://mintlify.com/reserve-protocol/reserve-index-dtf/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The GovernanceDeployer contract is a factory that deploys complete governance systems with a single transaction. It creates a StakingVault (voting token), Governor, and Timelock Controller, all properly configured and connected.Key Features
- One-Transaction Deployment: Creates entire governance stack atomically
- Deterministic Addresses: Uses CREATE2 for predictable contract addresses
- Staking Vault Integration: Deploys ERC4626 staking vaults with voting power
- Timelock Control: Governor proposals execute through a timelock
- Guardian Roles: Supports guardian addresses with cancellation powers
Architecture
GovernanceDeployer uses minimal proxy clones (EIP-1167) for gas-efficient deployments:- Governor Implementation: Clone of FolioGovernor
- Timelock Implementation: Clone of TimelockControllerUpgradeable
- StakingVault Implementation: Clone of StakingVault
Deployment Functions
Deploy Governed Staking Token
Deploy a complete governance system with a new staking vault.Name of the staking vault token
Symbol of the staking vault token
Underlying token that will be staked
Governance parameters including voting periods, thresholds, and guardians
Salt for deterministic deployment
GovernanceDeployer.sol
This function deploys all three contracts (StakingVault, Governor, Timelock) and configures them to work together. The timelock becomes the owner of the staking vault.
Deploy Governance With Timelock
Deploy only the Governor and Timelock (for existing voting tokens).Governance parameters
Existing voting token to use
Salt for deterministic deployment
GovernanceDeployer.sol
Governance Parameters
TheGovParams struct configures all governance settings:
Delay before voting begins after proposal creation (seconds)
Duration of voting period (seconds)
Minimum voting power required to create a proposal (D18 format)
Minimum voting power required for quorum (D18 format)
Delay before approved proposals can be executed (seconds)
Addresses that can cancel malicious proposals
Default Configuration
Half-life for reward distribution in staking vaults
Delay before unstaked tokens can be withdrawn
Events
Emitted when a complete governance system with staking vault is deployedParameters:
underlying- Underlying token addressstToken- Deployed staking vault addressgovernor- Deployed governor addresstimelock- Deployed timelock address
Emitted when governance (without new staking vault) is deployedParameters:
stToken- Voting token addressgovernor- Deployed governor addresstimelock- Deployed timelock address
Implementation Addresses
Immutable address of the FolioGovernor implementation to clone
Immutable address of the TimelockController implementation to clone
Immutable address of the StakingVault implementation to clone