BiasCalculator

Storage

GAUGE_CONTROLLER

address GAUGE_CONTROLLER

Address of the Curve Gauge Controller

questBoard

address questBoard

Address of the QuestBoard contract

Events

AddToVoterList

event AddToVoterList(uint256 questID, address account)

Event emitted when an address is added to a Quest voter list

RemoveFromVoterList

event RemoveFromVoterList(uint256 questID, address account)

Event emitted when an address is removed from a Quest voter list

Modifiers

onlyBoard

modifier onlyBoard()

Check the caller is the QuestBoard contract

Constructor

constructor(address _gaugeController, address _questBoard) public

View Methods

getCurrentPeriod

function getCurrentPeriod() public view returns (uint256)

Returns the current Period for the contract

getQuestVoterList

function getQuestVoterList(uint256 questID) external view returns (address[])

Returns the voter list for a given Quest

Parameters

Name
Type
Description

questID

uint256

ID of the Quest

Return Values

Name
Type
Description

[0]

address[]

address[] : vote list

getCurrentReducedBias

function getCurrentReducedBias(uint256 questID, address gauge, enum QuestDataTypes.QuestVoteType questType) external view returns (uint256)

Returns the current reduced bias for a given gauge (based on a Quest's voter list)

Parameters

Name
Type
Description

questID

uint256

ID of the Quest

gauge

address

address of the gauge

questType

enum QuestDataTypes.QuestVoteType

Vote type of the Quest

Return Values

Name
Type
Description

[0]

uint256

uint256 : current reduced bias

getReducedBias

function getReducedBias(uint256 period, uint256 questID, address gauge, enum QuestDataTypes.QuestVoteType questType) public view returns (uint256)

Returns the reduced bias for a given gauge for a given period (based on a Quest's voter list)

Parameters

Name
Type
Description

period

uint256

timestamp of the period

questID

uint256

ID of the Quest

gauge

address

address of the gauge

questType

enum QuestDataTypes.QuestVoteType

Vote type of the Quest

Return Values

Name
Type
Description

[0]

uint256

uint256 : current reduced bias

_getVoterBias

function _getVoterBias(address gauge, address voter, uint256 period) internal view returns (uint256 userBias)

Returns the bias for a given voter for a given gauge, at a given period

Parameters

Name
Type
Description

gauge

address

address of the gauge

voter

address

address of the voter

period

uint256

timestamp of the period

Return Values

Name
Type
Description

userBias

uint256

(uint256) : voter bias

State-changing Methods

_addToVoterList

function _addToVoterList(uint256 questID, address account) internal

Adds a given address to a Quest's voter list

Adds a given address to a Quest's voter list

Parameters

Name
Type
Description

questID

uint256

ID of the Quest

account

address

address of the voter

setQuestVoterList

function setQuestVoterList(uint256 questID, address[] accounts) external

Sets the initial voter list for a given Quest

Parameters

Name
Type
Description

questID

uint256

ID of the Quest

accounts

address[]

list of voters

addToVoterList

function addToVoterList(uint256 questID, address[] accounts) external

Adds a given list of addresses to a Quest's voter list

Parameters

Name
Type
Description

questID

uint256

ID of the Quest

accounts

address[]

list of voters

removeFromVoterList

function removeFromVoterList(uint256 questID, address account) external

Removes a given address from a Quest's voter list

Parameters

Name
Type
Description

questID

uint256

ID of the Quest

account

address

address of the voter

Last updated