Skip to content

Inflation#

Recognizes, authorizes, mints, and funds native tokens to Flare services that are rewardable through inflation.

See the technical specification.

Events#

GovernanceCallTimelocked#

Defined in GovernedBase (Docs, Source).

event GovernanceCallTimelocked(
    bytes4 selector,
    uint256 allowedAfterTimestamp,
    bytes encodedCall
)

Emitted when a new governance call has been recorded and is now waiting for the time lock to expire.

GovernanceInitialised#

Defined in GovernedBase (Docs, Source).

event GovernanceInitialised(
    address initialGovernance
)

Emitted when the governance address is initialized. This address will be used until production mode is entered (see GovernedProductionModeEntered). At that point the governance address is taken from GovernanceSettings.

GovernedProductionModeEntered#

Defined in GovernedBase (Docs, Source).

event GovernedProductionModeEntered(
    address governanceSettings
)

Emitted when governance is enabled and the governance address cannot be changed anymore (only through a network fork).

InflationAllocationSet#

Defined in Inflation (Docs, Source).

event InflationAllocationSet(
    contract IIInflationAllocation inflationAllocation
)

InflationAuthorized#

Defined in Inflation (Docs, Source).

event InflationAuthorized(
    uint256 amountWei
)

InflationRewardServiceDailyAuthorizedInflationComputed#

Defined in Inflation (Docs, Source).

event InflationRewardServiceDailyAuthorizedInflationComputed(
    contract IIInflationReceiver inflationReceiver,
    uint256 amountWei
)

InflationRewardServiceTopupComputed#

Defined in Inflation (Docs, Source).

event InflationRewardServiceTopupComputed(
    contract IIInflationReceiver inflationReceiver,
    uint256 amountWei
)

InflationRewardServiceTopupRequestReceived#

Defined in Inflation (Docs, Source).

event InflationRewardServiceTopupRequestReceived(
    contract IIInflationReceiver inflationReceiver,
    uint256 amountWei
)

MintingReceived#

Defined in Inflation (Docs, Source).

event MintingReceived(
    uint256 amountWei,
    uint256 selfDestructAmountWei
)

NewTimeSlotInitialized#

Defined in Inflation (Docs, Source).

event NewTimeSlotInitialized(
    uint256 startTimeStamp,
    uint256 endTimeStamp,
    uint256 inflatableSupplyWei,
    uint256 recognizedInflationWei
)

SupplySet#

Defined in Inflation (Docs, Source).

event SupplySet(
    contract IISupply oldSupply,
    contract IISupply newSupply
)

TimelockedGovernanceCallCanceled#

Defined in GovernedBase (Docs, Source).

event TimelockedGovernanceCallCanceled(
    bytes4 selector,
    uint256 timestamp
)

Emitted when a timelocked governance call is canceled before execution.

TimelockedGovernanceCallExecuted#

Defined in GovernedBase (Docs, Source).

event TimelockedGovernanceCallExecuted(
    bytes4 selector,
    uint256 timestamp
)

Emitted when a timelocked governance call is executed.

TopupConfigurationSet#

Defined in Inflation (Docs, Source).

event TopupConfigurationSet(
    struct TopupConfiguration topupConfiguration
)

TopupRequested#

Defined in Inflation (Docs, Source).

event TopupRequested(
    uint256 requestAmountWei,
    uint256 reRequestAmountWei
)

Functions#

cancelGovernanceCall#

Defined in GovernedBase (Docs, Source).

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.

constructor#

Defined in Inflation (Docs, Source).

constructor(
    address _governance,
    contract FlareDaemon _flareDaemon,
    address _addressUpdater,
    uint256 _rewardEpochStartTs
) public;

constructor#

Defined in GovernedAndFlareDaemonized (Docs, Source).

constructor(
    address _governance,
    contract FlareDaemon _flareDaemon
) public;

constructor#

Defined in Governed (Docs, Source).

constructor(
    address _governance
) public;
Parameters Type Description
_governance address Governance contract. Must not be zero.

daemonize#

Defined in IFlareDaemonize (Docs, Source).

function daemonize(
) external returns (
    bool);

Implement this function to receive a trigger from the FlareDaemon. The trigger method is called by the validator right at the end of block state transition.

Returns Type Description
[0] bool bool Whether the contract is still active after the call. Currently unused.

