diff --git a/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_forEntireWord.snap b/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_forEntireWord.snap index 8c4154af0..0203089ec 100644 --- a/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_forEntireWord.snap +++ b/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_forEntireWord.snap @@ -1 +1 @@ -2497 \ No newline at end of file +2488 \ No newline at end of file diff --git a/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_justBelowBoundary.snap b/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_justBelowBoundary.snap index 8c4154af0..0203089ec 100644 --- a/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_justBelowBoundary.snap +++ b/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_justBelowBoundary.snap @@ -1 +1 @@ -2497 \ No newline at end of file +2488 \ No newline at end of file diff --git a/.forge-snapshots/poolManager bytecode size.snap b/.forge-snapshots/poolManager bytecode size.snap index 2963904ef..a55204ffc 100644 --- a/.forge-snapshots/poolManager bytecode size.snap +++ b/.forge-snapshots/poolManager bytecode size.snap @@ -1 +1 @@ -23663 \ No newline at end of file +23656 \ No newline at end of file diff --git a/.forge-snapshots/swap burn 6909 for input.snap b/.forge-snapshots/swap burn 6909 for input.snap index e4f3d2c9f..ae30e1b74 100644 --- a/.forge-snapshots/swap burn 6909 for input.snap +++ b/.forge-snapshots/swap burn 6909 for input.snap @@ -1 +1 @@ -137058 \ No newline at end of file +137049 \ No newline at end of file diff --git a/.forge-snapshots/swap mint native output as 6909.snap b/.forge-snapshots/swap mint native output as 6909.snap index 7b59de3e7..0848e650e 100644 --- a/.forge-snapshots/swap mint native output as 6909.snap +++ b/.forge-snapshots/swap mint native output as 6909.snap @@ -1 +1 @@ -148304 \ No newline at end of file +148295 \ No newline at end of file diff --git a/src/libraries/TickBitmap.sol b/src/libraries/TickBitmap.sol index 381c5179d..6cdde14be 100644 --- a/src/libraries/TickBitmap.sol +++ b/src/libraries/TickBitmap.sol @@ -82,7 +82,7 @@ library TickBitmap { : (compressed - int24(uint24(bitPos))) * tickSpacing; } else { // start from the word of the next tick, since the current tick state doesn't matter - (int16 wordPos, uint8 bitPos) = position(compressed + 1); + (int16 wordPos, uint8 bitPos) = position(++compressed); // all the 1s at or to the left of the bitPos uint256 mask = ~((1 << bitPos) - 1); uint256 masked = self[wordPos] & mask; @@ -91,8 +91,8 @@ library TickBitmap { initialized = masked != 0; // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick next = initialized - ? (compressed + 1 + int24(uint24(BitMath.leastSignificantBit(masked) - bitPos))) * tickSpacing - : (compressed + 1 + int24(uint24(type(uint8).max - bitPos))) * tickSpacing; + ? (compressed + int24(uint24(BitMath.leastSignificantBit(masked) - bitPos))) * tickSpacing + : (compressed + int24(uint24(type(uint8).max - bitPos))) * tickSpacing; } } }