IIPriceSubmitter
#
Source | Inherits from IPriceSubmitter
Internal interface for the PriceSubmitter
contract.
Functions#
getCurrentRandom
#
function getCurrentRandom(
) external view returns (
uint256);
Returns the random number for the previous epoch, obtained from the random numbers provided by all data providers along with their data submissions. Note that the random number for the previous epoch keeps updating as new submissions are revealed.
Returns | Type | Description |
---|---|---|
[0] | uint256 |
Random number calculated from all data provider's submissions. |
getFtsoManager
#
function getFtsoManager(
) external view returns (
contract IFtsoManagerGenesis);
Returns the address of the FtsoManager
contract.
getFtsoRegistry
#
function getFtsoRegistry(
) external view returns (
contract IFtsoRegistryGenesis);
Returns the address of the FtsoRegistry
contract.
getRandom
#
function getRandom(
uint256 _epochId
) external view returns (
uint256);
Returns the random number used in a specific past epoch, obtained from the random numbers provided by all data providers along with their data submissions.
Parameters | Type | Description |
---|---|---|
_epochId |
uint256 |
ID of the queried epoch. Current epoch cannot be queried, and the previous epoch is constantly updated as data providers reveal their prices and random numbers. Note that only the last 50 epochs can be queried and there is no bounds checking for this parameter. Out-of-bounds queries return undefined values. |
Returns | Type | Description |
---|---|---|
[0] | uint256 |
The random number used in that epoch. |
getTrustedAddresses
#
function getTrustedAddresses(
) external view returns (
address[]);
Returns the list of trusted addresses that are always allowed to submit and reveal.
Returns | Type | Description |
---|---|---|
[0] | address[] |
address[] Array of trusted voter addresses. |
getVoterWhitelister
#
function getVoterWhitelister(
) external view returns (
address);
Returns the address of the VoterWhitelister
contract managing the data provider whitelist.
revealPrices
#
function revealPrices(
uint256 _epochId,
uint256[] _ftsoIndices,
uint256[] _prices,
uint256 _random
) external;
Reveals submitted prices during the epoch reveal period.
The hash of FTSO indices, prices, random number, and voter address must be equal
to the hash previously submitted with submitHash
.
Emits a PricesRevealed
event.
Parameters | Type | Description |
---|---|---|
_epochId |
uint256 |
ID of the epoch to which the price hashes are submitted. |
_ftsoIndices |
uint256[] |
List of FTSO indices in ascending order. |
_prices |
uint256[] |
List of submitted prices in USD. |
_random |
uint256 |
Submitted random number. |
setTrustedAddresses
#
function setTrustedAddresses(
address[] _trustedAddresses
) external;
Set trusted addresses that are always allowed to submit and reveal. Only ftso manager can call this method.
Parameters | Type | Description |
---|---|---|
_trustedAddresses |
address[] |
Array of voter addresses. |
submitHash
#
function submitHash(
uint256 _epochId,
bytes32 _hash
) external;
Submits a hash for the current epoch. Can only be called by FTSO data providers
whitelisted through the VoterWhitelisted
contract.
Emits the HashSubmitted
event.
Parameters | Type | Description |
---|---|---|
_epochId |
uint256 |
ID of the target epoch to which the hash is submitted. |
_hash |
bytes32 |
A hash of the FTSO indices, prices, random number, and voter address. |
voterWhitelistBitmap
#
function voterWhitelistBitmap(
address _voter
) external view returns (
uint256);
Returns a bitmap of all FTSOs for which a data provider is allowed to submit prices or hashes.
Parameters | Type | Description |
---|---|---|
_voter |
address |
Address of the voter. |
Returns | Type | Description |
---|---|---|
[0] | uint256 |
If a data provider is allowed to vote for a given FTSO index, the corresponding bit in the result is 1. |
voterWhitelisted
#
function voterWhitelisted(
address _voter,
uint256 _ftsoIndex
) external;
Called from the VoterWhitelister
contract when a new voter has been whitelisted.
Parameters | Type | Description |
---|---|---|
_voter |
address |
Voter address that has been added to the whitelist. |
_ftsoIndex |
uint256 |
Index of the FTSO to which the voter has registered. Each FTSO has its own whitelist. |
votersRemovedFromWhitelist
#
function votersRemovedFromWhitelist(
address[] _voters,
uint256 _ftsoIndex
) external;
Called from the VoterWhitelister
contract when one or more voters have been removed.
Parameters | Type | Description |
---|---|---|
_voters |
address[] |
Array of voter addresses that have been removed. |
_ftsoIndex |
uint256 |
Index of the FTSO to which the voters were registered. Each FTSO has its own whitelist. |