The protocol has a maximum collateral ratio (CR) set for shorts, which is enforced in two different places within the codebase: createLimitShort
and increaseCollateral
functions. However, there is a discrepancy in the implementation. The code checks whether the CR is greater than or equal to (≥
) the maximum allowed value, thus preventing users from ever reaching the exact maximum CR value.
The use of the ≥
operator instead of the >
operator when comparing the CR with the Constants.CRATIO_MAX
prevents users from setting a CR that is exactly equal to the maximum allowable CR, limiting them to values strictly less than the maximum.
The impact of this issue is relatively low, as it primarily affects the flexibility users have in setting the CR for their shorts.
Manual Analysis
Update the condition to use the >
operator instead of ≥
, allowing users to set a CR exactly equal to Constants.CRATIO_MAX
.
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.