TokenVestingManagerVotesFactory
Factory for deploying governance-enabled token vesting managers with individual vault contracts and voting power delegation capabilities.
Contract Information
File Location: contracts/factories/TokenVestingManagerVotesFactory.sol
Inheritance:
contract TokenVestingManagerVotesFactory is ITokenVestingManagerVotesFactory, FactoryFeeManager
Overview
The TokenVestingManagerVotesFactory
deploys TokenVestingManagerVotes
instances specifically designed for governance tokens. Each vesting schedule gets its own isolated vault contract that can participate in governance through voting power delegation while maintaining secure token custody.
Key Features
- Governance integration - Deploys voting-enabled vesting managers
- Individual vault contracts - Each vesting gets isolated token custody
- Voting power delegation - Recipients can delegate their vesting tokens' voting power
- ERC5805 compatibility - Works with standard governance frameworks
- Vault implementation management - Requires vault implementation contract address
Key Differences from Standard Factory
- Vault implementation parameter - Requires address of deployed Vault contract for cloning
- Governance focus - Specifically designed for governance token vesting
- Individual vaults - Each vesting creates its own vault contract via EIP-1167 minimal proxy
- Voting capabilities - Enables delegation without token transfer
Constructor
constructor(
address feeCollector_,
uint256 defaultGasFee_,
uint256 defaultTokenFee_,
address vaultImplementation_
) FactoryFeeManager(feeCollector_, defaultGasFee_, defaultTokenFee_)
Parameters:
feeCollector_
: Address that will receive deployment and usage feesdefaultGasFee_
: Default gas fee amount (in wei) for deployments without custom feesdefaultTokenFee_
: Default token fee percentage (in basis points) for deployments without custom feesvaultImplementation_
: Address of the deployed Vault implementation contract for cloning
Example:
// Deploy vault implementation first
Vault vaultImpl = new Vault();
// Deploy factory with vault implementation
TokenVestingManagerVotesFactory factory = new TokenVestingManagerVotesFactory(
0x123...789, // Fee collector address
0.001 ether, // 0.001 ETH gas fee
100, // 1% token fee (100 basis points)
address(vaultImpl) // Vault implementation
);
Core Functions
newTokenVestingManagerVotes
function newTokenVestingManagerVotes(
address tokenAddress,
ITypes.FundingType fundingType
) external returns (TokenVestingManagerVotes)
Deploys a new TokenVestingManagerVotes
instance with caller-specific fee configuration and vault support.
Parameters:
tokenAddress
: ERC5805-compatible governance token contract addressfundingType
: Funding model (ITypes.FundingType.Full
orITypes.FundingType.Partial
)
Returns: Address of the newly deployed TokenVestingManagerVotes
Process:
- Fee determination - Checks for custom fees for
msg.sender
, otherwise uses defaults - Manager deployment - Creates new
TokenVestingManagerVotes
with vault implementation - Admin transfer - Sets deployer as admin and removes factory admin privileges
- Event emission - Emits
TokenVestingManagerVotesCreated
event
Example:
// Deploy manager for governance token (e.g., UNI, COMP)
TokenVestingManagerVotes manager = factory.newTokenVestingManagerVotes(
0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984, // UNI token address
ITypes.FundingType.Full
);
// Manager is deployed with:
// - Token: UNI (governance token)
// - Vault implementation: Factory's vault implementation
// - Fee type: Determined by deployer's custom config or factory default
// - Fee amount: Determined by deployer's custom config or factory default
// - Fee collector: Factory's fee collector
// - Funding type: Full
// - Admin: msg.sender (deployer)
Events
TokenVestingManagerVotesCreated
event TokenVestingManagerVotesCreated(
TokenVestingManagerVotes indexed tokenVestingManagerVotes,
address indexed token,
ITypes.FeeType feeType,
uint256 fee,
address indexed feeCollector,
address creator,
ITypes.FundingType fundingType,
address vaultImplementation
)
Emitted when a new TokenVestingManagerVotes
is deployed.
Parameters:
tokenVestingManagerVotes
: Address of the deployed manager contracttoken
: Governance token address being managedfeeType
: Fee structure type (Gas
orDistributionToken
)fee
: Fee amount (wei for gas fees, basis points for token fees)feeCollector
: Address that will collect feescreator
: Address that deployed the managerfundingType
: Funding model usedvaultImplementation
: Address of the vault implementation used for cloning
Vault Implementation Requirements
The vault implementation must:
- Implement IVault interface - Required for manager interaction
- Support ERC5805 - Enable governance participation
- Be deployable via EIP-1167 - Support minimal proxy cloning
- Handle initialization - Proper setup for token, beneficiary, and manager
Security Considerations
Governance Security
- Delegation control - Only vesting recipients can delegate their tokens' voting power
- Vault isolation - Each vesting has isolated token custody
- Voting power integrity - Tokens remain locked while voting power is delegated
Access Control
- Factory admin controls - Only factory admin can set custom fees
- Manager admin transfer - Deployer becomes manager admin immediately
- Vault beneficiary control - Only manager can change vault beneficiaries
Implementation Security
- Vault implementation validation - Ensure vault implementation is properly audited
- EIP-1167 safety - Minimal proxy pattern requires careful implementation
- Initialization protection - Prevent double initialization of vault contracts
Common Use Cases
1. DAO Member Vesting
// Deploy manager for DAO governance tokens
TokenVestingManagerVotes daoManager = factory.newTokenVestingManagerVotes(
daoGovernanceToken,
ITypes.FundingType.Full
);
// Create member vestings with immediate voting power
2. Governance Rewards Distribution
// Deploy manager for governance participation rewards
TokenVestingManagerVotes rewardsManager = factory.newTokenVestingManagerVotes(
rewardToken,
ITypes.FundingType.Partial
);
// Distribute rewards that can participate in governance
Best Practices
- Governance compatibility - Verify token implements ERC5805 for voting
- Delegation strategy - Plan initial delegation setup for recipients
- Non-revocable consideration - Consider making governance vestings non-revocable
- Batch operations - Use batch delegation functions for efficiency
Comparison with Standard Factory
Feature | TokenVestingManagerVotesFactory | TokenVestingManagerFactory |
---|---|---|
Governance Support | Yes (voting delegation) | No |
Vault Contracts | Individual per vesting | None |
Token Requirements | ERC5805 governance tokens | Any ERC20 |
Deployment Complexity | Higher (vault management) | Lower |
Gas Costs | Higher (vault deployment) | Lower |
Use Case | Governance participation | Standard vesting |
The TokenVestingManagerVotesFactory
provides specialized deployment for governance token vesting with voting capabilities, enabling seamless participation in DAO governance while maintaining secure token vesting schedules.