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

uint256 checked for negative values.

Vulnerability Details

In DecentralizedStableCoin.sol, function burn() and mint() have uint256 _amount as their argument; but on line 47 and 61 _amount is being checked for zero and negative values even though uint cannot have negative values.

if (_amount <= 0) {

Impact

Even though very minor but it can cause higher gas fee for function execution since <= operation is more expensive as compared to ==

Recommendations

Check only for equality like so -

if (_amount == 0) {

Support

FAQs

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