Omniscia SaucerSwap Audit

Oracle Static Analysis Findings

Oracle Static Analysis Findings

OEL-01S: Tautological Comparison

Description:

The referenced if statements will evaluate whether an unsigned integer is less-than-or-equal-to zero.

Example:

contracts/libraries/Oracle.sol
317function observe(
318 Observation[65535] storage self,
319 uint32 time,
320 uint32[] memory secondsAgos,
321 int24 tick,
322 uint16 index,
323 uint128 liquidity,
324 uint16 cardinality
325) public view returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) {
326 unchecked {
327 if (cardinality <= 0) revert I();

Recommendation:

We advise them to be converted to equality operators as an unsigned integer cannot be negative (i.e. less-than zero).

Alleviation (3248d1d2fd):

Only the latter of the two referenced tautological comparisons has been corrected, rendering this exhibit partially alleviated.

Alleviation (5809242f0b):

The first referenced tautological comparison has been corrected as well, rendering this exhibit fully alleviated.