The above code repays other lenders, but it lacks notice the lender If the lender is a LoanManager, notify it to accounting using ILoanManager(tranche.lender).loanRepayment() like in MultiSourceLoan or LiquidationDistributor.
It's crucial to notify the LoanManager for accounting.
Failure to do so will result in an incorrect allocation of repaid assets to the correct WithdrawalQueue.
Impact
The lack of notification to the LoanManager for accounting will result in incorrect asset allocation.
Lines of code
https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/AuctionWithBuyoutLoanLiquidator.sol#L83-L94
Vulnerability details
Vulnerability details
in
AuctionWithBuyoutLoanLiquidator
Thelender
who has lent out the most can purchase the NFT throughsettleWithBuyout()
The above code repays other lenders, but it lacks notice the lender If the
lender
is aLoanManager
, notify it to accounting usingILoanManager(tranche.lender).loanRepayment()
like inMultiSourceLoan
orLiquidationDistributor
.It's crucial to notify the
LoanManager
for accounting. Failure to do so will result in an incorrect allocation of repaid assets to the correctWithdrawalQueue
.Impact
The lack of notification to the
LoanManager
for accounting will result in incorrect asset allocation.Recommended Mitigation
suggest:
getLoanManagerRegistry
to contractloanRepayment()
insettleWithBuyout()
Assessed type
Context