DittoETH

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

`Require` or `custom errors` should be used insted of `assert`.

Vulnerability Details

It is dicouraged to use assert in production code as it's meant to be mainly used for testing and debugging. Per solidity doumentation Assert should only be used to test for internal errors, and to check invariants. Properly functioning code should never create a Panic, not even on invalid external input. If this happens, then there is a bug in your contract which you should fix..

The assert function creates an error of type Panic(uint256). The require function either creates an error without any data or an error of type Error(string).

Require should be used to ensure valid conditions that cannot be detected until execution time. This includes conditions on inputs or return values from calls to external contracts.

Tools used

VScode, Manual Review

Recommendations

Replace assert statements with require or custom errors.

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Gas optimizations

Support

FAQs

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