Skip to main content

GaugeControllerUpgradeable

GaugeControllerUpgradeable

WEEK

uint256 WEEK

MULTIPLIER

uint256 MULTIPLIER

WEIGHT_VOTE_DELAY

uint256 WEIGHT_VOTE_DELAY

setVotingEscrow

function setVotingEscrow(contract IVotingEscrow newVotingEscrow) external virtual

set new votingEscrow

NameTypeDescription
newVotingEscrowcontract IVotingEscrowaddress of votingEscrow

setP12CoinFactory

function setP12CoinFactory(address newP12Factory) external virtual

set new p12CoinFactory

NameTypeDescription
newP12Factoryaddressaddress of newP12Factory

getGaugeTypes

function getGaugeTypes(address addr) external view virtual returns (int128)

Get gauge type for address

NameTypeDescription
addraddressGauge address
NameTypeDescription
[0]int128Gauge type id

addGauge

function addGauge(address addr, int128 gaugeType, uint256 weight) external virtual

Add gauge addr of type gaugeType with weight weight

NameTypeDescription
addraddressGauge address
gaugeTypeint128Gauge type
weightuint256Gauge weight

checkpoint

function checkpoint() external virtual

Checkpoint to fill data common for all gauges

checkpointGauge

function checkpointGauge(address addr) external virtual

Checkpoint to fill data for both a specific gauge and common for all gauges

NameTypeDescription
addraddressGauge address

gaugeRelativeWeight

function gaugeRelativeWeight(address addr, uint256 time) external view virtual returns (uint256)

Get Gauge relative weight (not more than 1.0) normalized to 1e18 (e.g. 1.0 == 1e18). Inflation which will be received by it is inflation_rate * relative_weight / 1e18

NameTypeDescription
addraddressGauge address
timeuint256Relative weight at the specified timestamp in the past or present
NameTypeDescription
[0]uint256Value of relative weight normalized to 1e18

gaugeRelativeWeightWrite

function gaugeRelativeWeightWrite(address addr, uint256 time) external virtual returns (uint256)

Get gauge weight normalized to 1e18 and also fill all the unfilled values for type and gauge records

Any address can call, however nothing is recorded if the values are filled already

NameTypeDescription
addraddressGauge address
timeuint256Relative weight at the specified timestamp in the past or present
NameTypeDescription
[0]uint256Value of relative weight normalized to 1e18

addType

function addType(string name, uint256 weight) external virtual

Add gauge type with name name and weight weight

NameTypeDescription
namestringName of gauge type
weightuint256Weight of gauge type

changeTypeWeight

function changeTypeWeight(int128 typeId, uint256 weight) external virtual

Change gauge type typeId weight to weight

NameTypeDescription
typeIdint128Gauge type id
weightuint256New Gauge weight

changeGaugeWeight

function changeGaugeWeight(address addr, uint256 weight) external virtual

Change weight of gauge addr to weight

NameTypeDescription
addraddressGaugeController contract address
weightuint256New Gauge weight

voteForGaugeWeights

function voteForGaugeWeights(address gaugeAddr, uint256 userWeight) external virtual

Allocate voting power for changing pool weights

NameTypeDescription
gaugeAddraddressGauge which msg.sender votes for
userWeightuint256Weight for a gauge in bps (units of 0.01%). Minimal is 0.01%. Ignored if 0

getGaugeWeight

function getGaugeWeight(address addr) external view virtual returns (uint256)

Get current gauge weight

NameTypeDescription
addraddressGauge address
NameTypeDescription
[0]uint256Gauge weight

getTypeWeight

function getTypeWeight(int128 typeId) external view virtual returns (uint256)

Get current type weight

NameTypeDescription
typeIdint128Type id
NameTypeDescription
[0]uint256Type weight

getTotalWeight

function getTotalWeight() external view virtual returns (uint256)

Get current total (type-weighted) weight

NameTypeDescription
[0]uint256Total weight

getWeightsSumPerType

function getWeightsSumPerType(int128 typeId) external view virtual returns (uint256)

Get sum of gauge weights per type

NameTypeDescription
typeIdint128Type id
NameTypeDescription
[0]uint256Sum of gauge weights

pause

function pause() public

unpause

function unpause() public

initialize

function initialize(address owner_, address votingEscrow_, address p12CoinFactory_) public

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

upgrade function

_getTypeWeight

function _getTypeWeight(int128 gaugeType) internal virtual returns (uint256)

Fill historic type weights week-over-week for missed checkins and return the type weight for the future week

NameTypeDescription
gaugeTypeint128Gauge type id
NameTypeDescription
[0]uint256Type weight

_getSum

function _getSum(int128 gaugeType) internal virtual returns (uint256)

Fill sum of gauge weights for the same type week-over-week for missed checkins and return the sum for the future week

NameTypeDescription
gaugeTypeint128Gauge type id
NameTypeDescription
[0]uint256Sum of weights

_getTotal

function _getTotal() internal virtual returns (uint256)

Fill historic total weights week-over-week for missed checkins and return the total for the future week

NameTypeDescription
[0]uint256Total weight

_getWeight

function _getWeight(address gaugeAddr) internal virtual returns (uint256)

Fill historic gauge weights week-over-week for missed checkins and return the total for the future week

NameTypeDescription
gaugeAddraddressAddress of the gauge
NameTypeDescription
[0]uint256Gauge weight

_gaugeRelativeWeight

function _gaugeRelativeWeight(address addr, uint256 time) internal view virtual returns (uint256)

Get Gauge relative weight (not more than 1.0) normalized to 1e18 (e.g. 1.0 == 1e18). Inflation which will be received by it is inflation_rate * relative_weight / 1e18

NameTypeDescription
addraddressGauge address
timeuint256Relative weight at the specified timestamp in the past or present
NameTypeDescription
[0]uint256Value of relative weight normalized to 1e18

_changeTypeWeight

function _changeTypeWeight(int128 typeId, uint256 weight) internal virtual

_changeGaugeWeight

function _changeGaugeWeight(address addr, uint256 weight) internal virtual