Skip to content

IIFtsoRewardManager#

Internal interface for the FtsoRewardManager.

Events#

DailyAuthorizedInflationSet#

Defined in IIFtsoRewardManager (Docs, Source).

event DailyAuthorizedInflationSet(
    uint256 authorizedAmountWei
)

Emitted when the contract's daily authorized inflation has been set.

Parameters Type Description
authorizedAmountWei uint256 Authorized amount of native tokens, in wei.

FeePercentageChanged#

Defined in IFtsoRewardManager (Docs, Source).

event FeePercentageChanged(
    address dataProvider,
    uint256 value,
    uint256 validFromEpoch
)

Emitted when a data provider changes its fee.

Parameters Type Description
dataProvider address Address of the data provider.
value uint256 New fee, in BIPS.
validFromEpoch uint256 Epoch ID where the new fee takes effect.

FtsoRewardManagerActivated#

Defined in IFtsoRewardManager (Docs, Source).

event FtsoRewardManagerActivated(
    address ftsoRewardManager
)

Emitted when the reward manager contract is activated.

Parameters Type Description
ftsoRewardManager address The reward manager contract.

FtsoRewardManagerDeactivated#

Defined in IFtsoRewardManager (Docs, Source).

event FtsoRewardManagerDeactivated(
    address ftsoRewardManager
)

Emitted when the reward manager contract is deactivated.

Parameters Type Description
ftsoRewardManager address The reward manager contract.

InflationReceived#

Defined in IIFtsoRewardManager (Docs, Source).

event InflationReceived(
    uint256 amountReceivedWei
)

Emitted when the contract has received the daily inflation amount.

Parameters Type Description
amountReceivedWei uint256 Received amount of native tokens, in wei.

RewardClaimed#

Defined in IFtsoRewardManager (Docs, Source).

event RewardClaimed(
    address dataProvider,
    address whoClaimed,
    address sentTo,
    uint256 rewardEpoch,
    uint256 amount
)

Emitted when a data provider claims its FTSO rewards.

Parameters Type Description
dataProvider address Address of the data provider that accrued the reward.
whoClaimed address Address that actually performed the claim.
sentTo address Address that received the reward.
rewardEpoch uint256 ID of the reward epoch where the reward was accrued.
amount uint256 Amount of rewarded native tokens (wei).

RewardClaimsEnabled#

Defined in IFtsoRewardManager (Docs, Source).

event RewardClaimsEnabled(
    uint256 rewardEpochId
)

Emitted when reward claims have been enabled.

Parameters Type Description
rewardEpochId uint256 First claimable reward epoch.

RewardClaimsExpired#

Defined in IFtsoRewardManager (Docs, Source).

event RewardClaimsExpired(
    uint256 rewardEpochId
)

Unclaimed rewards have expired and are now inaccessible.

getUnclaimedReward() can be used to retrieve more information.

Parameters Type Description
rewardEpochId uint256 ID of the reward epoch that has just expired.

RewardsBurned#

Defined in IIFtsoRewardManager (Docs, Source).

event RewardsBurned(
    uint256 amountBurnedWei
)

Emitted when unclaimed rewards are burned.

Parameters Type Description
amountBurnedWei uint256 Burned amount of native tokens, in wei.

RewardsDistributed#

Defined in IFtsoRewardManager (Docs, Source).

event RewardsDistributed(
    address ftso,
    uint256 epochId,
    address[] addresses,
    uint256[] rewards
)

Emitted every price epoch, when rewards have been distributed to each contributing data provider. Note that rewards are not claimable until the reward epoch finishes.

Parameters Type Description
ftso address Address of the FTSO that generated the rewards.
epochId uint256 ID of the reward epoch where the rewards were accrued.
addresses address[] Data provider addresses that have rewards to claim.
rewards uint256[] Amounts available for claiming (wei).

UnearnedRewardsAccrued#

Defined in IFtsoRewardManager (Docs, Source).

event UnearnedRewardsAccrued(
    uint256 epochId,
    uint256 reward
)

