Skip to content

Commit

Permalink
change variable of the fee amount going to the protocol (#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
dianakocsis authored Aug 21, 2024
1 parent 1195355 commit e74c9bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/PoolManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit e74c9bb

Please sign in to comment.