The withdrawNFT
functions have incorrect calculations in the if
condition for collateral.
withdrawNFT function :-
In this function, userDebt.percentMul(liquidationThreshold)
is compared to collateralValue - nftValue
, which is incorrect.
By withdrawing the NFT, the collateral value decreases. The debt should be lower than liquidationThreshold
% of the new collateral value after withdrawing the NFT.
lets take an example
liquidationThreshold = 80 %
collateralValue
= 100
userDebt
=70
Initially, the user has enough collateral for the debt.
Now follow the calculation for , nftValue
=40
collateralValue - nftValue
=60 anduserDebt.percentMul(liquidationThreshold))
=80% *70 =56
the new colletral amount = 60 , and the debt amount is userDebt
=70
60 < 56 will be false
, but the user has 70 debt and colletral = 60 , it should be UnderCollateralized
.
The user cannot fully utilize the collateral value because userDebt.percentMul(liquidationThreshold)
will be much lower than the actual liquidationThreshold
of the collateral value.
The value of debt will be greater than the liquidationThreshold
, which is incorrect.
withdrawNFT function :-
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.