Omniscia vfat Audit
PositionSettingsRegistry Manual Review Findings
PositionSettingsRegistry Manual Review Findings
PSR-01M: Improper Validation of Slippage Value
Type | Severity | Location |
---|---|---|
Input Sanitization | ![]() | PositionSettingsRegistry.sol:L208 |
Description:
The referenced slippage value defined in basis points is insufficiently validated as it is permitted to be 0
.
Impact:
A slippage value of 0
is effectively invalid as the likelihood of the associated operation reverting is significantly high.
Example:
195if (settings.autoExit) {196 if (197 settings.exitConfig.triggerPriceLow == 0198 && settings.exitConfig.triggerPriceHigh == 0199 ) {200 revert ExitTriggersNotSet();201 }202 if (203 settings.exitConfig.triggerPriceLow204 >= settings.exitConfig.triggerPriceHigh205 ) {206 revert InvalidExitTriggers();207 }208 if (settings.exitConfig.slippageBP > MAX_SLIPPAGE_BP) {209 revert InvalidSlippageBP();210 }211 if (212 settings.exitConfig.priceImpactBP > MAX_PRICE_IMPACT_BP213 || settings.exitConfig.priceImpactBP == 0214 ) {215 revert InvalidPriceImpactBP();216 }217} else {218 if (219 settings.exitConfig.triggerPriceLow != 0220 || settings.exitConfig.triggerPriceHigh != 0221 || settings.exitConfig.exitTokenOutLow != address(0)222 || settings.exitConfig.exitTokenOutHigh != address(0)223 || settings.exitConfig.slippageBP != 0224 || settings.exitConfig.priceImpactBP != 0225 ) {226 revert NonZeroExitConfig();227 }228}
Recommendation:
Similarly to other configurational variables, we advise it to be sanitized as being non-zero so as to ensure a valid slippage configuration value.
Alleviation (6ab7af3bb495b817ffec469255ea679b1813eecb):
The vfat team evaluated this exhibit and stated that a zero-value slippage is desirable.
While the code will behave as expected when the zero-value slippage is imposed, the dynamic conditions of the market will significantly increase the likelihood of such a transaction reverting and would usually indicate malformed input.
In any case, as the vfat team wishes to retain this behaviour as acceptable within their codebase we consider this exhibit to be acknowledged.