Skip to content

Commit

Permalink
Merge pull request #246 from gnoswap-labs/GSW-659-handle-tick-bitmap-…
Browse files Browse the repository at this point in the history
…large-number

fix: Handle tick bitmap large number
  • Loading branch information
jinoosss authored Dec 11, 2023
2 parents e262f61 + 4dfc5f4 commit c67219c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/swap-router/src/swap-simulator/utility/tick.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function nextInitializedTickWithinOneWord(
if (isTickToLeft) {
const { wordPos, bitPos } = tickBitmapPosition(compressed);
const mask = (1n << BigInt(bitPos)) - 1n + (1n << BigInt(bitPos));
const bitmap = BigInt(tickBitmaps[wordPos] || 0n);
const bitmap = BigInt(Number(tickBitmaps[wordPos]) || 0n);
const masked = bitmap & mask;

const initialized = masked !== 0n;
Expand All @@ -114,7 +114,7 @@ export function nextInitializedTickWithinOneWord(

const { wordPos, bitPos } = tickBitmapPosition(compressed + 1);
const mask = ~((1n << BigInt(bitPos)) - 1n);
const bitmap = BigInt(tickBitmaps[wordPos] || 0n);
const bitmap = BigInt(Number(tickBitmaps[wordPos]) || 0n);
const masked = bitmap & mask;

const initialized = masked !== 0n;
Expand Down

0 comments on commit c67219c

Please sign in to comment.