Closed c4-bot-10 closed 5 months ago
raymondfam marked the issue as insufficient quality report
raymondfam marked the issue as duplicate of #261
System parameters are settable by owner, and may change before launch.
hansfriese marked the issue as unsatisfactory: Insufficient proof
Lines of code
https://github.com/code-423n4/2024-03-dittoeth/blob/91faf46078bb6fe8ce9f55bcb717e5d2d302d22e/contracts/facets/PrimaryLiquidationFacet.sol#L47-L90
Vulnerability details
Impact
minShortErc
is set too low:minShortErc
is set too high:Description
The
minShortErc
parameter is used in thePrimaryLiquidationFacet.sol
contract'sliquidate
function to ensure that a ShortRecord has a minimum amount ofercDebt
to be eligible for liquidation.https://github.com/code-423n4/2024-03-dittoeth/blob/91faf46078bb6fe8ce9f55bcb717e5d2d302d22e/contracts/facets/PrimaryLiquidationFacet.sol#L47-L90
The LibSRUtil.checkCancelShortOrder is called to ensure that the ShortRecord's
ercDebt
is aboveminShortErc
and to cancel the associated short order if necessary.Vulnerability Details
minShortErc
parameter is not set appropriately.minShortErc
is set too low:ercDebt
remain unliquidated, allowing the debt to accumulate and potentially threatening the stability of the system.minShortErc
is set too high:ercDebt
below the high threshold may not be eligible for liquidation, even if they pose a risk to the system.Tools Used
Manual Review
Recommended Mitigation Steps
Consider introducing additional incentives or mechanisms to encourage liquidators to actively manage risky positions, even if the
ercDebt
is relatively low.The
minShortErc
parameter could be dynamically adjusted based on system conditions:the
adjustMinShortErc
allows the contract owner to dynamically update theminShortErc
parameter based on changing market conditions or system requirements.The
LibSRUtil.checkCancelShortOrder
function is responsible for ensuring that the ShortRecord'sercDebt
is aboveminShortErc
:By carefully setting and managing the
minShortErc
parameter, the system can ensure that liquidators are properly incentivized to liquidate risky debt and that the overall health and stability of the system are maintained.Assessed type
Governance