IFtsoManager
#
Source | Inherits from IFtsoManagerGenesis
Interface for the FtsoManager
contract.
Events#
AccruingUnearnedRewardsFailed
#
event AccruingUnearnedRewardsFailed(
uint256 epochId
)
Unexpected failure while accruing unearned rewards. This should be a rare occurrence.
Parameters | Type | Description |
---|---|---|
epochId |
uint256 |
Epoch ID of the failure. |
DistributingRewardsFailed
#
event DistributingRewardsFailed(
address ftso,
uint256 epochId
)
Unexpected failure while distributing rewards. This should be a rare occurrence.
Parameters | Type | Description |
---|---|---|
ftso |
address |
Contract address of the FTSO where the failure happened. |
epochId |
uint256 |
Epoch ID of the failure. |
FallbackMode
#
event FallbackMode(
bool fallbackMode
)
Emitted when the fallback mode of the FTSO manager changes its state. Fallback mode is a recovery mode, where only data from a trusted subset of FTSO data providers is used to calculate the final price.
The FTSO Manager enters the fallback mode when ALL FTSOs are in fallback mode.
Parameters | Type | Description |
---|---|---|
fallbackMode |
bool |
New state of the FTSO Manager fallback mode. |
FinalizingPriceEpochFailed
#
event FinalizingPriceEpochFailed(
contract IIFtso ftso,
uint256 epochId,
enum IFtso.PriceFinalizationType failingType
)
Unexpected failure while finalizing a price epoch. This should be a rare occurrence.
Parameters | Type | Description |
---|---|---|
ftso |
contract IIFtso |
Contract address of the FTSO where the failure happened. |
epochId |
uint256 |
Epoch ID of the failure. |
failingType |
enum IFtso.PriceFinalizationType |
How was the epoch finalized. |
FtsoAdded
#
event FtsoAdded(
contract IIFtso ftso,
bool add
)
Emitted when a new FTSO has been added or an existing one has been removed.
Parameters | Type | Description |
---|---|---|
ftso |
contract IIFtso |
Contract address of the FTSO. |
add |
bool |
True if added, removed otherwise. |
FtsoFallbackMode
#
event FtsoFallbackMode(
contract IIFtso ftso,
bool fallbackMode
)
Emitted when the fallback mode of an FTSO changes its state.
Parameters | Type | Description |
---|---|---|
ftso |
contract IIFtso |
Contract address of the FTSO. |
fallbackMode |
bool |
New state of its fallback mode. |
InitializingCurrentEpochStateForRevealFailed
#
event InitializingCurrentEpochStateForRevealFailed(
contract IIFtso ftso,
uint256 epochId
)
Unexpected failure while initializing a price epoch. This should be a rare occurrence.
Parameters | Type | Description |
---|---|---|
ftso |
contract IIFtso |
Contract address of the FTSO where the failure happened. |
epochId |
uint256 |
Epoch ID that failed initialization. |
PriceEpochFinalized
#
event PriceEpochFinalized(
address chosenFtso,
uint256 rewardEpochId
)
Emitted when a price epoch ends, this is, after the reveal phase, when final prices are calculated.
Parameters | Type | Description |
---|---|---|
chosenFtso |
address |
Contract address of the FTSO asset that was randomly chosen to be the basis for reward calculation. On this price epoch, rewards will be calculated based on how close each data provider was to the median of all submitted prices FOR THIS FTSO. |
rewardEpochId |
uint256 |
Reward epoch ID this price epoch belongs to. |
RewardEpochFinalized
#
event RewardEpochFinalized(
uint256 votepowerBlock,
uint256 startBlock
)
Emitted when a reward epoch ends and rewards are available.
Parameters | Type | Description |
---|---|---|
votepowerBlock |
uint256 |
The vote power block of the epoch. |
startBlock |
uint256 |
The first block of the epoch. |
UseGoodRandomSet
#
event UseGoodRandomSet(
bool useGoodRandom,
uint256 maxWaitForGoodRandomSeconds
)
Emitted when the requirement to provide good random numbers has changed.
As part of the FTSO protocol, data providers must submit a random number along with their price reveals. When good random numbers are enforced, all providers that submit a hash must then submit a reveal with a random number or they will be punished. This is a measure against random number manipulation.
Parameters | Type | Description |
---|---|---|
useGoodRandom |
bool |
Whether good random numbers are now enforced or not. |
maxWaitForGoodRandomSeconds |
uint256 |
Max number of seconds to wait for a good random number to be submitted. |
Functions#
active
#
function active(
) external view returns (
bool);
Returns whether the FTSO Manager is active
or not.
Returns | Type | Description |
---|---|---|
[0] | bool |
bool Active status. |
getCurrentPriceEpochData
#
function getCurrentPriceEpochData(
) external view returns (
uint256 _priceEpochId,
uint256 _priceEpochStartTimestamp,
uint256 _priceEpochEndTimestamp,
uint256 _priceEpochRevealEndTimestamp,
uint256 _currentTimestamp);
Returns timing information for the current price epoch. All intervals are half-closed: end time is not included. All timestamps are in seconds since UNIX epoch.
See the FTSO page for information about the different submission phases.
Returns | Type | Description |
---|---|---|
_priceEpochId |
uint256 |
Price epoch ID. |
_priceEpochStartTimestamp |
uint256 |
Beginning of the commit phase. |
_priceEpochEndTimestamp |
uint256 |
End of the commit phase. |
_priceEpochRevealEndTimestamp |
uint256 |
End of the reveal phase. |
_currentTimestamp |
uint256 |
Current time. |
getCurrentPriceEpochId
#
function getCurrentPriceEpochId(
) external view returns (
uint256 _priceEpochId);
Returns current price epoch ID.
Returns | Type | Description |
---|---|---|
_priceEpochId |
uint256 |
Currently running epoch ID. IDs are consecutive numbers starting from zero. |
getCurrentRewardEpoch
#
function getCurrentRewardEpoch(
) external view returns (
uint256);
Returns current reward epoch ID (the one currently running).
Returns | Type | Description |
---|---|---|
[0] | uint256 |
Reward epoch ID. A monotonically increasing integer. |
getFallbackMode
#
function getFallbackMode(
) external view returns (
bool _fallbackMode,
contract IIFtso[] _ftsos,
bool[] _ftsoInFallbackMode);
Returns whether the FTSO Manager is currently in fallback mode.
In this mode only submissions from trusted providers are used.
Returns | Type | Description |
---|---|---|
_fallbackMode |
bool |
True if fallback mode is enabled for the manager. |
_ftsos |
contract IIFtso[] |
Array of all currently active FTSO assets. |
_ftsoInFallbackMode |
bool[] |
Boolean array indicating which FTSO assets are in fallback mode. If the FTSO Manager is in fallback mode then ALL FTSOs are in fallback mode. |
getFtsos
#
function getFtsos(
) external view returns (
contract IIFtso[] _ftsos);
Returns the list of currently active
FTSOs.
Returns | Type | Description |
---|---|---|
_ftsos |
contract IIFtso[] |
Array of contract addresses for the FTSOs. |
getPriceEpochConfiguration
#
function getPriceEpochConfiguration(
) external view returns (
uint256 _firstPriceEpochStartTs,
uint256 _priceEpochDurationSeconds,
uint256 _revealEpochDurationSeconds);
Returns the current values for price epoch timing configuration.
See the FTSO page for information about the different submission phases.
Returns | Type | Description |
---|---|---|
_firstPriceEpochStartTs |
uint256 |
Timestamp, in seconds since UNIX epoch, of the first price epoch. |
_priceEpochDurationSeconds |
uint256 |
Duration in seconds of the commit phase. |
_revealEpochDurationSeconds |
uint256 |
Duration in seconds of the reveal phase. |
getRewardEpochConfiguration
#
function getRewardEpochConfiguration(
) external view returns (
uint256 _firstRewardEpochStartTs,
uint256 _rewardEpochDurationSeconds);
Returns the current values for reward epoch timing configuration.
See the Reward epochs box.
Returns | Type | Description |
---|---|---|
_firstRewardEpochStartTs |
uint256 |
Timestamp, in seconds since UNIX epoch, of the first reward epoch. |
_rewardEpochDurationSeconds |
uint256 |
Duration in seconds of the reward epochs. |
getRewardEpochToExpireNext
#
function getRewardEpochToExpireNext(
) external view returns (
uint256);
Return reward epoch that will expire next, when a new reward epoch is initialized.
Reward epochs older than 90 days expire, and any unclaimed rewards in them become inaccessible.
Returns | Type | Description |
---|---|---|
[0] | uint256 |
uint256 Reward epoch ID. |
getRewardEpochVotePowerBlock
#
function getRewardEpochVotePowerBlock(
uint256 _rewardEpoch
) external view returns (
uint256);
Returns the vote power block that was used for a past reward epoch.
Parameters | Type | Description |
---|---|---|
_rewardEpoch |
uint256 |
The queried reward epoch ID. |
Returns | Type | Description |
---|---|---|
[0] | uint256 |
uint256 The block number of that reward epoch's vote power block. |