Omniscia SaucerSwap Audit
TickMath Code Style Findings
TickMath Code Style Findings
TMH-01C: Redundantly Complex Conditional Clause
Type | Severity | Location |
---|---|---|
Gas Optimization | TickMath.sol:L71 |
Description:
The referenced conditional clause will evaluate and negate the final result as the last step.
Example:
contracts/libraries/TickMath.sol
71if (!(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO)) revert R();
Recommendation:
We advise the negation aspect to be assimilated to the conditional itself, inverting each segment of it (i.e. >=
would become <
, &&
would become ||
, and so on).
Alleviation (3248d1d2fdfa6e1e270ff27db8eefb13dcb55c40):
The SaucerSwap team evaluated this exhibit and opted to acknowledge it.