DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: medium
Invalid

Price oracle could get a stale price

Summary

In LibOracle.sol, it doesn't check for the stale price by updateAt and roundId.

Vulnerability Details

LibOracle.getOraclePrice() will get baseAnswer from Chainlink oracle. But it doesn't check round id and timestamp, leading to it may get a stale price from Chainlink oracle.

Impact

Price oracle could get a stale price without checking roundId.

Tools Used

Vscode

Recommendations

Check answer, updateAt and roundId when getting price:

(uint80 roundId, int256 answer, , uint256 updatedAt, uint80 answeredInRound) = oracle.latestRoundData();
require(updatedAt > 0, "Round is not complete");
require(answer >= 0, "Malfunction");
require(answeredInRound >= roundID, "Stale price");
Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Chainlink round completeness

Support

FAQs

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