Skip to content

FlareDaemon#

Flare Daemon contract.

This contract exists to coordinate regular daemon-like polling of contracts that are registered to receive said polling. The trigger method is called by the validator right at the end of block state transition.

Events#

ContractDaemonizeErrored#

Defined in FlareDaemon (Docs, Source).

event ContractDaemonizeErrored(
    address theContract,
    uint256 atBlock,
    string theMessage,
    uint256 gasConsumed
)

ContractDaemonized#

Defined in FlareDaemon (Docs, Source).

event ContractDaemonized(
    address theContract,
    uint256 gasConsumed
)

ContractHeldOff#

Defined in FlareDaemon (Docs, Source).

event ContractHeldOff(
    address theContract,
    uint256 blockHoldoffsRemaining
)

ContractsSkippedOutOfGas#

Defined in FlareDaemon (Docs, Source).

event ContractsSkippedOutOfGas(
    uint256 numberOfSkippedConstracts
)

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).

InflationSet#

Defined in FlareDaemon (Docs, Source).

event InflationSet(
    contract IInflationGenesis theNewContract,
    contract IInflationGenesis theOldContract
)

MintingReceived#

Defined in FlareDaemon (Docs, Source).

event MintingReceived(
    uint256 amountWei
)

MintingRequestReceived#

Defined in FlareDaemon (Docs, Source).

event MintingRequestReceived(
    uint256 amountWei
)

MintingRequestTriggered#

Defined in FlareDaemon (Docs, Source).

event MintingRequestTriggered(
    uint256 amountWei
)

MintingWithdrawn#

Defined in FlareDaemon (Docs, Source).

event MintingWithdrawn(
    uint256 amountWei
)

RegistrationUpdated#

Defined in FlareDaemon (Docs, Source).

event RegistrationUpdated(
    contract IFlareDaemonize theContract,
    bool add
)

SelfDestructReceived#

Defined in FlareDaemon (Docs, Source).

event SelfDestructReceived(
    uint256 amountWei
)

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.

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 FlareDaemon (Docs, Source).

constructor(
) public;

This constructor should contain no code as this contract is pre-loaded into the genesis block. The super constructor is called for testing convenience.

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.

getDaemonizedContractsData#

Defined in FlareDaemon (Docs, Source).

function getDaemonizedContractsData(
) external view returns (
    contract IFlareDaemonize[] _daemonizeContracts,
    uint256[] _gasLimits,
    uint256[] _blockHoldoffsRemaining);

getNextMintRequestAllowedTs#

Defined in FlareDaemon (Docs, Source).

function getNextMintRequestAllowedTs(
) external view returns (
    uint256);

governance#

Defined in GovernedBase (Docs, Source).

function governance(
) public view returns (
    address);

Returns the current effective governance address.

initialise#

Defined in GovernedAtGenesis (Docs, Source).

function initialise(
    address _governance
) public pure;

Disallow initialise to be called.

Parameters Type Description
_governance address The governance address for initial claiming.

initialiseFixedAddress#

Defined in FlareDaemon (Docs, Source).

function initialiseFixedAddress(
) public returns (
    address);

Set the governance address to a hard-coded known address.

This should be done at contract deployment time.

Returns Type Description
[0] address The governance address.

registerToDaemonize#

Defined in FlareDaemon (Docs, Source).

function registerToDaemonize(
    struct FlareDaemon.Registration[] _registrations
) external;

Register contracts to be polled by the daemon process.

A gas limit of zero will set no limit for the contract but the validator has an overall limit for the trigger method. If any registrations already exist, they will be unregistered. Contracts will be daemonized in the order in which presented via the _registrations array.

Parameters Type Description
_registrations struct FlareDaemon.Registration[] An array of Registration structures of IFlareDaemonize contracts to daemonize and gas limits for each contract.

requestMinting#

Defined in FlareDaemon (Docs, Source).

function requestMinting(
    uint256 _amountWei
) external;

Queue up a minting request to send to the validator at next trigger.

Parameters Type Description
_amountWei uint256 The amount to mint.

setAddressUpdater#

Defined in FlareDaemon (Docs, Source).

function setAddressUpdater(
    address _addressUpdater
) external;

Sets the address udpater contract.

Parameters Type Description
_addressUpdater address The address updater contract.

setBlockHoldoff#

Defined in FlareDaemon (Docs, Source).

function setBlockHoldoff(
    uint256 _blockHoldoff
) external;

