15,000 USDC
View results
Submission Details
Severity: gas
Valid

Can save gas we by changing less or equal to just equal

Summary

Can save gas we change less or equal to just equal.

Vulnerability Details

A <= 0 check is done on a uint, which can not be negative. We can save gas if we just do an equality check

Impact

== 0 costs less gas than <= 0

Tools Used

Manual review

Recommendations

Change this:

if (_amount <= 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}

To this:

if (_amount == 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();
}

Support

FAQs

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