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

Gas Optimization: Use != 0 instead of <= 0

Summary

Save gas by replacing <= 0 with '!=0' when using unsigned integers.

Vulnerability Details

In the DecentralizedStableCoin.sol mint and burn functions there are two if statements which check that _amount <= 0.

Replacing it with _amount != 0 Won't affect the logic since it's an unsigned integer and will save some gas for the users.

Impact

Save gas for the user anytime minting / burning DSC

Tools Used

VSCode

Support

FAQs

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