The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: medium
Invalid

No check if L2 sequencer is down in Chainlink feeds could result in reward loss for stakers

Summary

In README of the protocol are given addresses of ChainLink feeds, which are deployed on Arbitrum One chain. Also there is

Blockchains:
- Any EVM chains with live Chainlink data feeds and live Uniswap pools

which means that we should for sure consider L2 chains as Arbitrum One.

Using Chainlink in L2 chains such as Arbitrum requires to check if the sequencer is down to avoid prices from looking like they are fresh although they are not.

Vulnerability Details

priceEurUsd & assetPriceUsd don't check if the sequencer is down

Impact

  • Potential funds loss for stakers

Tools Used

Manual review

Recommendations

It is advisable to follow chanlink's official doc and handling:
https://docs.chain.link/data-feeds/l2-sequencer-feeds#example-code

Example:

constructor() {
dataFeed = AggregatorV2V3Interface(
0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612
);
sequencerUptimeFeed = AggregatorV2V3Interface(
0xFdB631F5EE196F0ed6FAa767959853A9F217697D
);
}
// Check the sequencer status and return the latest data
function getChainlinkDataFeedLatestAnswer() public view returns (int) {
// prettier-ignore
(
/*uint80 roundID*/,
int256 answer,
uint256 startedAt,
/*uint256 updatedAt*/,
/*uint80 answeredInRound*/
) = sequencerUptimeFeed.latestRoundData();
// Answer == 0: Sequencer is up
// Answer == 1: Sequencer is down
bool isSequencerUp = answer == 0;
if (!isSequencerUp) {
revert SequencerDown();
}
// Make sure the grace period has passed after the
// sequencer is back up.
uint256 timeSinceUp = block.timestamp - startedAt;
if (timeSinceUp <= GRACE_PERIOD_TIME) {
revert GracePeriodNotOver();
}
// prettier-ignore
(
/*uint80 roundID*/,
int data,
/*uint startedAt*/,
/*uint timeStamp*/,
/*uint80 answeredInRound*/
) = dataFeed.latestRoundData();
return data;
}
Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Arbitrum-sequncer

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

Arbitrum-sequncer

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.