Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ChainlinkOracleProvider

Git Source

State Variables

GRACE_PERIOD_TIME

Grace period time after the sequencer is back up

uint256 private constant GRACE_PERIOD_TIME = 3600;

sequencerUptimeFeed

Chainlink feed for the sequencer uptime

AggregatorV3Interface public immutable sequencerUptimeFeed;

feed

Chainlink feed for the asset

AggregatorV3Interface public immutable feed;

maxStalePeriod

Maximum stale period for the price feed

uint256 public immutable maxStalePeriod;

Functions

constructor

Contract constructor

constructor(AggregatorV3Interface _sequencerUptimeFeed, AggregatorV3Interface _feed, uint256 _maxStalePeriod);

Parameters

NameTypeDescription
_sequencerUptimeFeedAggregatorV3InterfaceL2 Sequencer uptime feed
_feedAggregatorV3Interface
_maxStalePerioduint256

price

Get the price of the asset

function price() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Price of the asset

decimals

Get the decimals of the price

function decimals() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Decimals of the price

_validateSequencerStatus

Validate the sequencer status

function _validateSequencerStatus() internal view;

Errors

InvalidFeed

Error emitted when feed is invalid

error InvalidFeed();

InvalidStalePeriod

Error emitted when stale period is invalid

error InvalidStalePeriod();

StalePrice

Error emitted when price is stale

error StalePrice();

SequencerDown

Error emitted when sequencer is down

error SequencerDown();

GracePeriodNotOver

Error emitted when grace period is not over

error GracePeriodNotOver();