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

Unnecessary check of zero amount in mint and burn functions of DecentralizedStableCoin.sol

Summary

The DecentralizedStableCoin::mint and DecentralizedStableCoin::burn functions are only callable by DSCEngine::mintDsc and DSCEngine::burnDsc functions respectively. Since these functions already check and revert if amount == 0 using moreThanZero modifier before making calls to DecentralizedStableCoin's functions, the lines mentioned in the above links can be removed in DecentralizedStableCoin::mint and DecentralizedStableCoin::burn to avoid rechecking amount<=0 and save some gas.

Support

FAQs

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