@@ -42,7 +42,7 @@ contract UniswapHook is BaseHook {
42
42
currency0: Currency.wrap (asset0Addr),
43
43
currency1: Currency.wrap (asset1Addr),
44
44
fee: fee,
45
- tickSpacing: 60 , // TODO: fix arbitrary tick spacing
45
+ tickSpacing: 1 , // hard-coded tick spacing, as its unused
46
46
hooks: IHooks (address (this ))
47
47
});
48
48
@@ -90,7 +90,6 @@ contract UniswapHook is BaseHook {
90
90
91
91
// take the input token, from the PoolManager to the Euler vault
92
92
// the debt will be paid by the swapper via the swap router
93
- // TODO: can we optimize the transfer by pulling from PoolManager directly to Euler?
94
93
poolManager.take (params.zeroForOne ? key.currency0 : key.currency1, address (this ), amountIn);
95
94
amountInWithoutFee = FundsLib.depositAssets (evc, p, params.zeroForOne ? p.vault0 : p.vault1);
96
95
@@ -117,7 +116,22 @@ contract UniswapHook is BaseHook {
117
116
return (BaseHook.beforeSwap.selector , returnDelta, 0 );
118
117
}
119
118
120
- // TODO: fix salt mining & verification for the hook
121
- function getHookPermissions () public pure override returns (Hooks.Permissions memory ) {}
122
- function validateHookAddress (BaseHook) internal pure override {}
119
+ function getHookPermissions () public pure override returns (Hooks.Permissions memory ) {
120
+ return Hooks.Permissions ({
121
+ beforeInitialize: false ,
122
+ afterInitialize: false ,
123
+ beforeAddLiquidity: false ,
124
+ afterAddLiquidity: false ,
125
+ beforeRemoveLiquidity: false ,
126
+ afterRemoveLiquidity: false ,
127
+ beforeSwap: true ,
128
+ afterSwap: false ,
129
+ beforeDonate: false ,
130
+ afterDonate: false ,
131
+ beforeSwapReturnDelta: true ,
132
+ afterSwapReturnDelta: false ,
133
+ afterAddLiquidityReturnDelta: false ,
134
+ afterRemoveLiquidityReturnDelta: false
135
+ });
136
+ }
123
137
}
0 commit comments