In the main contract we have multiple functions, which are intended to be invoked "only by the lender". The same code check is duplicated multiple times.
We have 4 functions with same code check whether msg.sender is the lender of the pool. This is redundant since we have "modifiers", which could make the code cleaner, shorter and more gas efficient for deployment.
There are some other functions, which are making checks whether each element inside an array meets a condition. We should be careful with refactoring those conditions.
Redundant code repetition.
Manual Review
Where there are no loops create a modifier and use it for those functions:
Consider doing the same for some other duplicated checks such as if (amount == 0) revert PoolConfig();
For duplicated checks inside the loops. We can extract those in modifiers too and iterate the array and do the checks. However, this may not be the best solution, because if all checks pass, we will iterate the same array two times, which would be more gas inefficient, so we may want to leave it that way, or extract a helper function, which will only do the check and revert and we will call it inside the for loops.
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.