The KittyPool::purrgeBadPawsition
function in KittyPool.sol
is intended to liquidate the bad debt position of a user. However, there is a critical issue with the executeWhiskdrawal
call within the loop over vaults. The function currently attempts to withdraw collateral from the liquidator (caller of purrgeBadPawsition
) rather than from the user with the bad position. This misbehavior leads to incorrect asset transfers and a failure to properly liquidate the user's debt.
Since forced liquidations are not functioning, the protocol will continue to accumulate bad debt. Additionally, a user attempting to liquidate another's bad position risks wasting gas without success, or if they have sufficient cattynip, they will see their shares of various vaults spent as if they intended to withdraw.
Manual review.
The problem is quite extensive. I believe a solution which doesn't involve heavy refactoring should start from rewriting the problematic loop in purrgeBadPawsition
and the subsequent creation of a specific liquidation function in the vaults that avoids using executeWhiskdrawal
. This new function could take as arguments the address of the user to be liquidated, the address of the liquidator, redeemPercent
, and REWARD_PERCENT
. The new function should check how much cattynip
the user being liquidated has in the vault, burn the proper amount, and then send the collateral to the liquidator.
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.