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

Amount checks for 0 in `DecentralizedStableCoin::mint and burn` for negative value is redundant

Description

In DecentralizedStableCoin::mint and burn the checks that amount is not 0 actually checks if it less or equal to zero.

if (_amount <= 0) {
revert DecentralizedStableCoin__MustBeMoreThanZero();

Since it can't less then zero because the amount is uint256 the proper way to check this is a simple != 0 check

Recommend Mitigation

Change the check from _amount <= 0 to _amount != 0

Support

FAQs

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