Skip to main content

FeeOracle

FeeOracle.sol is a supplementary contract responsible for the execution of the Performance Oracle report once consensus is reached in the HashConsensus.sol contract, namely, transforming non-distributed rewards into non-claimed rewards stored on the FeeDistributor.sol and reporting the latest root of the rewards distribution Merkle tree to the FeeDistributor.sol. Alongside rewards distribution, the contract manages strikes data delivery to ValidatorStrikes.sol. The contract inherits from BaseOracle.sol from Lido on Ethereum (LoE) core.

Upgradability

The contract uses OssifiableProxy for upgradability.

State Variables

INITIALIZED_VERSION

uint256 internal constant INITIALIZED_VERSION = 3

SUBMIT_DATA_ROLE

An ACL role granting the permission to submit the data for a committee report.

bytes32 public constant SUBMIT_DATA_ROLE = keccak256("SUBMIT_DATA_ROLE")

FEE_DISTRIBUTOR

IFeeDistributor public immutable FEE_DISTRIBUTOR

STRIKES

IValidatorStrikes public immutable STRIKES

__freeSlot1

bytes32 internal __freeSlot1

__freeSlot2

bytes32 internal __freeSlot2

Functions

constructor

constructor(address feeDistributor, address strikes, uint256 secondsPerSlot, uint256 genesisTime)
BaseOracle(secondsPerSlot, genesisTime);

initialize

Initialize contract from scratch. In case of a method call frontrun, the contract instance should be discarded. It is recommended to call this method in the same transaction as the deployment transaction and perform extensive deployment verification before using the contract instance.

function initialize(address admin, address consensusContract, uint256 consensusVersion) external;

finalizeUpgradeV3

This method is expected to be called only when the contract is upgraded from version 2 to version 3 for the existing version 2 deployment. If the version 3 contract is deployed from scratch, the initialize method should be used instead. To prevent possible frontrun this method should strictly be called in the same TX as the upgrade transaction and should not be called separately.

function finalizeUpgradeV3(uint256 consensusVersion) external;

submitReportData

Submit the data for a committee report

function submitReportData(ReportData calldata data, uint256 contractVersion) external whenResumed;

Parameters

NameTypeDescription
dataReportDataData for a committee report
contractVersionuint256Expected storage contract version of the FeeOracle implementation

_handleConsensusReport

Called in submitConsensusReport after a consensus is reached.

function _handleConsensusReport(
ConsensusReport memory,
/* report */
uint256,
/* prevSubmittedRefSlot */
uint256 /* prevProcessingRefSlot */
)
internal
override;

_handleConsensusReportData

function _handleConsensusReportData(ReportData calldata data) internal;

_checkMsgSenderIsAllowedToSubmitData

function _checkMsgSenderIsAllowedToSubmitData() internal view;

_onlyRecoverer

function _onlyRecoverer() internal view override;

__checkRole

function __checkRole(bytes32 role) internal view override;