The if statement that validates the pool from the Lender contract should be broken up into multiple smaller if statements, each with a revert + custom error.
Smaller if statements with clear conditions and custom errors make the code more readable and understandable.
Each condition becomes self-explanatory, making it easier for developers to follow the logic.
When an error occurs, it is easier to pinpoint the specific condition that caused the revert.
Smaller if statements can result in better gas optimization. If one condition fails early in the function, the rest of the conditions don't need to be checked, saving gas costs.
Manual review
Rewrite the if statement as follows:
Define the new custom errors in Errors.sol
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.