Focusing on the for
loop here, for gas optimization.
Using for loop without any max array length limitations/bounds, and not optimized for gas either.
Revert on running out of gas during for loop iteration if array is too large. DoS of seizeLoan call.
VSC, manual.
function seizeLoan(uint256[] calldata loanIds) public {
uint256 loanIdsLength = loanIds.length;
for (uint256 i; i < loanIdsLength; ) {
//...
// for loop logic
//...
unchecked {i++;}
}
}
Additionally, same applies to the refinance() function:
https://github.com/Cyfrin/2023-07-beedle/blob/d9718f2ca6521756624c017c90f3d4d4e80da90c/src/Lender.sol#L591
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.