executeGovernanceCall#

Defined in GovernedBase (Docs, Source).

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#

Defined in AddressUpdatable (Docs, Source).

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.

getContractName#

Defined in Inflation (Docs, Source).

function getContractName(
) external pure returns (
    string);

Implement this function to allow updating daemonized contracts through the AddressUpdater.

Returns Type Description
[0] string string Contract name.

getCurrentTimeSlot#

Defined in Inflation (Docs, Source).

function getCurrentTimeSlot(
) external view returns (
    struct InflationTimeSlots.InflationTimeSlot);

Return the current time slot.

Expect library to revert if there is no current time slot.

Returns Type Description
[0] struct InflationTimeSlots.InflationTimeSlot The inflation time slot state of the current time slot.

getCurrentTimeSlotId#

Defined in Inflation (Docs, Source).

function getCurrentTimeSlotId(
) external view returns (
    uint256);

Return current time slot id.

Expect library to revert if there is no current time slot.

Returns Type Description
[0] uint256 Id of the current time slot.

getNextExpectedTopupTs#

Defined in Inflation (Docs, Source).

function getNextExpectedTopupTs(
) external view returns (
    uint256 _nextTopupTs);

Returns next expected inflation topup time stamp which is also inflation authorization time. The returned time from this API is actually the time of the block in which the topup is requested. The Actual topup will take place in the next block. Expected diff is up to a few seconds (max is less then a minute).

getRewardServices#

Defined in Inflation (Docs, Source).

function getRewardServices(
) external view returns (
    struct InflationRewardServices.RewardService[]);

Return the structure of reward services.

Returns Type Description
[0] struct InflationRewardServices.RewardService[] Reward services structure.

getTimeSlot#

Defined in Inflation (Docs, Source).

function getTimeSlot(
    uint256 _index
) external view returns (
    struct InflationTimeSlots.InflationTimeSlot);

Given an index, return the time slot at that index.

Expect library to revert if index not found.

Parameters Type Description
_index uint256 The index of the time slot to fetch.
Returns Type Description
[0] struct InflationTimeSlots.InflationTimeSlot The inflation time slot state.

getTopupConfiguration#

Defined in Inflation (Docs, Source).

function getTopupConfiguration(
    contract IIInflationReceiver _inflationReceiver
) external view returns (
    struct TopupConfiguration _topupConfiguration);

Given an inflation receiver, get the topup configuration.

Parameters Type Description
_inflationReceiver contract IIInflationReceiver The reward service.
Returns Type Description
_topupConfiguration struct TopupConfiguration The configuration of how the topup requests are calculated for a given reward service.

getTotals#

Defined in Inflation (Docs, Source).

function getTotals(
) external view returns (
    uint256 _totalAuthorizedInflationWei,
    uint256 _totalInflationTopupRequestedWei,
    uint256 _totalInflationTopupDistributedWei,
    uint256 _totalRecognizedInflationWei);

Get a tuple of totals across inflation time slots.

Returns Type Description
_totalAuthorizedInflationWei uint256 Total inflation authorized to be mintable
_totalInflationTopupRequestedWei uint256 Total inflation requested to be topped up for rewarding
_totalInflationTopupDistributedWei uint256 Total inflation received for funding reward services
_totalRecognizedInflationWei uint256 Total inflation recognized for rewarding

governance#

Defined in GovernedBase (Docs, Source).

function governance(
) public view returns (
    address);

Returns the current effective governance address.

receiveMinting#

Defined in Inflation (Docs, Source).

function receiveMinting(
) external payable;

Receive newly minted native tokens from the FlareDaemon.

Assume that the received amount will be >= last topup requested across all services. If there is not enough balance sent to cover the topup request, expect the library method to revert. Also assume that any received balance greater than the calculated topup request came from self-destructor sending a balance to this contract.

setInitialData#

Defined in Inflation (Docs, Source).

function setInitialData(
    contract IIInflationV1 _oldInflation,
    uint256 _noOfAnnums
) external;

Used to copy data from old inflation contract.

Only governance can call.

Parameters Type Description
_oldInflation contract IIInflationV1 Address of old inflation.
_noOfAnnums uint256 Number of annums in old inflation.

setPreInflationCalculation#

Defined in Inflation (Docs, Source).

function setPreInflationCalculation(
    contract IIPreInflationCalculation _preInflationCalculation
) external;

