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

Boolean equality

Summary

Boolean constants can be used directly and do not need to be compared to true or false.

Vulnerability Details

!minted is more concise and readable than minted != true. The !minted expression directly conveys the meaning "if not minted" or "if minted is false," which is much clearer than explicitly comparing minted to true. The latter form, minted != true, adds unnecessary complexity and verbosity to the code.

Impact

Code Readability

Tools Used

Manual code inspection

Recommendations

Change this:

if (minted != true) {
revert DSCEngine__MintFailed();
}

to:

if (!minted) {
revert DSCEngine__MintFailed();
}

Support

FAQs

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