Collateral cannot be decreased without debt
The function ShortRecordFacet#increaseCollateral permits users to augment their collateral. However, if the same individual attempts to reduce this collateral without having any associated debt, the operation fails. The issue originates from the line:
found in ShortRecordFacet#decreaseCollateral. This is due to the calculation in LibShortRecord#getCollateralRatio:
in LibShortRecord#getCollateralRatio
When short.ercDebt is zero, it results in a division by zero error.
Users are restricted from decreasing their collateral unless they have an associated debt.
Manual
To rectify this, modifications should be made to the ShortRecordFacet#decreaseCollateral function as follows:
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.