Skip to content

Commit 4694594

Browse files
committed
base hook revert beforeInitialize
1 parent a268b65 commit 4694594

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

src/UniswapHook.sol

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ contract UniswapHook is BaseHook {
2727

2828
PoolKey internal _poolKey;
2929

30-
error AlreadyInitialized();
3130
error NativeConcentratedLiquidityUnsupported();
3231
error LockedHook();
3332

@@ -143,15 +142,6 @@ contract UniswapHook is BaseHook {
143142
return (BaseHook.beforeSwap.selector, returnDelta, 0);
144143
}
145144

146-
/// @dev Each deployed hook only services one pair and prevent subsequent initializations
147-
function _beforeInitialize(address, PoolKey calldata, uint160) internal view override returns (bytes4) {
148-
// when the hook is deployed for the first time, the internal _poolKey is empty
149-
// upon activation, the internal _poolKey is initialized and set
150-
// once the hook contract is activated, do not allow subsequent initializations
151-
require(_poolKey.tickSpacing == 0, AlreadyInitialized());
152-
return BaseHook.beforeInitialize.selector;
153-
}
154-
155145
function _beforeAddLiquidity(address, PoolKey calldata, IPoolManager.ModifyLiquidityParams calldata, bytes calldata)
156146
internal
157147
pure

test/HookSwaps.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ contract HookSwapsTest is EulerSwapTestBase {
190190
CustomRevert.WrappedError.selector,
191191
address(eulerSwap),
192192
IHooks.beforeInitialize.selector,
193-
abi.encodeWithSelector(UniswapHook.AlreadyInitialized.selector),
193+
abi.encodeWithSelector(BaseHook.HookNotImplemented.selector),
194194
abi.encodeWithSelector(Hooks.HookCallFailed.selector)
195195
)
196196
);

0 commit comments

Comments
 (0)