Amplify
Launch AppGithub
  • Introduction
    • Amplify Overview
    • Concepts
      • Networks
      • DApps
      • Network Investors
      • LPs & Traders
    • Getting Started
      • Networks
      • DApps
      • Investors
  • Developers
    • Smart Contracts
      • VoteEscrowDistribution
      • Voter
      • VoteEscrow
      • Factories
        • Factory
        • IncentivesManagerFactory
        • VoterFactories
        • VoteEscrowFactory
        • GaugeFactory
          • BaseGaugeFactory
        • BribeFactory
          • BaseBribeFactory
      • Bribe
      • Gauge
      • IncentivesManager
    • Deployments
      • Arbitrum Sepolia
  • Resources
    • Brand Assets
    • Bug Bounty
    • Security & Audits
    • Whitelisting
  • Terms of Service
    • Privacy Policy
    • Terms of Use
Powered by GitBook
On this page
  • Description:
  • Constructor
  • createVoteEscrow
  • _setVoter
  • _setIncentivesManager
  • setFactory
  1. Developers
  2. Smart Contracts
  3. Factories

VoteEscrowFactory


Description:

A factory contract used to deploy new instances of the VoteEscrow contract. Includes controls to restrict deployment and certain setup calls to an authorized factory address, managed by the contract owner.


Constructor

constructor()

Description:

Initializes the VoteEscrowFactory, setting the deployer (msg.sender) as the initial owner. The factory address is not set and needs to be configured via setFactory.


createVoteEscrow

function createVoteEscrow(address token_addr, address user_registry) external onlyFactory returns (address)

Description:

Deploys a new VoteEscrow contract instance. Only callable by the authorized factory address. Stores the address of the newly deployed contract in lastVoteEscrow.

Input Parameters:

Name
Type
Description

token_addr

address

The address of the underlying ERC20 token for the new VoteEscrow.

user_registry

address

The address of the UserRegistry for the new VoteEscrow.

Return Value:

Type
Description

address

The address of the newly deployed VoteEscrow contract.


_setVoter

function _setVoter(address _voteEscrow, address _voter) external onlyFactory

Description:

Allows the authorized factory address to call the setVoter function on a specific, already deployed VoteEscrow contract instance.

Input Parameters:

Name
Type
Description

_voteEscrow

address

The address of the target VoteEscrow contract.

_voter

address

The address to set as the voter on the target.


_setIncentivesManager

function _setIncentivesManager(address _voteEscrow, address _incentivesManager) external onlyFactory

Description:

Allows the authorized factory address to call the setIncentivesManager function on a specific, already deployed VoteEscrow contract instance.

Input Parameters:

Name
Type
Description

_voteEscrow

address

The address of the target VoteEscrow contract.

_incentivesManager

address

The address of the IncentivesManager to set on the target.


setFactory

function setFactory(address _factory) external onlyOwner

Description:

Allows the owner of the VoteEscrowFactory to set or update the factory address, which is authorized to deploy new VoteEscrow contracts and call setup functions.

Input Parameters:

Name
Type
Description

_factory

address

The address authorized to act as the factory.

PreviousVoterFactoriesNextGaugeFactory

Last updated 2 months ago