Set number of blocks that must elapse before a daemonized contract exceeding gas limit can have its daemonize() method called again.

Parameters Type Description
_blockHoldoff uint256 The number of blocks to holdoff.

setMaxMintingRequest#

Defined in FlareDaemon (Docs, Source).

function setMaxMintingRequest(
    uint256 _maxMintingRequestWei
) external;

Set limit on how much can be minted per request. this number can't be udated too often

Parameters Type Description
_maxMintingRequestWei uint256 The request maximum in wei.

showDaemonizedErrors#

Defined in FlareDaemon (Docs, Source).

function showDaemonizedErrors(
    uint256 startIndex,
    uint256 numErrorTypesToShow
) public view returns (
    uint256[] _lastErrorBlock,
    uint256[] _numErrors,
    string[] _errorString,
    address[] _erroringContract,
    uint256 _totalDaemonizedErrors);

showLastDaemonizedError#

Defined in FlareDaemon (Docs, Source).

function showLastDaemonizedError(
) external view returns (
    uint256[] _lastErrorBlock,
    uint256[] _numErrors,
    string[] _errorString,
    address[] _erroringContract,
    uint256 _totalDaemonizedErrors);

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#

inflationSet#

Defined in FlareDaemon (Docs, Source).

modifier inflationSet()

As there is not a constructor, this modifier exists to make sure the inflation contract is set for methods that require it.

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.

onlyGovernance#

Defined in GovernedBase (Docs, Source).

modifier onlyGovernance()

onlyImmediateGovernance#

Defined in GovernedBase (Docs, Source).

modifier onlyImmediateGovernance()

onlyInflation#

Defined in FlareDaemon (Docs, Source).

modifier onlyInflation(    address _inflation)

Access control to protect methods to allow only minters to call select methods (like transferring balance out).

onlySystemTrigger#

Defined in FlareDaemon (Docs, Source).

modifier onlySystemTrigger()

Access control to protect trigger method. Please note that the sender address is the same as deployed FlareDaemon address in this case.

Structures#

DaemonizedError#

Defined in FlareDaemon (Docs, Source).

struct DaemonizedError {
  uint192 lastErrorBlock;
  uint64 numErrors;
  address fromContract;
  uint64 errorTypeIndex;
  string errorMessage;
}

LastErrorData#

Defined in FlareDaemon (Docs, Source).

struct LastErrorData {
  uint192 totalDaemonizedErrors;
  uint64 lastErrorTypeIndex;
}

Registration#

Defined in FlareDaemon (Docs, Source).

struct Registration {
  contract IFlareDaemonize daemonizedContract;
  uint256 gasLimit;
}

TimelockedCall#

Defined in GovernedBase (Docs, Source).

struct TimelockedCall {
  uint256 allowedAfterTimestamp;
  bytes encodedCall;
}

Variables#

blockHoldoff#

Defined in FlareDaemon (Docs, Source).

    uint256 blockHoldoff

errorData#

Defined in FlareDaemon (Docs, Source).

    struct FlareDaemon.LastErrorData errorData

governanceSettings#

Defined in GovernedBase (Docs, Source).

    contract IGovernanceSettings governanceSettings

Governance Settings.

inflation#

Defined in FlareDaemon (Docs, Source).

    contract IInflationGenesis inflation

lastMintRequestTs#

Defined in FlareDaemon (Docs, Source).

    uint256 lastMintRequestTs

lastUpdateMaxMintRequestTs#

Defined in FlareDaemon (Docs, Source).

    uint256 lastUpdateMaxMintRequestTs

maxMintingRequestWei#

Defined in FlareDaemon (Docs, Source).

    uint256 maxMintingRequestWei

productionMode#

Defined in GovernedBase (Docs, Source).

    bool productionMode

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

systemLastTriggeredAt#

Defined in FlareDaemon (Docs, Source).

    uint256 systemLastTriggeredAt

timelockedCalls#

Defined in GovernedBase (Docs, Source).

    mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls

List of pending timelocked governance calls.

totalMintingReceivedWei#

Defined in FlareDaemon (Docs, Source).

    uint256 totalMintingReceivedWei

totalMintingRequestedWei#

Defined in FlareDaemon (Docs, Source).

    uint256 totalMintingRequestedWei

totalMintingWithdrawnWei#

Defined in FlareDaemon (Docs, Source).

    uint256 totalMintingWithdrawnWei

totalSelfDestructReceivedWei#

Defined in FlareDaemon (Docs, Source).

    uint256 totalSelfDestructReceivedWei