No equality check for the length of the provided parameters in the function giveLoan
In giveLoan
function, We have to provide two arrays as a parameter. And both of these arrays are used in the calculations parallelly. For example:
In the above provided code from giveLoan
function, The loanIds[i] depends on poolIds[i] which is going to be the same index of the array. That means both array should have equal number of values. The check for that is not done in the beginnig. Also check for loanId
and poolIds
length != zero is also not done.
When passed the different length arrays as a value, the loop in going to work upto some index but after that it is going to revert as the checks are done in the function stating whether lender in pool is equal to lender in loan and some other checks.
Foundry test. Manual inspection
Try checking for the length of the array in the begging of the function like this:
Check for length not equal to zero should also be done.
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.