Take a look at https://github.com/Cyfrin/2024-07-zaros/blob/d687fe96bb7ace8652778797052a38763fbcbb1b/src/external/chainlink/ChainlinkUtil.sol#L26-L77
This function is used to query the provided Chainlink Price Feed for the margin collateral oracle price, and it's been done in a try/catch format in order to better bubble up the errors/failures, issue however is that not all error cases are being checked against.
This is because protocol currently assumes that the minAnswer(), maxAnswer() functionality is always going to lead to valid returns.
However not all feeds support this, which would then mean that even if the feed is a valid one and the call to priceFeed.latestRoundData()
does not fail, when checking for the min/maxAnswer
this query could fail if not supported, however this price should be ingested in as much as it is not stale, but due to current implementation the whole attempt reverts.
Likelihood is medium, considering not all feeds support the min/maxAnswer, however impact is high cause this functionality is queried when tryig to get the margin collateral oracle price which is needed in core areas of the protocol.
Manual review
Consider also wrapping the min/maxAnswer queries in a try/catch a
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.