Submitted by pkqs90, also found by 0xAlix2
https://github.com/code-423n4/2024-10-loopfi/blob/main/src/CDPVault.sol#L702 
https://github.com/code-423n4/2024-10-loopfi/blob/main/src/PoolV3.sol#L593
When liquidating bad debt, the profit and loss is not correctly handled. This will cause incorrect accounting to lpETH stakers.
Note: This is based on the 2024-07 Loopfi audit H-12 issue. This protocol team applied a fix, but the fix is incomplete.
There are two issues that needs to be fixed in the new codebase:
The second fix was also suggested in the original issue, but it isnt applied.
CDPVault.sol:
PoolV3.sol:
In CDPVault, change to pool.repayCreditAccount(debtData.debt, debtData.accruedInterest, loss).
In PoolV3:
0xtj24 (LoopFi) confirmed
Koolex (judge) commented:
pkqs90 (warden) commented:
Koolex (judge) commented:
pkqs90 (warden) commented:
