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
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.
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
Feature | Token | Native | Votes | Milestone |
---|---|---|---|---|
Token Type | ERC20 | ETH/Native | ERC5805 Governance | ERC20 |
Fee Types | Gas + Token | Gas Only | Gas + Token | Gas + Token |
Vesting Type | Time-based | Time-based | Time-based | Approval-based |
Special Features | Standard | ETH handling | Voting delegation | Milestones |
Vault Contracts | None | None | Individual | None |
Complexity | Medium | Low | High | Medium |
Gas Costs | Medium | Low | High | Medium |
🛡️ 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.