GaugeControllerUpgradeable
GaugeControllerUpgradeable
WEEK
MULTIPLIER
WEIGHT_VOTE_DELAY
uint256 WEIGHT_VOTE_DELAY
setVotingEscrow
function setVotingEscrow(contract IVotingEscrow newVotingEscrow) external virtual
set new votingEscrow
Name | Type | Description |
---|
newVotingEscrow | contract IVotingEscrow | address of votingEscrow |
setP12CoinFactory
function setP12CoinFactory(address newP12Factory) external virtual
set new p12CoinFactory
Name | Type | Description |
---|
newP12Factory | address | address of newP12Factory |
getGaugeTypes
function getGaugeTypes(address addr) external view virtual returns (int128)
Get gauge type for address
Name | Type | Description |
---|
addr | address | Gauge address |
Name | Type | Description |
---|
[0] | int128 | Gauge type id |
addGauge
function addGauge(address addr, int128 gaugeType, uint256 weight) external virtual
Add gauge addr
of type gaugeType
with weight weight
Name | Type | Description |
---|
addr | address | Gauge address |
gaugeType | int128 | Gauge type |
weight | uint256 | Gauge 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
Name | Type | Description |
---|
addr | address | Gauge 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
Name | Type | Description |
---|
addr | address | Gauge address |
time | uint256 | Relative weight at the specified timestamp in the past or present |
Name | Type | Description |
---|
[0] | uint256 | Value 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
Name | Type | Description |
---|
addr | address | Gauge address |
time | uint256 | Relative weight at the specified timestamp in the past or present |
Name | Type | Description |
---|
[0] | uint256 | Value of relative weight normalized to 1e18 |
addType
function addType(string name, uint256 weight) external virtual
Add gauge type with name name
and weight weight
Name | Type | Description |
---|
name | string | Name of gauge type |
weight | uint256 | Weight of gauge type |
changeTypeWeight
function changeTypeWeight(int128 typeId, uint256 weight) external virtual
Change gauge type typeId
weight to weight
Name | Type | Description |
---|
typeId | int128 | Gauge type id |
weight | uint256 | New Gauge weight |
changeGaugeWeight
function changeGaugeWeight(address addr, uint256 weight) external virtual
Change weight of gauge addr
to weight
Name | Type | Description |
---|
addr | address | GaugeController contract address |
weight | uint256 | New Gauge weight |
voteForGaugeWeights
function voteForGaugeWeights(address gaugeAddr, uint256 userWeight) external virtual
Allocate voting power for changing pool weights
Name | Type | Description |
---|
gaugeAddr | address | Gauge which msg.sender votes for |
userWeight | uint256 | Weight 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
Name | Type | Description |
---|
addr | address | Gauge address |
Name | Type | Description |
---|
[0] | uint256 | Gauge weight |
getTypeWeight
function getTypeWeight(int128 typeId) external view virtual returns (uint256)
Get current type weight
Name | Type | Description |
---|
typeId | int128 | Type id |
Name | Type | Description |
---|
[0] | uint256 | Type weight |
getTotalWeight
function getTotalWeight() external view virtual returns (uint256)
Get current total (type-weighted) weight
Name | Type | Description |
---|
[0] | uint256 | Total weight |
getWeightsSumPerType
function getWeightsSumPerType(int128 typeId) external view virtual returns (uint256)
Get sum of gauge weights per type
Name | Type | Description |
---|
typeId | int128 | Type id |
Name | Type | Description |
---|
[0] | uint256 | Sum of gauge weights |
pause
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
Name | Type | Description |
---|
gaugeType | int128 | Gauge type id |
Name | Type | Description |
---|
[0] | uint256 | Type 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
Name | Type | Description |
---|
gaugeType | int128 | Gauge type id |
Name | Type | Description |
---|
[0] | uint256 | Sum 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
Name | Type | Description |
---|
[0] | uint256 | Total 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
Name | Type | Description |
---|
gaugeAddr | address | Address of the gauge |
Name | Type | Description |
---|
[0] | uint256 | Gauge 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
Name | Type | Description |
---|
addr | address | Gauge address |
time | uint256 | Relative weight at the specified timestamp in the past or present |
Name | Type | Description |
---|
[0] | uint256 | Value of relative weight normalized to 1e18 |
_changeTypeWeight
function _changeTypeWeight(int128 typeId, uint256 weight) internal virtual
_changeGaugeWeight
function _changeGaugeWeight(address addr, uint256 weight) internal virtual