Skip to content

Commit

Permalink
fix: compile err
Browse files Browse the repository at this point in the history
  • Loading branch information
guzus committed Nov 16, 2024
1 parent 564f2e9 commit b7408c3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/foundry/src/EtfHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b7408c3

Please sign in to comment.