From e74c9bbd42fe0fb1c20e2560e72d5c2e62fb45f1 Mon Sep 17 00:00:00 2001 From: diana Date: Wed, 21 Aug 2024 16:14:29 -0400 Subject: [PATCH] change variable of the fee amount going to the protocol (#837) --- src/PoolManager.sol | 4 ++-- src/libraries/Pool.sol | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PoolManager.sol b/src/PoolManager.sol index ad6a293da..0cabcd42b 100644 --- a/src/PoolManager.sol +++ b/src/PoolManager.sol @@ -233,10 +233,10 @@ contract PoolManager is IPoolManager, ProtocolFees, NoDelegateCall, ERC6909Claim internal returns (BalanceDelta) { - (BalanceDelta delta, uint256 feeForProtocol, uint24 swapFee, Pool.SwapState memory state) = pool.swap(params); + (BalanceDelta delta, uint256 amountToProtocol, uint24 swapFee, Pool.SwapState memory state) = pool.swap(params); // the fee is on the input currency - if (feeForProtocol > 0) _updateProtocolFees(inputCurrency, feeForProtocol); + if (amountToProtocol > 0) _updateProtocolFees(inputCurrency, amountToProtocol); // event is emitted before the afterSwap call to ensure events are always emitted in order emit Swap( diff --git a/src/libraries/Pool.sol b/src/libraries/Pool.sol index 0ced9f0c6..9c06425d5 100644 --- a/src/libraries/Pool.sol +++ b/src/libraries/Pool.sol @@ -282,7 +282,7 @@ library Pool { /// @dev PoolManager checks that the pool is initialized before calling function swap(State storage self, SwapParams memory params) internal - returns (BalanceDelta result, uint256 feeForProtocol, uint24 swapFee, SwapState memory state) + returns (BalanceDelta result, uint256 amountToProtocol, uint24 swapFee, SwapState memory state) { Slot0 slot0Start = self.slot0; bool zeroForOne = params.zeroForOne; @@ -382,7 +382,7 @@ library Pool { uint256 delta = (step.amountIn + step.feeAmount) * protocolFee / ProtocolFeeLibrary.PIPS_DENOMINATOR; // subtract it from the total fee and add it to the protocol fee step.feeAmount -= delta; - feeForProtocol += delta; + amountToProtocol += delta; } }