GaugeFactory

Description:

A factory contract for deploying new instances of the Gauge contract. It allows specifying the core parameters (_pool, _bribe, _ve) and either uses the factory caller (msg.sender) as the Voter address or allows specifying it explicitly.


createGauge

function createGauge(address _pool, address _bribe, address _ve) external returns (address)

Description:

Deploys a new Gauge contract instance. The caller (msg.sender) of this function is automatically set as the _voter address within the newly created Gauge. Stores the address of the deployed gauge in last_gauge. Typically called by the main Voter contract.

Input Parameters:

Name
Type
Description

_pool

address

The address of the LP token (stake) for the new Gauge.

_bribe

address

The address of the associated Bribe contract for the new Gauge.

_ve

address

The address of the VotingEscrow contract for the new Gauge.

Return Value:

Type
Description

address

The address of the newly deployed Gauge contract.


createGaugeSingle

function createGaugeSingle(address _pool, address _bribe, address _ve, address _voter) external returns (address)

Description:

Deploys a new Gauge contract instance, allowing the caller to explicitly specify the _voter address. Stores the address of the deployed gauge in last_gauge. Might be used for gauges associated with a different voter or deployed via an alternative mechanism.

Input Parameters:

Name
Type
Description

_pool

address

The address of the LP token (stake) for the new Gauge.

_bribe

address

The address of the associated Bribe contract for the new Gauge.

_ve

address

The address of the VotingEscrow contract for the new Gauge.

_voter

address

The explicit address to set as the Voter for the new Gauge.

Return Value:

Type
Description

address

The address of the newly deployed Gauge contract.

Last updated