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

Move the Duplicate Checks into a Modifier

Summary

The functions addToPool(), removeFromPool(), updateMaxLoanRatio(), and updateInterestRate() contain repeated checks to
verify if the caller is the poolId lender. These checks can be extracted into a modifier that takes an address as an
input parameter. By doing this, the code can benefit from improved code reusability, readability, and easier
maintenance.

Vulnerability Details

There is no vulnerability in the code. However, the current implementation lacks readability.

Impact

The current implementation of the code lacks readability, making it harder to maintain.

Tools Used

Manual Inspection

Recommendations]

Extract the duplicated checks into a separate modifier. Doing so will enhance code readability and promote better code
maintenance. By reusing the modifier, you can avoid redundancy and improve the overall structure of the contract.

Support

FAQs

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