fixUser()
only fully liquidates and ignores Close Factor.
Moonwell is a fork of Compound. In Compound liquidations are done in a partial way to only pay a certain amount of their debt, this is called a Close Factor.
Compound docs on Close Factor: https://docs.compound.finance/v2/comptroller/#close-factor
In Moonwell this is implemented in Comptroller.sol
example of Close Factor being used is in liquidateBorrowAllowed()
function.
However fixUser()
does not take Close Factor into account and fully liquidates the users with bad debt(Users that have a shortfall).
Close Factor is completely ignored in fixUser()
causing all the users with bad debt to get fully liquidated instead of having a part of their debt paid that will bring them in a healthy position and remove their shortfall. This is problematic since this function is intended to be used when it is needed after the upgrade.
Manual review.
Make calls to Comptroller.sol
to calculate a users closeFactor
to calculate the amount of debt that should be paid and use this in fixUsers()
function instead of fully liquidating all users.
closeFactor
can be calculated for each user with
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.