Cyfrin / 2023-07-foundry-defi-stablecoin

37 stars 32 forks source link

Use == for uints check instead of <= 0 #1126

Open codehawks-bot opened 1 year ago

codehawks-bot commented 1 year ago

Use == for uints check instead of <= 0

Severity

Gas Optimization / Informational

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DecentralizedStableCoin.sol

Summary

Use == for uints check instead of <= 0

Vulnerability Details


48: if (_amount <= 0) {

61: if (_amount <= 0) {

Link to code - https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/tree/main/src/DecentralizedStableCoin.sol

Tools Used

Code Review using VSCode

Recommendations

Update the code to: if (_amount == 0) {