Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: low
Invalid

Opposition of NatSpec

## Summary
Opposition of a struct variable by check in `MarketMakingEngineConfigurationBranch::configureMarket`
## Vulnerability Details
`MarketMakingEngineConfigurationBranch::configureMarket` configures market on market making engine setting
`autoDeleverageStartThreshold`, `autoDeleverageEndThreshold` and some other variables. According to the NatSpec of
`Market::Data`:
1. /// @param autoDeleverageStartThreshold An admin configurable decimal rate used to determine the starting threshold of the
ADL polynomial regression curve, ranging from 0 to 1.
2. /// @param autoDeleverageEndThreshold An admin configurable decimal rate used to determine the ending threshold of the ADL
polynomial regression curve, ranging from 0 to 1.
However, the checks(stated below) in `MarketMakingEngineConfigurationBranch::configureMarket` does not allow
`autoDeleverageStartThreshold` and `autoDeleverageEndThreshold` to be zero(0) opposing the NatSpec of the two variables.
1. `if (autoDeleverageStartThreshold == 0) revert Errors.ZeroInput("autoDeleverageStartThreshold");`
2. `if (autoDeleverageEndThreshold == 0) revert Errors.ZeroInput("autoDeleverageEndThreshold");`
## Impact
The range of `autoDeleverageStartThreshold` and `autoDeleverageEndThreshold` will never start from zero(0).
## Recommendations
Enforce check to avoid both variables greater than 1.
```diff
- `if (autoDeleverageStartThreshold == 0) revert Errors.ZeroInput("autoDeleverageStartThreshold");`
+ `if (autoDeleverageStartThreshold > 1) revert Errors.ZeroInput("autoDeleverageStartThreshold");`
- `if (autoDeleverageEndThreshold == 0) revert Errors.ZeroInput("autoDeleverageEndThreshold");`
+ `if (autoDeleverageEndThreshold > 1) revert Errors.ZeroInput("autoDeleverageEndThreshold");`
```
Updates

Lead Judging Commences

inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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