From b7408c3b89e85fb64513410b8fad048990f14541 Mon Sep 17 00:00:00 2001 From: guzus Date: Sat, 16 Nov 2024 22:00:03 +0700 Subject: [PATCH] fix: compile err --- packages/foundry/src/EtfHook.sol | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/foundry/src/EtfHook.sol b/packages/foundry/src/EtfHook.sol index bb9a5bd..693464b 100644 --- a/packages/foundry/src/EtfHook.sol +++ b/packages/foundry/src/EtfHook.sol @@ -175,32 +175,33 @@ contract ETFHook is BaseHook ,ETFManager, IEntropyConsumer { function beforeAddLiquidity( address, PoolKey calldata key, - IPoolManager.ModifyLiquidityParams params, + IPoolManager.ModifyLiquidityParams calldata params, bytes calldata ) external override returns (bytes4) { (bool needed, uint256[2] memory prices) = checkIfRebalanceNeeded(); if (needed) { rebalance(); } - // how many etf tokens to mint uint256 etfAmount = uint256(params.liquidityDelta); mintETFToken(etfAmount, prices); return BaseHook.beforeAddLiquidity.selector; } function afterRemoveLiquidity( - address, + address sender, PoolKey calldata key, - IPoolManager.ModifyLiquidityParams params, - bytes calldata - ) external override returns (bytes4) { + IPoolManager.ModifyLiquidityParams calldata params, + BalanceDelta delta, + BalanceDelta feesAccrued, + bytes calldata hookData + ) external override returns (bytes4, BalanceDelta) { (bool needed, uint256[2] memory prices) = checkIfRebalanceNeeded(); if (needed) { rebalance(); } - uint256 etfAmount = -uint256(params.liquidityDelta); + uint256 etfAmount = uint256(-params.liquidityDelta); burnETFToken(etfAmount, prices); - return BaseHook.beforeRemoveLiquidity.selector; + return (BaseHook.afterRemoveLiquidity.selector, delta); } // Your existing functions