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

Uint cannot be less than 0

Summary

Uint cannot be less than zero

Vulnerability Details

As unsigned integers cannot be less than zero, _amount <= 0 uses an additional unnecessary operation and consumes more gas.

Impact

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/d1c5501aa79320ca0aeaa73f47f0dbc88c7b77e2/src/DecentralizedStableCoin.sol#L61

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/d1c5501aa79320ca0aeaa73f47f0dbc88c7b77e2/src/DecentralizedStableCoin.sol#L48

Tools Used

Manual review

Recommendations

Consider using if (_amount = 0) ...

Support

FAQs

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