Emitted when rewards cannot be distributed during a reward epoch (for example, because the FTSO went into fallback mode) and they are accrued for later burning.

Parameters Type Description
epochId uint256 ID of the reward epoch where the reward was accrued.
reward uint256 Total amount of accrued rewards (wei).

Functions#

accrueUnearnedRewards#

Defined in IIFtsoRewardManager (Docs, Source).

function accrueUnearnedRewards(
    uint256 epochId,
    uint256 priceEpochDurationSeconds,
    uint256 priceEpochEndTime
) external;

Accrue unearned rewards for a given price epoch. Typically done when the FTSO is in fallback mode or because of insufficient vote power. Simply accrue them so they will not be distributed and will be burned later.

The amount of rewards that will be burned is calculated in the same way as in distributeRewards.

Parameters Type Description
epochId uint256 Price epoch ID.
priceEpochDurationSeconds uint256 Duration of price epochs (180s).
priceEpochEndTime uint256 Timestamp of the price epoch end time (end of submit period), in seconds since UNIX epoch.

activate#

Defined in IIFtsoRewardManager (Docs, Source).

function activate(
) external;

Activates reward manager (allows claiming rewards).

active#

Defined in IFtsoRewardManager (Docs, Source).

function active(
) external view returns (
    bool);

Whether rewards can be claimed from this reward manager.

autoClaim#

Defined in IFtsoRewardManager (Docs, Source).

function autoClaim(
    address[] _rewardOwners,
    uint256 _rewardEpoch
) external;

Allows claiming rewards simultaneously for a list of reward owners and all unclaimed epochs before the specified one.

This is meant as a convenience all-in-one reward claiming method to be used both by reward owners and registered executors. It performs a series of operations, besides claiming rewards:

  • If a reward owner has enabled its Personal Delegation Account, rewards are also claimed for the PDA and the total claimed amount is sent to that PDA. Otherwise, the claimed amount is sent to the reward owner's account.

  • Claimed amount is automatically wrapped through the WNat contract.

  • If the caller is a registered executor with a non-zero fee, the fee is paid to the executor for each claimed address.

Parameters Type Description
_rewardOwners address[] List of reward owners to claim for.
_rewardEpoch uint256 Last reward epoch ID to claim for. All previous epochs with pending rewards will be claimed too.

claim#

Defined in IFtsoRewardManager (Docs, Source).

function claim(
    address _rewardOwner,
    address payable _recipient,
    uint256 _rewardEpoch,
    bool _wrap
) external returns (
    uint256 _rewardAmount);

Allows the caller to claim rewards for a reward owner. The caller does not have to be the owner of the rewards, but must be approved by the owner to claim on his behalf by using setClaimExecutors on the claimSetupManager.

This function is intended to be used to claim rewards in case of delegation by percentage. Reverts if msg.sender is delegating by amount.

Anybody can call this method, but rewards can only be sent to the reward owner, therefore no funds can be stolen. However, by limiting the authorized callers, the owner can control the timing of the calls.

When the reward owner is the caller, rewards can be sent to any recipient set by setAllowedClaimRecipients on the claimSetupManager. The reward owner's Personal Delegation Account is always an authorized recipient.

Parameters Type Description
_rewardOwner address Address of the reward owner.
_recipient address payable Address to transfer claimed rewards to.
_rewardEpoch uint256 Last reward epoch to claim for. All previous epochs with pending rewards will be claimed too.
_wrap bool Whether claimed rewards should be wrapped through the WNat contract before transferring them to the _recipient. This parameter is offered as a convenience.
Returns Type Description
_rewardAmount uint256 Total amount of claimed rewards (wei).

claimFromDataProviders#

Defined in IFtsoRewardManager (Docs, Source).

function claimFromDataProviders(
    address _rewardOwner,
    address payable _recipient,
    uint256[] _rewardEpochs,
    address[] _dataProviders,
    bool _wrap
) external returns (
    uint256 _rewardAmount);

Allows the caller to claim rewards for a reward owner from specific data providers. The caller does not have to be the owner of the rewards, but must be approved by the owner to claim on his behalf by using setClaimExecutors on the claimSetupManager.

