ChainlinkOracleProvider
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
Name | Type | Description |
---|---|---|
_sequencerUptimeFeed | AggregatorV3Interface | L2 Sequencer uptime feed |
_feed | AggregatorV3Interface | |
_maxStalePeriod | uint256 |
price
Get the price of the asset
function price() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | Price of the asset |
decimals
Get the decimals of the price
function decimals() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | Decimals 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();