Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TWAMM.sol #62

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/hooks/examples/TWAMM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,10 @@ contract TWAMM is BaseHook, ITWAMM {
}

struct TickCrossingParams {
int24 initializedTick;
uint256 nextTimestamp;
uint256 secondsElapsedX96;
PoolParamsOnExecute pool;
int24 initializedTick;
}

function _advanceTimeThroughTickCrossing(
Expand Down Expand Up @@ -623,7 +623,7 @@ contract TWAMM is BaseHook, ITWAMM {
nextTickInit = pool.sqrtPriceX96.getTickAtSqrtPrice();
int24 targetTick = nextSqrtPriceX96.getTickAtSqrtPrice();
bool searchingLeft = nextSqrtPriceX96 < pool.sqrtPriceX96;
bool nextTickInitFurtherThanTarget = false; // initialize as false
bool nextTickInitFurtherThanTarget; // initialize as false

// nextTickInit returns the furthest tick within one word if no tick within that word is initialized
// so we must keep iterating if we haven't reached a tick further than our target tick
Expand Down