15,000 USDC
View results
Submission Details
Severity: high

Lack of Liquidation Mechanism When Peg is Lost

Summary

The DSCEngine.sol contract does not have a mechanism to liquidate all assets when the peg is lost — that is, when the total reserves are less than the total DSC minted. A function to liquidate assets in this scenario could protect the remaining funds.

Vulnerability Details

There's currently no function to liquidate all assets when the peg is lost, potentially leading to further loss of funds.

Impact

The absence of a liquidation function when the peg is lost may exacerbate the loss of funds, reducing the safety and integrity of the contract.

Recommendations

Introduce a function that liquidates all assets when the peg is lost. Here is a potential code snippet:

function liquidateAll() external onlyOwner {
require(isPegLost(), "Peg is not lost.");
// Liquidate all assets. This will be specific to your implementation.
}

Implement secure access control, conduct thorough testing and auditing, and ensure that the function emits an event upon successful liquidation.

Support

FAQs

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