Skip to main content

Factory Contracts

Factory contracts provide standardized deployment and configuration mechanisms for all TokenOps vesting managers. They ensure consistent fee structures, proper initialization, and centralized management of deployment configurations.

📚 Available Factories

Standard Vesting Factories

TokenVestingManagerFactory

contract TokenVestingManagerFactory is ITokenVestingManagerFactory, FactoryFeeManager

Deploys standard ERC20 token vesting managers with flexible fee structures and funding models.

NativeTokenVestingManagerFactory

contract NativeTokenVestingManagerFactory is INativeTokenVestingManagerFactory, FactoryFeeManager

Deploys ETH/native token vesting managers with simplified gas-based fee structures.

Specialized Vesting Factories

TokenVestingManagerVotesFactory

contract TokenVestingManagerVotesFactory is ITokenVestingManagerVotesFactory, FactoryFeeManager

Deploys governance-enabled vesting managers with individual vault contracts and voting power delegation.

VestedMilestoneManagerFactory

contract VestedMilestoneManagerFactory is IVestedMilestoneManagerFactory, FactoryFeeManager

Deploys milestone-based vesting managers with admin approval workflows and achievement-based releases.

🔧 Common Features

All factory contracts share these characteristics:

Standardized Deployment

  • Consistent constructor patterns across all vesting manager types
  • Automated admin transfer - Deployer becomes manager admin, factory relinquishes control
  • Event emission for deployment tracking and indexing
  • Parameter validation to ensure proper configuration

Fee Management

  • Custom fee support for different deployer types through FactoryFeeManager inheritance
  • Default fee fallback when custom fees are not configured
  • Flexible fee types - Gas fees (ETH) or token-based fees (percentage)
  • Fee collector management with role-based access control

Access Control

  • Factory admin privileges for setting custom fees and managing configurations
  • Immediate admin transfer to deployer upon successful deployment
  • Role separation between factory operations and manager operations

🎯 Factory Selection Guide

Choose TokenVestingManagerFactory when:

  • Working with standard ERC20 tokens
  • Need traditional time-based vesting
  • Want flexible fee structures (gas or token fees)
  • Building employee compensation or investor vesting

Choose NativeTokenVestingManagerFactory when:

  • Working with ETH or native blockchain tokens
  • Want simplified gas-only fee structure
  • Need direct ETH handling without token contracts
  • Building ETH-based compensation systems

Choose TokenVestingManagerVotesFactory when:

  • Working with governance tokens (ERC5805)
  • Need voting power delegation during vesting
  • Want individual vault contracts per vesting
  • Building DAO member compensation or governance rewards

Choose VestedMilestoneManagerFactory when:

  • Need achievement-based token releases
  • Want admin approval workflows
  • Building project-based payments
  • Need performance tracking and deliverable verification

📊 Factory Comparison

FeatureTokenNativeVotesMilestone
Token TypeERC20ETH/NativeERC5805 GovernanceERC20
Fee TypesGas + TokenGas OnlyGas + TokenGas + Token
Vesting TypeTime-basedTime-basedTime-basedApproval-based
Special FeaturesStandardETH handlingVoting delegationMilestones
Vault ContractsNoneNoneIndividualNone
ComplexityMediumLowHighMedium
Gas CostsMediumLowHighMedium

🛡️ Security Considerations

Factory Security

  • Admin privilege transfer ensures deployer gets immediate control
  • Fee collector validation prevents zero address assignments
  • Parameter validation ensures proper configuration

Deployment Security

  • Address validation for token contracts and fee collectors
  • Configuration verification before manager deployment
  • Event emission for deployment tracking and auditing

The factory system provides a robust foundation for deploying standardized vesting solutions across different token types and use cases while maintaining security, consistency, and flexibility.