Skip to content

Commit

Permalink
L02 Sequencer checks (#59)
Browse files Browse the repository at this point in the history
* add roundId and updatedAt checks

* Add code comment
  • Loading branch information
pi0neerpat authored Apr 20, 2024
1 parent f248fb4 commit 453222d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/contracts/oracles/DataConsumerSequencerCheck.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ contract DataConsumerSequencerCheck {
function getSequencerFeedValidation() public view returns (bool) {
(uint256 _roundId, int256 _answer, uint256 _startedAt, uint256 _updatedAt, uint256 _answeredInRound) =
SEQUENCER_UPTIME_FEED.latestRoundData();
if (_answeredInRound < _roundId) return false;
// If the answer is 1, the sequencer is down
if (_answer != 0) return false;
if (_updatedAt == 0) return false;

uint256 timeSinceOnline = block.timestamp - _startedAt;
if (timeSinceOnline < GRACE_PERIOD) return false;
Expand Down

0 comments on commit 453222d

Please sign in to comment.