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
  • createVoter
  • _setIncentivesManager
  • _createGauge
  • setFactory
  1. Developers
  2. Smart Contracts
  3. Factories

VoterFactories

Description:

A factory contract responsible for deploying new instances of the Voter contract. It includes owner and factory address controls to restrict who can deploy voters and call certain setup functions.


Constructor

constructor()

Description:

Initializes the VoterFactory contract, setting the deployer as the initial owner. The factory address (presumably another controlling contract) is not set initially and must be configured later via setFactory.


createVoter

function createVoter(
    address _ve,
    address _gauges,
    address _bribes,
    address _reward_token
) external onlyFactory returns (address)

Description:

Deploys a new Voter contract instance using the provided parameters. Only callable by the designated factory address. Stores the address of the newly created Voter in lastVoter.

Input Parameters:

Name
Type
Description

_ve

address

The address of the VotingEscrow contract for the new Voter.

_gauges

address

The address of the GaugeFactory for the new Voter.

_bribes

address

The address of the BribeFactory for the new Voter.

_reward_token

address

The address of the base reward token for the new Voter.

Return Value:

Type
Description

address

The address of the newly deployed Voter contract.


_setIncentivesManager

function _setIncentivesManager(address _voter, address _incentivesManager) external onlyFactory

Description:

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

Input Parameters:

Name
Type
Description

_voter

address

The address of the target Voter contract.

_incentivesManager

address

The address of the IncentivesManager to set.


_createGauge

function _createGauge(address _voter, address _tokenAddress) external onlyFactory returns (address)

Description:

Allows the designated factory address to call the createGauge function on a specific, already deployed Voter contract instance, passing through the pool token address.

Input Parameters:

Name
Type
Description

_voter

address

The address of the target Voter contract.

_tokenAddress

address

The address of the pool token for which to create the gauge.

Return Value:

Type
Description

address

The address of the newly created gauge.


setFactory

function setFactory(address _factory) external onlyOwner

Description:

Allows the owner of the VoterFactory to set or update the factory address, which is authorized to call deployment and setup functions like createVoter.

Input Parameters:

Name
Type
Description

_factory

address

The address authorized to act as the factory.

PreviousIncentivesManagerFactoryNextVoteEscrowFactory

Last updated 2 months ago