DittoETH

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

LibOracle::baseOracleCircuitBreaker() - Error in the Ditto docs regarding oracle price update.

Summary

QA/LOW: LibOracle::baseOracleCircuitBreaker() - Error in the Ditto docs regarding oracle price update.

The docs specifically on the following link (https://dittoeth.com/technical/oracles) is using an incorrect mathematical logic representation of the idea of "stale Data: Chainlink has not updated a round in over 2 hours".

To find the line with the error in the docs, search under the following:
"timeStamp > block.timestamp + 2 hours"

Vulnerability Details

From docs/above link:
"timeStamp > block.timestamp + 2 hours (stale Data: Chainlink has not updated a round in over 2 hours)"

INCORRECT:
timeStamp > block.timestamp + 2 hours

CORRECTED:
timeStamp < block.timestamp - 2 hours
i.e. block.timestamp > 2 hours + timeStamp

NOTE: It is correctly implemented in the codebase though, as per the github link for L73.

Impact

  • QA/low impact.

  • Correctly implemented in the codebase as far as I could see.

  • But the docs need to mirror the codebase implementation and vice versa.

  • If this was a reference in the docs for developers from other protocols to guide them in building on top of this protocol(as an example), this error could result in a bad implementation if the dev wasn't careful.

Tools Used

VSC + docs + attention to detail/logic...

Recommendations

Triple gazillion check the maths & logic, but especially the logic between implementation & docs...
But good to see that it was correctly implemented by the dev(s) in the codebase even though in the docs it's completely wrong.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other
0xscsamurai Submitter
over 1 year ago
0xnevi Lead Judge
over 1 year ago
0xscsamurai Submitter
over 1 year ago
0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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