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

Strict comparisons are more expensive than non-strict ones

Summary

The first two governance function from Lender.sol, setLenderFee and setBorrowerFee, check the input against hardcoded values

This check could be optimized by using non-strict comparison >= instead of strict comparison >.

Tools Used

Manual review

Recommendations

-if (_fee > 5000) revert FeeTooHigh();
+if (_fee >= 5001) revert FeeTooHigh();
-if (_fee > 500) revert FeeTooHigh()
+if (_fee >= 501) revert FeeTooHigh()

Support

FAQs

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

Give us feedback!