This function is intended to be used to claim rewards in case of delegation by amount (explicit delegation). Reverts if msg.sender is delegating by percentage.

Anybody can call this method, but rewards can only be sent to the reward owner, therefore no funds can be stolen. However, by limiting the authorized callers, the owner can control the timing of the calls.

When the reward owner is the caller, rewards can be sent to any recipient set by setAllowedClaimRecipients on the claimSetupManager. The reward owner's Personal Delegation Account is always an authorized recipient.

Parameters Type Description
_rewardOwner address Address of the reward owner.
_recipient address payable Address to transfer claimed rewards to.
_rewardEpochs uint256[] Array of reward epoch IDs to claim for.
_dataProviders address[] Array of addresses of the data providers to claim the reward from.
_wrap bool Whether claimed rewards should be wrapped through the WNat contract before transferring them to the _recipient. This parameter is offered as a convenience.
Returns Type Description
_rewardAmount uint256 Total amount of claimed rewards (wei).

claimReward#

Defined in IFtsoRewardManager (Docs, Source).

function claimReward(
    address payable _recipient,
    uint256[] _rewardEpochs
) external returns (
    uint256 _rewardAmount);

Allows a percentage delegator to claim rewards. This function is intended to be used to claim rewards in case of delegation by percentage.

This function is deprecated: use claim instead.

Reverts if msg.sender is delegating by amount. Claims for all unclaimed reward epochs to the 'max(_rewardEpochs)'. Retained for backward compatibility.

Parameters Type Description
_recipient address payable Address to transfer funds to.
_rewardEpochs uint256[] Array of reward epoch numbers to claim for.
Returns Type Description
_rewardAmount uint256 Amount of total claimed rewards (wei).

claimRewardFromDataProviders#

Defined in IFtsoRewardManager (Docs, Source).

function claimRewardFromDataProviders(
    address payable _recipient,
    uint256[] _rewardEpochs,
    address[] _dataProviders
) external returns (
    uint256 _rewardAmount);

Allows the caller to claim rewards from specific data providers. This function is intended to be used to claim rewards in case of delegation by amount.

This function is deprecated: use claimFromDataProviders instead.

Parameters Type Description
_recipient address payable Address to transfer funds to.
_rewardEpochs uint256[] Array of reward epoch numbers to claim for.
_dataProviders address[] Array of addresses of the data providers to claim the reward from.
Returns Type Description
_rewardAmount uint256 Total amount of claimed rewards (wei).

closeExpiredRewardEpoch#

Defined in IIFtsoRewardManager (Docs, Source).

function closeExpiredRewardEpoch(
    uint256 _rewardEpochId
) external;

Collects funds from expired reward epoch and calculates totals.

Triggered by ftsoManager on finalization of a reward epoch. Operation is irreversible: when some reward epoch is closed according to current settings, it cannot be reopened even if new parameters would allow it, because nextRewardEpochToExpire in ftsoManager never decreases.

Parameters Type Description
_rewardEpochId uint256 ID of the epoch to close.

deactivate#

Defined in IIFtsoRewardManager (Docs, Source).

function deactivate(
) external;

Deactivates reward manager (prevents claiming rewards).

distributeRewards#

Defined in IIFtsoRewardManager (Docs, Source).

function distributeRewards(
    address[] addresses,
    uint256[] weights,
    uint256 totalWeight,
    uint256 epochId,
    address ftso,
    uint256 priceEpochDurationSeconds,
    uint256 currentRewardEpoch,
    uint256 priceEpochEndTime,
    uint256 votePowerBlock
) external;

Distributes price epoch rewards to data provider accounts, according to input parameters. Must be called with totalWeight > 0 and addresses.length > 0.

