LootVoteController
Contract handling the vote logic for repartition of the global Loot budget between all the listed gauges for the Quest system. User voting power is based on their hPAL locks, transformed into a bias via the HolyPalPower contract. Votes are sticky, meaning users do not need to cast them every period, but can set their vote and update it periods later. Before an user can change its votes, a vote cooldown need to be respected.
QuestBoard
Quest Board & distributor struct
Point
Point struct
VotedSlope
Voted Slope struct
VoteVars
Struct used for the vote method
ProxyVoter
Proxy Voter struct
hPalPower
Address of the hPalPower contract
nextBoardId
Next ID to list Boards
questBoards
Listed Quest Boards
boardToId
Match Board address to ID
distributorToId
Match Distributor address to ID
gaugeToBoardId
Match a Gauge to a Board ID
defaultCap
Default weight cap for gauges
gaugeCaps
Custom caps for gauges
isGaugeKilled
Flag for killed gauges
voteUserSlopes
User VotedSlopes for each gauge
voteUserPower
Total vote power used by user
lastUserVote
Last user vote's timestamp for each gauge address
pointsWeight
Point weight for each gauge
changesWeight
Slope changes for each gauge
timeWeight
Last scheduled time for gauge weight update
pointsWeightTotal
Total Point weights
changesWeightTotal
Total weight slope changes
timeTotal
Last scheduled time for weight update
isProxyManager
Proxy Managers set for each user
maxProxyDuration
Max Proxy duration allowed for Manager
proxyVoterState
State of Proxy Managers for each user
currentUserProxyVoters
List of current proxy for each user
blockedProxyPower
Blocked (for Proxies) voting power for each user
usedFreePower
Used free voting power for each user
VoteForGauge
Event emitted when a vote is casted for a gauge
NewBoardListed
Event emitted when a new Board is listed
BoardUpdated
Event emitted when a Board is udpated
NewGaugeAdded
Event emitted when a new Gauge is listed
GaugeCapUpdated
Event emitted when a Gauge is updated
GaugeBoardUpdated
Event emitted when a Gauge is updated
GaugeKilled
Event emitted when a Gauge is killed
GaugeUnkilled
Event emitted when a Gauge is unkilled
SetProxyManager
Event emitted when a Proxy Manager is set
RemoveProxyManager
Event emitted when a Proxy Manager is removed
SetNewProxyVoter
Event emitted when a Proxy Voter is set
DefaultCapUpdated
Event emitted when the default gauge cap is updated
isListedGauge
Is the gauge listed
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | bool : Is the gauge listed |
getBoardForGauge
Returns the Quest Board assocatied to a gauge
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | address : Address of the Quest Board |
getDistributorForGauge
Returns the Distributor assocatied to a gauge
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | address : Address of the Distributor |
getGaugeWeight
Returns the current gauge weight
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Current gauge weight |
getGaugeWeightAt
Returns the gauge weight at a specific timestamp
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
ts | uint256 | Timestamp |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Gauge weight at the timestamp |
getTotalWeight
Returns the current total weight
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Total weight |
getGaugeRelativeWeight
Returns a gauge relative weight
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Gauge relative weight |
getGaugeRelativeWeight
Returns a gauge relative weight at a specific timestamp
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
ts | uint256 | Timestamp |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Gauge relative weight at the timestamp |
getGaugeCap
Returns the cap relative weight for a gauge
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Gauge cap |
getUserProxyVoters
Returns the list of current proxies for a user
Parameters
Name | Type | Description |
---|---|---|
user | address | Address of the user |
Return Values
Name | Type | Description |
---|---|---|
[0] | address[] | address[] : List of proxy addresses |
voteForGaugeWeights
Votes for a gauge weight
Votes for a gauge weight based on the given user power
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
userPower | uint256 | Power used for this gauge |
voteForManyGaugeWeights
Votes for multiple gauge weights
Parameters
Name | Type | Description |
---|---|---|
gauge | address[] | Address of the gauges |
userPower | uint256[] | Power used for each gauge |
voteForGaugeWeightsFor
Votes for a gauge weight as another user
Parameters
Name | Type | Description |
---|---|---|
user | address | Address of the user |
gauge | address | Address of the gauge |
userPower | uint256 | Power used for this gauge |
voteForManyGaugeWeightsFor
Votes for multiple gauge weights as another user
Parameters
Name | Type | Description |
---|---|---|
user | address | Address of the user |
gauge | address[] | Address of the gauges |
userPower | uint256[] | Power used for each gauge |
getGaugeRelativeWeightWrite
Returns the updated gauge relative weight
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Updated gauge relative weight |
getGaugeRelativeWeightWrite
Returns the updated gauge relative weight at a given timestamp
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
ts | uint256 | Timestamp |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 : Updated gauge relative weight at the timestamp |
updateGaugeWeight
Updates the gauge weight
Parameters
Name | Type | Description |
---|---|---|
gauge | address | Address of the gauge |
updateTotalWeight
Updates the total weight
approveProxyManager
Approves a Proxy Manager for the caller
Parameters
Name | Type | Description |
---|---|---|
manager | address | Address of the Proxy Manager |
maxDuration | uint256 | Maximum Proxy duration allowed to be created by the Manager (can be set to 0 for no limit) |
updateProxyManagerDuration
Updates the max duration allowed for a Proxy Manager
Parameters
Name | Type | Description |
---|---|---|
manager | address | Address of the Proxy Manager |
newMaxDuration | uint256 | Maximum Proxy duration allowed to be created by the Manager (can be set to 0 for no limit) |
removeProxyManager
Approves a Proxy Manager for the caller
Parameters
Name | Type | Description |
---|---|---|
manager | address | Address of the Proxy Manager |
setVoterProxy
Sets a Proxy Voter for the user
Parameters
Name | Type | Description |
---|---|---|
user | address | Address of the user |
proxy | address | Address of the Proxy Voter |
maxPower | uint256 | Max voting power allowed for the Proxy |
endTimestamp | uint256 | Timestamp of the Proxy expiry |
clearUserExpiredProxies
Clears expired Proxies for a user
Parameters
Name | Type | Description |
---|---|---|
user | address | Address of the user |
Last updated