# IVoterRegistry

> Manages the registration of voters for upcoming reward epochs.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

Source: https://dev.flare.network/network/fsp/solidity-reference/IVoterRegistry

Manages the registration of voters for upcoming reward epochs.

Sourced from `IVoterRegistry.sol` on [GitHub](https://github.com/flare-foundation/flare-smart-contracts-v2/blob/main/contracts/userInterfaces/IVoterRegistry.sol).

## Functions[​](#functions "Direct link to Functions")

### chilledUntilRewardEpochId[​](#chilleduntilrewardepochid "Direct link to chilledUntilRewardEpochId")

In case of providing bad votes (e.g. ftso collusion), the beneficiary can be chilled for a few reward epochs. If beneficiary is chilled, the vote power assigned to it is zero.

```
function chilledUntilRewardEpochId(    bytes20 _beneficiary) external view returns (    uint256 _rewardEpochId);
```

#### Parameters[​](#parameters "Direct link to Parameters")

-   `_beneficiary`: The beneficiary (c-chain address or node id).

#### Returns[​](#returns "Direct link to Returns")

-   `_rewardEpochId`: The reward epoch id until which the voter is chilled.

### getNumberOfRegisteredVoters[​](#getnumberofregisteredvoters "Direct link to getNumberOfRegisteredVoters")

Returns the number of registered voters for a given reward epoch. Size can be zero if the reward epoch is not supported (before initial reward epoch or future reward epoch). Size for the next reward epoch can still change until the signing policy snapshot is created.

```
function getNumberOfRegisteredVoters(    uint256 _rewardEpochId) external view returns (    uint256);
```

#### Parameters[​](#parameters-1 "Direct link to Parameters")

-   `_rewardEpochId`: The reward epoch id.

### getRegisteredVoters[​](#getregisteredvoters "Direct link to getRegisteredVoters")

Returns the list of registered voters for a given reward epoch. List can be empty if the reward epoch is not supported (before initial reward epoch or future reward epoch). List for the next reward epoch can still change until the signing policy snapshot is created.

```
function getRegisteredVoters(    uint256 _rewardEpochId) external view returns (    address[]);
```

#### Parameters[​](#parameters-2 "Direct link to Parameters")

-   `_rewardEpochId`: The reward epoch id.

### isVoterRegistered[​](#isvoterregistered "Direct link to isVoterRegistered")

Returns true if a voter was (is currently) registered in a given reward epoch.

```
function isVoterRegistered(    address _voter,    uint256 _rewardEpochId) external view returns (    bool);
```

#### Parameters[​](#parameters-3 "Direct link to Parameters")

-   `_voter`: The voter address.
-   `_rewardEpochId`: The reward epoch id.

### maxVoters[​](#maxvoters "Direct link to maxVoters")

Maximum number of voters in one reward epoch.

```
function maxVoters() external view returns (    uint256);
```

### newSigningPolicyInitializationStartBlockNumber[​](#newsigningpolicyinitializationstartblocknumber "Direct link to newSigningPolicyInitializationStartBlockNumber")

Returns the block number of the start of the new signing policy initialisation for a given reward epoch. It is a snapshot block of the voters' addresses (it is zero if the reward epoch is not supported).

```
function newSigningPolicyInitializationStartBlockNumber(    uint256 _rewardEpochId) external view returns (    uint256);
```

#### Parameters[​](#parameters-4 "Direct link to Parameters")

-   `_rewardEpochId`: The reward epoch id.

### publicKeyRequired[​](#publickeyrequired "Direct link to publicKeyRequired")

Indicates if the voter must have the public key set when registering.

```
function publicKeyRequired() external view returns (    bool);
```

### registerVoter[​](#registervoter "Direct link to registerVoter")

Registers a voter if the weight is high enough.

```
function registerVoter(    address _voter,    struct IVoterRegistry.Signature _signature) external;
```

#### Parameters[​](#parameters-5 "Direct link to Parameters")

-   `_voter`: The voter address.
-   `_signature`: The signature.

## Events[​](#events "Direct link to Events")

### BeneficiaryChilled[​](#beneficiarychilled "Direct link to BeneficiaryChilled")

Event emitted when a beneficiary (c-chain address or node id) is chilled.

```
event BeneficiaryChilled(    bytes20 beneficiary,    uint256 untilRewardEpochId)
```

### VoterRegistered[​](#voterregistered "Direct link to VoterRegistered")

Event emitted when a voter is registered.

```
event VoterRegistered(    address voter,    uint24 rewardEpochId,    address signingPolicyAddress,    address submitAddress,    address submitSignaturesAddress,    bytes32 publicKeyPart1,    bytes32 publicKeyPart2,    uint256 registrationWeight)
```

### VoterRemoved[​](#voterremoved "Direct link to VoterRemoved")

Event emitted when a voter is removed.

```
event VoterRemoved(    address voter,    uint256 rewardEpochId)
```

## Structures[​](#structures "Direct link to Structures")

### Signature[​](#signature "Direct link to Signature")

Signature data.

```
struct Signature {  uint8 v;  bytes32 r;  bytes32 s;}
```
