Skip to content

Commit

Permalink
Move initialize event (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
hensha256 authored Oct 21, 2024
1 parent d9403bd commit 4aa6c3d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .forge-snapshots/initialize.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
51533
51532
2 changes: 1 addition & 1 deletion .forge-snapshots/poolManager bytecode size.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
23659
23694
5 changes: 3 additions & 2 deletions src/PoolManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,12 @@ contract PoolManager is IPoolManager, ProtocolFees, NoDelegateCall, ERC6909Claim

tick = _pools[id].initialize(sqrtPriceX96, lpFee);

key.hooks.afterInitialize(key, sqrtPriceX96, tick);

// event is emitted before the afterInitialize call to ensure events are always emitted in order
// emit all details of a pool key. poolkeys are not saved in storage and must always be provided by the caller
// the key's fee may be a static fee or a sentinel to denote a dynamic fee.
emit Initialize(id, key.currency0, key.currency1, key.fee, key.tickSpacing, key.hooks, sqrtPriceX96, tick);

key.hooks.afterInitialize(key, sqrtPriceX96, tick);
}

/// @inheritdoc IPoolManager
Expand Down

0 comments on commit 4aa6c3d

Please sign in to comment.