Submitted by bin2chen
The LiquidationDistributor is used to distribute funds after an auction. When the auction amount is insufficient, lenders are repaid in sequence.
The code snippet above introduces a condition _proceeds > 0 to terminate the loop when theres no remaining balance in _proceeds, thereby preventing further execution of _handleTrancheInsufficient().
However, this approach creates an issue. If the subsequent lender is a LoanManager, it wont be notified for accounting via _handleTrancheInsufficient() -> _handleLoanManagerCall() -> LoanManager(_tranche.lender).loanLiquidation().
Although no funds can be repaid, accounting is still necessary to notice and prevent incorrect accounting, causing inaccuracies in totalAssets() and continued accumulation of interest.
This outstanding debt should be shared among current users and prevent it from persisting as bad debt.
Failure to notify LoanManager.loanLiquidation() may result in accounting inaccuracies.
Context
0xend (Gondi) confirmed
Gondi mitigated:
Status: Mitigation confirmed. Full details in reports from oakcobalt, minhquanym and bin2chen.
