DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: low
Valid

Some check needs to be regulated

Summary

Some check needs to be regulated

Vulnerability Details

https://github.com/Cyfrin/2023-09-ditto/blob/a93b4276420a092913f43169a353a6198d3c21b9/contracts/facets/ShortOrdersFacet.sol#L46-L48

1.this needs to be: Asset.initialMargin > initialCR || cr > Constants.CRATIO_MAX
because the cr it should be possible to be the maximum value;

2.this needs to be: value >= 100
because the error said it will be below 100, but if you set it to 100 it will revert too

3.this needs to be: LibAsset.initialMargin(asset) <= Constants.CRATIO_MAX
because the initial margin should be able to be equal to collateral ration max

Impact

wrong check

Tools Used

manual

Recommendations

fix the check that I write

Updates

Lead Judging Commences

0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-326

Support

FAQs

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