VoterWhitelister
#
Source | Inherits from IIVoterWhitelister, Governed, AddressUpdatable
Manager of the FTSO whitelist.
Only addresses registered in this contract can submit data to the FTSO system.
Functions#
addFtso
#
function addFtso(
uint256 _ftsoIndex
) external;
Create an empty whitelist with default size for a new FTSO.
Only ftsoManager
can call this method.
Parameters | Type | Description |
---|---|---|
_ftsoIndex |
uint256 |
Index of the new FTSO. |
cancelGovernanceCall
#
function cancelGovernanceCall(
bytes4 _selector
) external;
Cancel a timelocked governance
call before it has been executed.
Only governance
can call this method.
Parameters | Type | Description |
---|---|---|
_selector |
bytes4 |
The method selector. |
chillVoter
#
function chillVoter(
address _voter,
uint256 _noOfRewardEpochs,
uint256[] _ftsoIndices
) external returns (
bool[] _removed,
uint256 _untilRewardEpoch);
Used to chill a data provider, this is, remove it from the whitelist for a specified number of reward epochs.
Only governance
can call this method.
Parameters | Type | Description |
---|---|---|
_voter |
address |
Data provider being chilled. |
_noOfRewardEpochs |
uint256 |
Number of epochs to chill the provider for. |
_ftsoIndices |
uint256[] |
Array of indices of the FTSOs that will not allow this provider to submit data. |
chilledUntilRewardEpoch
#
function chilledUntilRewardEpoch(
address _voter
) external view returns (
uint256);
In case of providing bad prices (e.g. collusion), the voter can be chilled for a few reward epochs. A voter can whitelist again from a returned reward epoch onwards.
Parameters | Type | Description |
---|---|---|
_voter |
address |
Address of the queried data provider. |
Returns | Type | Description |
---|---|---|
[0] | uint256 |
uint256 ID of the epoch where the data provider can start submitting prices again. |
constructor
#
constructor(
address _governance,
address _addressUpdater,
contract IIPriceSubmitter _priceSubmitter,
uint256 _defaultMaxVotersForFtso,
contract IVoterWhitelister _oldVoterWhitelister
) public;
constructor
#
constructor(
address _governance
) public;
Parameters | Type | Description |
---|---|---|
_governance |
address |
Governance contract. Must not be zero. |
copyWhitelist
#
function copyWhitelist(
uint256 _ftsoIndex
) external;
Copy whitelist data from oldVoterWhitelister
for a specific FTSO.
Can only be called by governance
.
Parameters | Type | Description |
---|---|---|
_ftsoIndex |
uint256 |
Index of the FTSO whose whitelist is to be copied. |
defaultMaxVotersForFtso
#
function defaultMaxVotersForFtso(
) external view returns (
uint256);
Maximum number of voters in the whitelist for a new FTSO.
Returns | Type | Description |
---|---|---|
[0] | uint256 |
uint256 Default maximum allowed voters. |
executeGovernanceCall
#
function executeGovernanceCall(
bytes4 _selector
) external;
Execute the timelocked governance
calls once the timelock period expires.
Only executor can call this method.
Parameters | Type | Description |
---|---|---|
_selector |
bytes4 |
The method selector (only one timelocked call per method is stored). |
getAddressUpdater
#
function getAddressUpdater(
) public view returns (
address _addressUpdater);
Returns the configured address updater.
Returns | Type | Description |
---|---|---|
_addressUpdater |
address |
The AddresUpdater contract that can update our contract address list, as a response to a governance call. |
getFtsoWhitelistedPriceProviders
#
function getFtsoWhitelistedPriceProviders(
uint256 _ftsoIndex
) public view returns (
address[]);
Gets whitelisted price providers for the FTSO at a given index.
Parameters | Type | Description |
---|---|---|
_ftsoIndex |
uint256 |
Queried index. |
Returns | Type | Description |
---|---|---|
[0] | address[] |
Array of addresses of the whitelisted data providers. |
getFtsoWhitelistedPriceProvidersBySymbol
#
function getFtsoWhitelistedPriceProvidersBySymbol(
string _symbol
) external view returns (
address[]);
Gets whitelisted price providers for the FTSO with a specified symbol.
Parameters | Type | Description |
---|---|---|
_symbol |
string |
Queried symbol. |
Returns | Type | Description |
---|---|---|
[0] | address[] |
Array of addresses of the whitelisted data providers. |
governance
#
function governance(
) public view returns (
address);
Returns the current effective governance
address.
maxVotersForFtso
#
function maxVotersForFtso(
uint256 _ftsoIndex
) external view returns (
uint256);
Maximum number of voters in the whitelist for a specific FTSO. Adjustable separately for each index.
Parameters | Type | Description |
---|---|---|
_ftsoIndex |
uint256 |
Index of the FTSO. |
Returns | Type | Description |
---|---|---|
[0] | uint256 |
uint256 Maximum allowed voters. |
removeFtso
#
function removeFtso(
uint256 _ftsoIndex
) external;
Clear whitelist for a removed FTSO.
Only ftsoManager
can call this method.
Parameters | Type | Description |
---|---|---|
_ftsoIndex |
uint256 |
Index of the removed FTSO. |
removeTrustedAddressFromWhitelist
#
function removeTrustedAddressFromWhitelist(
address _trustedAddress,
uint256 _ftsoIndex
) external;
Remove a trusted address from whitelist.
Parameters | Type | Description |
---|---|---|
_trustedAddress |
address |
Address to remove. |
_ftsoIndex |
uint256 |
Index of the FTSO being modified. |
requestFullVoterWhitelisting
#
function requestFullVoterWhitelisting(
address _voter
) external returns (
uint256[] _supportedIndices,
bool[] _success);
Requests whitelisting an account to act as a data provider for all active FTSOs. May be called by any address, including the voter itself.
Parameters | Type | Description |
---|---|---|
_voter |
address |
Address of the voter to be whitelisted. |
Returns | Type | Description |
---|---|---|
_supportedIndices |
uint256[] |
Array of currently supported FTSO indices. |
_success |
bool[] |
Array of success flags by FTSO index. |
requestWhitelistingVoter
#
function requestWhitelistingVoter(
address _voter,
uint256 _ftsoIndex
) external;
Requests whitelisting an account to act as a data provider for a specific FTSO. Reverts if the vote power of the account is too low. May be called by any address, including the voter itself.
Parameters | Type | Description |
---|---|---|
_voter |
address |
Address of the voter to be whitelisted. |
_ftsoIndex |
uint256 |
Index of the FTSO. |
setDefaultMaxVotersForFtso
#
function setDefaultMaxVotersForFtso(
uint256 _defaultMaxVotersForFtso
) external;
Set the maximum number of voters in the whitelist for a new FTSOs.
Only governance
can call this method.
Parameters | Type | Description |
---|---|---|
_defaultMaxVotersForFtso |
uint256 |
New maximum default value. |
setMaxVotersForFtso
#
function setMaxVotersForFtso(
uint256 _ftsoIndex,
uint256 _newMaxVoters
) external;
Set the maximum number of voters in the whitelist for a specific FTSO. Can remove voters with the least votepower from the whitelist.
Only governance
can call this method.
Parameters | Type | Description |
---|---|---|
_ftsoIndex |
uint256 |
Index of the FTSO to modify. |
_newMaxVoters |
uint256 |
New size of the whitelist. |
switchToProductionMode
#
function switchToProductionMode(
) external;
Enter the production mode after all the initial governance
settings have been set.
This enables timelocks and the governance
can be obtained afterward by calling
governanceSettings
.getGovernanceAddress().
Emits GovernedProductionModeEntered
.
turnOffCopyMode
#
function turnOffCopyMode(
) external;
Turn off copy mode.
Can only be called by governance
.
updateContractAddresses
#
function updateContractAddresses(
bytes32[] _contractNameHashes,
address[] _contractAddresses
) external;
External method called from AddressUpdater
only.
Modifiers#
notInCopyMode
#
modifier notInCopyMode()
Only callable when not in copy mode.
onlyAddressUpdater
#
modifier onlyAddressUpdater()
Only the AdressUpdater
contract can call this method.
Its address is set at construction time but it can also update itself.
onlyFtsoManager
#
modifier onlyFtsoManager()
Only the ftsoManager
can call this method.
Variables#
chilledUntilRewardEpoch
#
mapping(address => uint256) chilledUntilRewardEpoch
In case of providing bad prices (e.g. collusion), the voter can be chilled for a few reward epochs. A voter can whitelist again from a returned reward epoch onwards.
defaultMaxVotersForFtso
#
uint256 defaultMaxVotersForFtso
Maximum number of voters in the whitelist for a new FTSO.
ftsoManager
#
contract IFtsoManager ftsoManager
Address of the FtsoManager
contract.
ftsoRegistry
#
contract IFtsoRegistry ftsoRegistry
Address of the FtsoRegistry
contract.
governanceSettings
#
contract IGovernanceSettings governanceSettings
Governance Settings.
maxVotersForFtso
#
mapping(uint256 => uint256) maxVotersForFtso
Maximum number of voters in the whitelist for a specific FTSO. Adjustable separately for each index.
oldVoterWhitelister
#
contract IVoterWhitelister oldVoterWhitelister
Previous VoterWhitelister
contract, set at construction time.
Necessary to allow copying the previous whitelist onto a new contract.
priceSubmitter
#
contract IIPriceSubmitter priceSubmitter
Address of the PriceSubmitter
contract set at construction time.
productionMode
#
bool productionMode
When true, governance
is enabled and cannot be disabled. See switchToProductionMode
.
timelockedCalls
#
mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls
List of pending timelocked governance
calls.