The giveLoan function does not check if loanIds and poolIds have the same length. This can lead to unexpected results.
Common practice in situations is to verify that the lengths are equal to ensure the user did not make a mistake.
The transaction will revert during _updatePoolBalance(poolId, pool.poolBalance - totalDebt); as pool.poolBalance - totalDebt would become negative and revert.
manual review
add
require(loanIds.length == poolIds.length, "mismatched array lengths");
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.