Skip to main content

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 fees
  • defaultGasFee_: Default gas fee amount (in wei) for deployments without custom fees
  • defaultTokenFee_: Default token fee percentage (in basis points) for deployments without custom fees
  • vaultImplementation_: 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 address
  • fundingType: Funding model (ITypes.FundingType.Full or ITypes.FundingType.Partial)

Returns: Address of the newly deployed TokenVestingManagerVotes

Process:

  1. Fee determination - Checks for custom fees for msg.sender, otherwise uses defaults
  2. Manager deployment - Creates new TokenVestingManagerVotes with vault implementation
  3. Admin transfer - Sets deployer as admin and removes factory admin privileges
  4. 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 contract
  • token: Governance token address being managed
  • feeType: Fee structure type (Gas or DistributionToken)
  • fee: Fee amount (wei for gas fees, basis points for token fees)
  • feeCollector: Address that will collect fees
  • creator: Address that deployed the manager
  • fundingType: Funding model used
  • vaultImplementation: 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

  1. Governance compatibility - Verify token implements ERC5805 for voting
  2. Delegation strategy - Plan initial delegation setup for recipients
  3. Non-revocable consideration - Consider making governance vestings non-revocable
  4. Batch operations - Use batch delegation functions for efficiency

Comparison with Standard Factory

FeatureTokenVestingManagerVotesFactoryTokenVestingManagerFactory
Governance SupportYes (voting delegation)No
Vault ContractsIndividual per vestingNone
Token RequirementsERC5805 governance tokensAny ERC20
Deployment ComplexityHigher (vault management)Lower
Gas CostsHigher (vault deployment)Lower
Use CaseGovernance participationStandard 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.