The amount of rewards for a given price epoch ID are calculated in FtsoRewardManager from priceEpochDurationSeconds, priceEpochEndTime and inflation authorization data (see _getTotalPriceEpochRewardWei in FtsoRewardManager. Then each data provider address is given a portion of this amount according to corresponding weight and total sum of weights.

Parameters epochId and ftso are only needed so they can be passed onto the emitted event.

Parameters Type Description
addresses address[] Data provider addresses to reward.
weights uint256[] Weights corresponding to rewarded addresses.
totalWeight uint256 Sum of all weights.
epochId uint256 Price epoch ID.
ftso address Randomly chosen FTSO contract used to calculate the weights.
priceEpochDurationSeconds uint256 Duration of price epochs (180s).
currentRewardEpoch uint256 ID of the current reward epoch. Rewards for the price epoch are added to this reward epoch.
priceEpochEndTime uint256 Timestamp of the price epoch end time (end of submit period), in seconds since UNIX epoch.
votePowerBlock uint256 Vote power block used in the given reward epoch.

enableClaims#

Defined in IIFtsoRewardManager (Docs, Source).

function enableClaims(
) external;

Enable claiming for current and all future reward epochs.

firstClaimableRewardEpoch#

Defined in IIFtsoRewardManager (Docs, Source).

function firstClaimableRewardEpoch(
) external view returns (
    uint256);

Epochs before the token distribution event at Flare launch were not be claimable. Use this method to know the first reward epoch that was claimable.

Returns Type Description
[0] uint256 uint256 The first reward epoch that can be claimed.

getClaimedReward#

Defined in IFtsoRewardManager (Docs, Source).

function getClaimedReward(
    uint256 _rewardEpoch,
    address _dataProvider,
    address _claimer
) external view returns (
    bool _claimed,
    uint256 _amount);

Returns information on the rewards accrued by a reward owner from a specific data provider at a specific reward epoch.

Parameters Type Description
_rewardEpoch uint256 Reward epoch ID to query.
_dataProvider address Address of the data provider to query.
_claimer address Address of the reward owner to query.
Returns Type Description
_claimed bool Whether the reward has been claimed or not.
_amount uint256 Accrued amount in wei.

getContractName#

Defined in IIInflationReceiver (Docs, Source).

function getContractName(
) external view returns (
    string);

Implement this function to allow updating inflation receiver contracts through AddressUpdater.

Returns Type Description
[0] string Contract name.

getCurrentRewardEpoch#

Defined in IFtsoRewardManager (Docs, Source).

function getCurrentRewardEpoch(
) external view returns (
    uint256);

Returns the current reward epoch ID.

getDataProviderCurrentFeePercentage#

Defined in IFtsoRewardManager (Docs, Source).

function getDataProviderCurrentFeePercentage(
    address _dataProvider
) external view returns (
    uint256 _feePercentageBIPS);

Returns the current fee percentage of a data provider.

Parameters Type Description
_dataProvider address Address of the queried data provider.
Returns Type Description
_feePercentageBIPS uint256 Fee percentage in BIPS.

getDataProviderFeePercentage#

Defined in IFtsoRewardManager (Docs, Source).

function getDataProviderFeePercentage(
    address _dataProvider,
    uint256 _rewardEpoch
) external view returns (
    uint256 _feePercentageBIPS);

Returns the fee percentage of a data provider at a given reward epoch.

Parameters Type Description
_dataProvider address Address of the queried data provider.
_rewardEpoch uint256 Reward epoch ID.
Returns Type Description
_feePercentageBIPS uint256 Fee percentage in BIPS.

getDataProviderPerformanceInfo#

Defined in IFtsoRewardManager (Docs, Source).

function getDataProviderPerformanceInfo(
    uint256 _rewardEpoch,
    address _dataProvider
) external view returns (
    uint256 _rewardAmount,
    uint256 _votePowerIgnoringRevocation);

Returns information on rewards and vote power of a data provider at a given reward epoch.

Parameters Type Description
_rewardEpoch uint256 Reward epoch ID.
_dataProvider address Address of the data provider to query.
Returns Type Description
_rewardAmount uint256 Amount of rewards (wei).
_votePowerIgnoringRevocation uint256 Vote power, not including revocations.

getDataProviderScheduledFeePercentageChanges#

Defined in IFtsoRewardManager (Docs, Source).

function getDataProviderScheduledFeePercentageChanges(
    address _dataProvider
) external view returns (
    uint256[] _feePercentageBIPS,
    uint256[] _validFromEpoch,
    bool[] _fixed);

Returns the scheduled fee percentage changes for a data provider.

Parameters Type Description
_dataProvider address Address of the queried data provider.
Returns Type Description
_feePercentageBIPS uint256[] Array of fee percentages in BIPS.
_validFromEpoch uint256[] Array of block numbers from which the fee settings are effective.
_fixed bool[] Array of boolean values indicating whether settings are subject to change or not.

getEpochReward#

Defined in IFtsoRewardManager (Docs, Source).

function getEpochReward(
    uint256 _rewardEpoch
) external view returns (
    uint256 _totalReward,
    uint256 _claimedReward);

Returns information on an epoch's rewards.

Parameters Type Description
_rewardEpoch uint256 Reward epoch ID.
Returns Type Description
_totalReward uint256 Total amount of rewards accrued on that epoch, in wei.
_claimedReward uint256 Total amount of rewards that have already been claimed, in wei.

getEpochsWithClaimableRewards#

Defined in IFtsoRewardManager (Docs, Source).

function getEpochsWithClaimableRewards(
) external view returns (
    uint256 _startEpochId,
    uint256 _endEpochId);

Returns the reward epoch range for which rewards can be claimed. Rewards outside this range are unclaimable, either because they have expired or because the reward epoch is still ongoing.

Returns Type Description
_startEpochId uint256 The oldest epoch ID that allows reward claiming.
_endEpochId uint256 The newest epoch ID that allows reward claiming.

getEpochsWithUnclaimedRewards#

Defined in IFtsoRewardManager (Docs, Source).

function getEpochsWithUnclaimedRewards(
    address _beneficiary
) external view returns (
    uint256[] _epochIds);

Returns the array of claimable epoch IDs for which the rewards of a reward owner have not yet been claimed.

Parameters Type Description
_beneficiary address Address of the reward owner to query. Reverts if it uses delegation by amount.
Returns Type Description
_epochIds uint256[] Array of epoch IDs.

getExpectedBalance#

Defined in IIInflationReceiver (Docs, Source).

function getExpectedBalance(
) external view returns (
    uint256);

Returns the contract's expected balance (actual balance may be higher due to self-destruct funds).

Returns Type Description
[0] uint256 Expected native token balance.

getInflationAddress#

Defined in IIInflationReceiver (Docs, Source).

function getInflationAddress(
) external returns (
    address);

Returns the address of the Inflation contract.

getInitialRewardEpoch#

Defined in IFtsoRewardManager (Docs, Source).

function getInitialRewardEpoch(
) external view returns (
    uint256);

Returns the initial reward epoch ID for this reward manager contract. This corresponds to the oldest reward epoch with claimable rewards in the previous reward manager when this one took over. Set by governance through setInitialRewardData.

getRewardEpochToExpireNext#

Defined in IFtsoRewardManager (Docs, Source).

function getRewardEpochToExpireNext(
) external view returns (
    uint256);

Returns the reward epoch that will expire next once a new reward epoch starts.

getRewardEpochVotePowerBlock#

Defined in IFtsoRewardManager (Docs, Source).

function getRewardEpochVotePowerBlock(
    uint256 _rewardEpoch
) external view returns (
    uint256);

Returns the vote power block of a given reward epoch.

Parameters Type Description
_rewardEpoch uint256 Reward epoch ID.

getStateOfRewards#

Defined in IFtsoRewardManager (Docs, Source).

function getStateOfRewards(
    address _beneficiary,
    uint256 _rewardEpoch
) external view returns (
    address[] _dataProviders,
    uint256[] _rewardAmounts,
    bool[] _claimed,
    bool _claimable);

Returns the state of rewards for a given address at a specific reward epoch.

Parameters Type Description
_beneficiary address Address of the beneficiary to query. It can be a data provider or a delegator, for example.
Reverts if the queried address is delegating by amount.
_rewardEpoch uint256 Reward epoch ID to query.
Returns Type Description
_dataProviders address[] Array of addresses of data providers.
_rewardAmounts uint256[] Array of reward amounts received from each provider, in wei.
_claimed bool[] Array of boolean values indicating whether each reward has been claimed or not.
_claimable bool Boolean value indicating whether rewards are claimable or not.

getStateOfRewardsFromDataProviders#

Defined in IFtsoRewardManager (Docs, Source).

function getStateOfRewardsFromDataProviders(
    address _beneficiary,
    uint256 _rewardEpoch,
    address[] _dataProviders
) external view returns (
    uint256[] _rewardAmounts,
    bool[] _claimed,
    bool _claimable);

Returns the state of rewards for a given address coming from a specific set of data providers, at a specific reward epoch.

Parameters Type Description
_beneficiary address Address of beneficiary to query.
_rewardEpoch uint256 Reward epoch ID to query.
_dataProviders address[] Array of addresses of the data providers to query.
Returns Type Description
_rewardAmounts uint256[] Array of reward amounts received from each provider, in wei.
_claimed bool[] Array of boolean values indicating whether each reward has been claimed or not.
_claimable bool Boolean value indicating whether rewards are claimable or not.

getTokenPoolSupplyData#

Defined in IITokenPool (Docs, Source).

function getTokenPoolSupplyData(
) external returns (
    uint256 _lockedFundsWei,
    uint256 _totalInflationAuthorizedWei,
    uint256 _totalClaimedWei);

Returns token pool supply data.

Returns Type Description
_lockedFundsWei uint256 Total amount of funds ever locked in the token pool (wei). _lockedFundsWei - _totalClaimedWei is the amount currently locked and outside the circulating supply.
_totalInflationAuthorizedWei uint256 Total inflation authorized amount (wei).
_totalClaimedWei uint256 Total claimed amount (wei).

getUnclaimedReward#

Defined in IIFtsoRewardManager (Docs, Source).

function getUnclaimedReward(
    uint256 _rewardEpoch,
    address _dataProvider
) external view returns (
    uint256 _amount,
    uint256 _weight);

Returns information on unclaimed rewards for a given data provider and epoch.

Parameters Type Description
_rewardEpoch uint256 Queried reward epoch ID.
_dataProvider address Address of the queried data provider.
Returns Type Description
_amount uint256 Amount available to be claimed, in wei.
_weight uint256 Portion of total vote power used in this reward epoch that has not yet claimed its reward, in BIPS. It decreases to 0 when all data providers have claimed their rewards.

nextClaimableRewardEpoch#

Defined in IFtsoRewardManager (Docs, Source).

function nextClaimableRewardEpoch(
    address _rewardOwner
) external view returns (
    uint256);

Returns the next claimable reward epoch for a reward owner.

Parameters Type Description
_rewardOwner address Address of the reward owner to query.

receiveInflation#

Defined in IIInflationReceiver (Docs, Source).

function receiveInflation(
) external payable;

Receive native tokens from inflation.

setDailyAuthorizedInflation#

Defined in IIInflationReceiver (Docs, Source).

function setDailyAuthorizedInflation(
    uint256 _toAuthorizeWei
) external;

Notify the receiver that it is entitled to receive a new inflation amount.

Parameters Type Description
_toAuthorizeWei uint256 The amount of inflation that can be awarded in the coming day, in wei.

setDataProviderFeePercentage#

Defined in IFtsoRewardManager (Docs, Source).

function setDataProviderFeePercentage(
    uint256 _feePercentageBIPS
) external returns (
    uint256 _validFromEpoch);

Sets the fee a data provider keeps from all delegations.

Takes effect after feeValueUpdateOffset reward epochs have elapsed.

When called multiple times inside the same reward epoch, only the last value remains.

Parameters Type Description
_feePercentageBIPS uint256 Fee percentage in BIPS.
Returns Type Description
_validFromEpoch uint256 Reward epoch number when the new fee percentage will become effective.