The ChainlinkOracle
contract does not validate the price data retrieved from Chainlink oracles against predefined minimum and maximum price thresholds. This oversight can result in the use of incorrect values if, during volatile market conditions or unexpected events, an asset’s price falls below the minimum threshold of the price feed.
The following code in ChainlinkOracle
contract use ETH/USD feed of Chainlink in Optimism
And the following code is used to set ETH/USD oracle
In Optimism chain, the ETH/USD oracle and its aggregator, which returns a minimum answer (1000000000) and a maximum answer (100000000000000).
However, the code lacks a check to ensure that the returned answer falls within the range defined by the minimum and maximum values.
The code may operate using prices that do not accurately reflect current market values, potentially leading to financial losses for users during the process of adding liquidity or removing liquidity of ETH token in a pool.
Manual Review
Implement validation checks for minAnswer
and maxAnswer
when using Chainlink ETH/USD oracle in Optimism. Transactions should be restricted if the reported price hits these thresholds.
LightChaser: ## [Low-25] Chainlink answer is not compared against min/max values
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.