15,000 USDC
View results
Submission Details
Severity: medium
Valid

DSCEngine.liquidate doesn't allow to do liquidation when liquidator is under liquidation

Summary

DSCEngine.liquidate doesn't allow to do liquidation when liquidator is under liquidation. This doesn't make any sense, because the purpose of system is to make sure that all positions are backed.

Vulnerability Details

DSCEngine.liquidate can be called by anyone who wants to liquidate account. As result of liquidation liquidator will send stablecoin on behalf of account and will receive 10% bonus. So actually liquidator makes money in such way.

In the end of function there is a check that liquidator has good health factor. This check doesn't make any sense, because liquidator doesn't increase his s_DSCMinted balance and doesn't decrease his s_collateralDeposited balance.
Even if liquidator is same as account, then there is already a check that liquidation increased health factor.

As result liquidator, that is under liquidation is not allowed to do liquidation. However, there is no need for that and also liquidator can use this collateral that he received(with 10% bonus) to increase his health factor. Overall, i think that stablecoin is interested that liquidators under liquidations can liquidate, so they use earned bonus as collateral in the system.

Impact

Liquidators under liquidations can't liquidate and provide collateral.

Tools Used

VsCode

Recommendations

Remove check in the end.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.