# BiasCalculator

### Storage

#### GAUGE\_CONTROLLER

```solidity
address GAUGE_CONTROLLER
```

Address of the Curve Gauge Controller

#### questBoard

```solidity
address questBoard
```

Address of the QuestBoard contract

### Events

#### AddToVoterList

```solidity
event AddToVoterList(uint256 questID, address account)
```

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

#### RemoveFromVoterList

```solidity
event RemoveFromVoterList(uint256 questID, address account)
```

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

### Modifiers

#### onlyBoard

```solidity
modifier onlyBoard()
```

Check the caller is the QuestBoard contract

### Constructor

```solidity
constructor(address _gaugeController, address _questBoard) public
```

### View Methods

#### getCurrentPeriod

```solidity
function getCurrentPeriod() public view returns (uint256)
```

Returns the current Period for the contract

#### getQuestVoterList

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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

```solidity
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 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paladin.vote/quest-v2/smart-contracts-v2/biascalculator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
