Skip to content

Commit

Permalink
Merge pull request #226 from Bananapus/fix/cantina59
Browse files Browse the repository at this point in the history
Cantina/59 - Sequencer feed invalid round & Fix test error
  • Loading branch information
mejango authored Jan 9, 2025
2 parents bca5818 + a3168c2 commit c8dca45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/JBChainlinkV3SequencerPriceFeed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ contract JBChainlinkV3SequencerPriceFeed is JBChainlinkV3PriceFeed {
error JBChainlinkV3SequencerPriceFeed_SequencerDownOrRestarting(
uint256 timestamp, uint256 gradePeriodTime, uint256 startedAt
);
error JBChainlinkV3SequencerPriceFeed_InvalidRound();

//*********************************************************************//
// ---------------- public stored immutable properties --------------- //
Expand Down Expand Up @@ -59,6 +60,9 @@ contract JBChainlinkV3SequencerPriceFeed is JBChainlinkV3PriceFeed {
// slither-disable-next-line unused-return
(, int256 answer, uint256 startedAt,,) = SEQUENCER_FEED.latestRoundData();

// Check if round is valid to prevent an edge-case where Arbitrum uptime contract is not init.
if (startedAt == 0) revert JBChainlinkV3SequencerPriceFeed_InvalidRound();

// Revert if sequencer has too recently restarted or is currently down.
if (block.timestamp <= GRACE_PERIOD_TIME + startedAt || answer == 1) {
revert JBChainlinkV3SequencerPriceFeed_SequencerDownOrRestarting(
Expand Down

0 comments on commit c8dca45

Please sign in to comment.