checkLiquidatableAccounts returns incomplete list of accounts for liqudations from provided bounds.
The checkLiquidatableAccounts function is used to retrieve a list of accounts that should be liquidated. It receives two parameters lowerBound and upperBound, so it should return accounts from the given range. But because of the condition in the for loop
it omits element in the last position ( accountsIds[upperBound] ).
Zaros implemented very similar method named "getAccountsWithActivePositions" (GlobalConfigurationBranch), where they calculate it correctly
Note the difference in comparison operator < vs <= (They also define different array size)
Protocol use this function to get a list of accounts to be liquidated. Omitting such an account means that the collateral will not be sufficient to cover the losses, resulting in protocol losses
Manual review
Use similar implementation as in getAccountsWithActivePositions
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.