On success, the LendingPool::finalizeLiquidation function will emit a LiquidationFinalized event that Always returns 0 for its last input parameter collateralLiquidated, which is wrong.
Currently the LendingPool::finalizeLiquidation function emits the LiquidationFinalized event like this:
This is wrong because on lines 514 through 519 the finalizeLiquidation function already removes the information about the users NFTs, which is used to calculate the collateral value inside the getUserCollateralValue function:
this will make the collateralLiquidated parameter inside the event always be zero, since the information about the NFTs for the given user has been deleted already.
External applications depending on this value and using it will always get wrong data.
Impact: Low
Likelihood: Always
Manual Review
Calculate collateralLiquidated and store it as a variable before the NFT transfer loop and pass this variable as last parameter to the event
Add validation for the event args with .withArgs(owner.address, user1.address, userDebt, collateralLiquidated); inside the unit tests for this case
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.