Set contract that should be triggered before new inflation is calculated (it can be address(0))

Only governance can call.

setTopupConfiguration#

Defined in Inflation (Docs, Source).

function setTopupConfiguration(
    contract IIInflationReceiver _inflationReceiver,
    enum TopupType _topupType,
    uint256 _topupFactorX100
) external;

Set the topup configuration for a reward service.

Only governance can call.

Topup factor, if _topupType == FACTOROFDAILYAUTHORIZED, must be greater than 100.

Parameters Type Description
_inflationReceiver contract IIInflationReceiver The reward service to receive the inflation funds for distribution.
_topupType enum TopupType The type to signal how the topup amounts are to be calculated. FACTOROFDAILYAUTHORIZED = Use a factor of last daily authorized to set a target balance for a reward service to maintain as a reserve for claiming. ALLAUTHORIZED = Mint enough native tokens to topup reward service contract to hold all authorized but unrequested rewards.
_topupFactorX100 uint256 If _topupType == FACTOROFDAILYAUTHORIZED, then this factor (times 100) is multiplied by last daily authorized inflation to obtain the maximum balance that a reward service can hold at any given time. If it holds less, then this max amount is used to compute the mint request topup required to bring the reward service contract native token balance up to that amount.

switchToFallbackMode#

Defined in Inflation (Docs, Source).

function switchToFallbackMode(
) external view returns (
    bool);

This function will be called after an error is caught in daemonize. It will switch the contract to a simpler fallback mode, which hopefully works when full mode doesn't. Not every contract needs to support fallback mode (FtsoManager does), so this method may be empty. Switching back to normal mode is left to the contract (typically a governed method call). This function may be called due to low-gas error, so it shouldn't use more than ~30.000 gas.

Returns Type Description
[0] bool True if switched to fallback mode, false if already in fallback mode or if fallback mode is not supported.

switchToProductionMode#

Defined in GovernedBase (Docs, Source).

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.

updateContractAddresses#

Defined in AddressUpdatable (Docs, Source).

function updateContractAddresses(
    bytes32[] _contractNameHashes,
    address[] _contractAddresses
) external;

External method called from AddressUpdater only.

Modifiers#

notZero#

Defined in Inflation (Docs, Source).

modifier notZero(    address _address)

onlyAddressUpdater#

Defined in AddressUpdatable (Docs, Source).

modifier onlyAddressUpdater()

Only the AdressUpdater contract can call this method. Its address is set at construction time but it can also update itself.

onlyFlareDaemon#

Defined in GovernedAndFlareDaemonized (Docs, Source).

modifier onlyFlareDaemon()

Only the flareDaemon can call this method.

onlyGovernance#

Defined in GovernedBase (Docs, Source).

modifier onlyGovernance()

onlyImmediateGovernance#

Defined in GovernedBase (Docs, Source).

modifier onlyImmediateGovernance()

Variables#

flareDaemon#

Defined in GovernedAndFlareDaemonized (Docs, Source).

    contract FlareDaemon flareDaemon

The FlareDaemon contract, set at construction time.

governanceSettings#

Defined in GovernedBase (Docs, Source).

    contract IGovernanceSettings governanceSettings

Governance Settings.

inflationAllocation#

Defined in Inflation (Docs, Source).

    contract IIInflationAllocation inflationAllocation

lastAuthorizationTs#

Defined in Inflation (Docs, Source).

    uint256 lastAuthorizationTs

The last time inflation was authorized.

preInflationCalculation#

Defined in Inflation (Docs, Source).

    contract IIPreInflationCalculation preInflationCalculation

productionMode#

Defined in GovernedBase (Docs, Source).

    bool productionMode

When true, governance is enabled and cannot be disabled. See switchToProductionMode.

rewardEpochStartTs#

Defined in Inflation (Docs, Source).

    uint256 rewardEpochStartTs

Do not start inflation time slots before this, in seconds after UNIX epoch.

rewardEpochStartedTs#

Defined in Inflation (Docs, Source).

    uint256 rewardEpochStartedTs

When the first reward epoch was started, in seconds after UNIX epoch.

supply#

Defined in Inflation (Docs, Source).

    contract IISupply supply

timelockedCalls#

Defined in GovernedBase (Docs, Source).

    mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls

List of pending timelocked governance calls.