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

Use == instead of <= to save gas

Summary

Use == instead of <= to save gas in the mint and burn function.

Vulnerability Details

The mint and burn functions check for _amount <= 0 . However, the variable _amount is already uint , so it can never be negative. So, checking for _amount == 0 is equivalent to checking _amount <= 0 but with cheaper gas.

Impact

More gas used unnecessarily.

Tools Used

Manual Review

Recommendations

  • Use == instead of <= check.

Support

FAQs

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