From d9403bdaaf9b2ae68e754678ecd5ba8e37289d1a Mon Sep 17 00:00:00 2001 From: Sara Reynolds <30504811+snreynolds@users.noreply.github.com> Date: Mon, 21 Oct 2024 20:32:19 +0100 Subject: [PATCH] remove IProtocolFeeController (#907) * remove IProtocolFeeController * typo * remove cast * remove more casts --------- Co-authored-by: Alice <34962750+hensha256@users.noreply.github.com> --- .../poolManager bytecode size.snap | 2 +- ...wap skips hook call if hook is caller.snap | 2 +- .forge-snapshots/swap with dynamic fee.snap | 2 +- .../swap with return dynamic fee.snap | 2 +- .../update dynamic fee in before swap.snap | 2 +- src/ProtocolFees.sol | 11 ++++---- src/interfaces/IPoolManager.sol | 2 +- src/interfaces/IProtocolFeeController.sol | 15 ----------- src/interfaces/IProtocolFees.sol | 7 +++-- src/test/Fuzzers.sol | 2 +- src/test/ProtocolFeeControllerTest.sol | 19 ------------- test/DynamicFees.t.sol | 8 +++--- test/PoolManager.t.sol | 23 ++++++++-------- test/PoolManagerInitialize.t.sol | 2 -- test/ProtocolFeesImplementation.t.sol | 27 +++++++++---------- test/utils/Deployers.sol | 8 +++--- 16 files changed, 47 insertions(+), 87 deletions(-) delete mode 100644 src/interfaces/IProtocolFeeController.sol delete mode 100644 src/test/ProtocolFeeControllerTest.sol diff --git a/.forge-snapshots/poolManager bytecode size.snap b/.forge-snapshots/poolManager bytecode size.snap index f06e8f4ab..014db780a 100644 --- a/.forge-snapshots/poolManager bytecode size.snap +++ b/.forge-snapshots/poolManager bytecode size.snap @@ -1 +1 @@ -23682 \ No newline at end of file +23659 \ No newline at end of file diff --git a/.forge-snapshots/swap skips hook call if hook is caller.snap b/.forge-snapshots/swap skips hook call if hook is caller.snap index 403b7eb63..738a9d1de 100644 --- a/.forge-snapshots/swap skips hook call if hook is caller.snap +++ b/.forge-snapshots/swap skips hook call if hook is caller.snap @@ -1 +1 @@ -206251 \ No newline at end of file +206263 \ No newline at end of file diff --git a/.forge-snapshots/swap with dynamic fee.snap b/.forge-snapshots/swap with dynamic fee.snap index 2f7c85061..74ba5c12d 100644 --- a/.forge-snapshots/swap with dynamic fee.snap +++ b/.forge-snapshots/swap with dynamic fee.snap @@ -1 +1 @@ -139284 \ No newline at end of file +139272 \ No newline at end of file diff --git a/.forge-snapshots/swap with return dynamic fee.snap b/.forge-snapshots/swap with return dynamic fee.snap index fd902a4a0..025234fce 100644 --- a/.forge-snapshots/swap with return dynamic fee.snap +++ b/.forge-snapshots/swap with return dynamic fee.snap @@ -1 +1 @@ -145577 \ No newline at end of file +145589 \ No newline at end of file diff --git a/.forge-snapshots/update dynamic fee in before swap.snap b/.forge-snapshots/update dynamic fee in before swap.snap index 2bf5b6d0e..a19ff3dba 100644 --- a/.forge-snapshots/update dynamic fee in before swap.snap +++ b/.forge-snapshots/update dynamic fee in before swap.snap @@ -1 +1 @@ -147869 \ No newline at end of file +147857 \ No newline at end of file diff --git a/src/ProtocolFees.sol b/src/ProtocolFees.sol index ecea47484..5eab2e71b 100644 --- a/src/ProtocolFees.sol +++ b/src/ProtocolFees.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.0; import {Currency} from "./types/Currency.sol"; -import {IProtocolFeeController} from "./interfaces/IProtocolFeeController.sol"; import {IProtocolFees} from "./interfaces/IProtocolFees.sol"; import {PoolKey} from "./types/PoolKey.sol"; import {ProtocolFeeLibrary} from "./libraries/ProtocolFeeLibrary.sol"; @@ -21,19 +20,19 @@ abstract contract ProtocolFees is IProtocolFees, Owned { mapping(Currency currency => uint256 amount) public protocolFeesAccrued; /// @inheritdoc IProtocolFees - IProtocolFeeController public protocolFeeController; + address public protocolFeeController; constructor() Owned(msg.sender) {} /// @inheritdoc IProtocolFees - function setProtocolFeeController(IProtocolFeeController controller) external onlyOwner { + function setProtocolFeeController(address controller) external onlyOwner { protocolFeeController = controller; - emit ProtocolFeeControllerUpdated(address(controller)); + emit ProtocolFeeControllerUpdated(controller); } /// @inheritdoc IProtocolFees function setProtocolFee(PoolKey memory key, uint24 newProtocolFee) external { - if (msg.sender != address(protocolFeeController)) InvalidCaller.selector.revertWith(); + if (msg.sender != protocolFeeController) InvalidCaller.selector.revertWith(); if (!newProtocolFee.isValidProtocolFee()) ProtocolFeeTooLarge.selector.revertWith(newProtocolFee); PoolId id = key.toId(); _getPool(id).setProtocolFee(newProtocolFee); @@ -45,7 +44,7 @@ abstract contract ProtocolFees is IProtocolFees, Owned { external returns (uint256 amountCollected) { - if (msg.sender != address(protocolFeeController)) InvalidCaller.selector.revertWith(); + if (msg.sender != protocolFeeController) InvalidCaller.selector.revertWith(); if (_isUnlocked()) ContractUnlocked.selector.revertWith(); amountCollected = (amount == 0) ? protocolFeesAccrued[currency] : amount; diff --git a/src/interfaces/IPoolManager.sol b/src/interfaces/IPoolManager.sol index b8502c247..88c200a41 100644 --- a/src/interfaces/IPoolManager.sol +++ b/src/interfaces/IPoolManager.sol @@ -55,7 +55,7 @@ interface IPoolManager is IProtocolFees, IERC6909Claims, IExtsload, IExttload { /// @param tickSpacing The minimum number of ticks between initialized ticks /// @param hooks The hooks contract address for the pool, or address(0) if none /// @param sqrtPriceX96 The price of the pool on initialization - /// @param tick The initial tick of the pool corresponding to the intialized price + /// @param tick The initial tick of the pool corresponding to the initialized price event Initialize( PoolId indexed id, Currency indexed currency0, diff --git a/src/interfaces/IProtocolFeeController.sol b/src/interfaces/IProtocolFeeController.sol deleted file mode 100644 index 44f4f2cf2..000000000 --- a/src/interfaces/IProtocolFeeController.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import {PoolKey} from "../types/PoolKey.sol"; - -/// @notice Interface to fetch the protocol fees for a pool from the protocol fee controller -interface IProtocolFeeController { - /// @notice Returns the protocol fees for a pool given the conditions of this contract - /// @param poolKey The pool key to identify the pool. The controller may want to use attributes on the pool - /// to determine the protocol fee, hence the entire key is needed. - /// @return protocolFee The pool's protocol fee, expressed in hundredths of a bip. The upper 12 bits are for 1->0 - /// and the lower 12 are for 0->1. The maximum is 1000 - meaning the maximum protocol fee is 0.1%. - /// the protocolFee is taken from the input first, then the lpFee is taken from the remaining input - function protocolFeeForPool(PoolKey memory poolKey) external view returns (uint24 protocolFee); -} diff --git a/src/interfaces/IProtocolFees.sol b/src/interfaces/IProtocolFees.sol index 0717bfc88..4a9db7a8a 100644 --- a/src/interfaces/IProtocolFees.sol +++ b/src/interfaces/IProtocolFees.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.0; import {Currency} from "../types/Currency.sol"; -import {IProtocolFeeController} from "../interfaces/IProtocolFeeController.sol"; import {PoolId} from "../types/PoolId.sol"; import {PoolKey} from "../types/PoolKey.sol"; @@ -35,7 +34,7 @@ interface IProtocolFees { /// @notice Sets the protocol fee controller /// @param controller The new protocol fee controller - function setProtocolFeeController(IProtocolFeeController controller) external; + function setProtocolFeeController(address controller) external; /// @notice Collects the protocol fees for a given recipient and currency, returning the amount collected /// @dev This will revert if the contract is unlocked @@ -48,6 +47,6 @@ interface IProtocolFees { returns (uint256 amountCollected); /// @notice Returns the current protocol fee controller address - /// @return IProtocolFeeController The currency protocol fee controller - function protocolFeeController() external view returns (IProtocolFeeController); + /// @return address The current protocol fee controller address + function protocolFeeController() external view returns (address); } diff --git a/src/test/Fuzzers.sol b/src/test/Fuzzers.sol index eccf55b57..04c2c11bf 100644 --- a/src/test/Fuzzers.sol +++ b/src/test/Fuzzers.sol @@ -142,7 +142,7 @@ contract Fuzzers is StdUtils { result.liquidityDelta = boundLiquidityDelta(key, params.liquidityDelta, liquidityDeltaFromAmounts); } - // Creates liquidity parameters with a stricter bound. Should be used if multiple positions being intitialized on the pool, with potential for tick overlap. + // Creates liquidity parameters with a stricter bound. Should be used if multiple positions being initialized on the pool, with potential for tick overlap. function createFuzzyLiquidityParamsWithTightBound( PoolKey memory key, IPoolManager.ModifyLiquidityParams memory params, diff --git a/src/test/ProtocolFeeControllerTest.sol b/src/test/ProtocolFeeControllerTest.sol deleted file mode 100644 index 25fc0795d..000000000 --- a/src/test/ProtocolFeeControllerTest.sol +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.20; - -import {IProtocolFeeController} from "../interfaces/IProtocolFeeController.sol"; -import {PoolId} from "../types/PoolId.sol"; -import {PoolKey} from "../types/PoolKey.sol"; - -contract ProtocolFeeControllerTest is IProtocolFeeController { - mapping(PoolId => uint24) public protocolFee; - - function protocolFeeForPool(PoolKey memory key) external view returns (uint24) { - return protocolFee[key.toId()]; - } - - // for tests to set pool protocol fees - function setProtocolFeeForPool(PoolId id, uint24 fee) external { - protocolFee[id] = fee; - } -} diff --git a/test/DynamicFees.t.sol b/test/DynamicFees.t.sol index 5cab241b3..561d92bb0 100644 --- a/test/DynamicFees.t.sol +++ b/test/DynamicFees.t.sol @@ -222,7 +222,7 @@ contract TestDynamicFees is Test, Deployers, GasSnapshot { dynamicFeesHooks.setFee(999999); - vm.prank(address(feeController)); + vm.prank(feeController); manager.setProtocolFee(key, 1000); IPoolManager.SwapParams memory params = @@ -239,7 +239,7 @@ contract TestDynamicFees is Test, Deployers, GasSnapshot { dynamicFeesHooks.setFee(1000000); - vm.prank(address(feeController)); + vm.prank(feeController); manager.setProtocolFee(key, 1000); IPoolManager.SwapParams memory params = @@ -261,7 +261,7 @@ contract TestDynamicFees is Test, Deployers, GasSnapshot { dynamicFeesHooks.setFee(123); - vm.prank(address(feeController)); + vm.prank(feeController); manager.setProtocolFee(key, 1000); PoolSwapTest.TestSettings memory testSettings = @@ -288,7 +288,7 @@ contract TestDynamicFees is Test, Deployers, GasSnapshot { uint24 protocolFee = (uint24(protocolFee1) << 12) | uint24(protocolFee0); dynamicFeesHooks.setFee(lpFee); - vm.prank(address(feeController)); + vm.prank(feeController); manager.setProtocolFee(key, protocolFee); IPoolManager.SwapParams memory params = IPoolManager.SwapParams({ diff --git a/test/PoolManager.t.sol b/test/PoolManager.t.sol index be71725a1..41a918b85 100644 --- a/test/PoolManager.t.sol +++ b/test/PoolManager.t.sol @@ -6,7 +6,6 @@ import {IHooks} from "../src/interfaces/IHooks.sol"; import {Hooks} from "../src/libraries/Hooks.sol"; import {IPoolManager} from "../src/interfaces/IPoolManager.sol"; import {IProtocolFees} from "../src/interfaces/IProtocolFees.sol"; -import {IProtocolFeeController} from "../src/interfaces/IProtocolFeeController.sol"; import {PoolManager} from "../src/PoolManager.sol"; import {TickMath} from "../src/libraries/TickMath.sol"; import {Pool} from "../src/libraries/Pool.sol"; @@ -775,7 +774,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { (,, uint24 slot0ProtocolFee,) = manager.getSlot0(key.toId()); assertEq(slot0ProtocolFee, 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.setProtocolFee(key, protocolFee); (,, slot0ProtocolFee,) = manager.getSlot0(key.toId()); @@ -990,7 +989,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { (,, uint24 slot0ProtocolFee,) = manager.getSlot0(key.toId()); assertEq(slot0ProtocolFee, 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.setProtocolFee(key, MAX_PROTOCOL_FEE_BOTH_TOKENS); (,, slot0ProtocolFee,) = manager.getSlot0(key.toId()); @@ -1006,7 +1005,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { assertEq(manager.protocolFeesAccrued(currency0), expectedFees); assertEq(manager.protocolFeesAccrued(currency1), 0); assertEq(currency0.balanceOf(address(1)), 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.collectProtocolFees(address(1), currency0, expectedFees); snapLastCall("erc20 collect protocol fees"); assertEq(currency0.balanceOf(address(1)), expectedFees); @@ -1019,7 +1018,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { (,, uint24 slot0ProtocolFee,) = manager.getSlot0(key.toId()); assertEq(slot0ProtocolFee, 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.setProtocolFee(key, MAX_PROTOCOL_FEE_BOTH_TOKENS); (,, slot0ProtocolFee,) = manager.getSlot0(key.toId()); @@ -1035,7 +1034,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { assertEq(manager.protocolFeesAccrued(currency0), expectedFees); assertEq(manager.protocolFeesAccrued(currency1), 0); assertEq(currency0.balanceOf(address(1)), 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.collectProtocolFees(address(1), currency0, expectedFees); assertEq(currency0.balanceOf(address(1)), expectedFees); assertEq(manager.protocolFeesAccrued(currency0), 0); @@ -1047,7 +1046,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { (,, uint24 slot0ProtocolFee,) = manager.getSlot0(key.toId()); assertEq(slot0ProtocolFee, 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.setProtocolFee(key, MAX_PROTOCOL_FEE_BOTH_TOKENS); (,, slot0ProtocolFee,) = manager.getSlot0(key.toId()); @@ -1063,7 +1062,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { assertEq(manager.protocolFeesAccrued(currency0), 0); assertEq(manager.protocolFeesAccrued(currency1), expectedFees); assertEq(currency1.balanceOf(address(1)), 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.collectProtocolFees(address(1), currency1, 0); assertEq(currency1.balanceOf(address(1)), expectedFees); assertEq(manager.protocolFeesAccrued(currency1), 0); @@ -1076,7 +1075,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { (,, uint24 slot0ProtocolFee,) = manager.getSlot0(nativeKey.toId()); assertEq(slot0ProtocolFee, 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.setProtocolFee(nativeKey, MAX_PROTOCOL_FEE_BOTH_TOKENS); (,, slot0ProtocolFee,) = manager.getSlot0(nativeKey.toId()); @@ -1092,7 +1091,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { assertEq(manager.protocolFeesAccrued(nativeCurrency), expectedFees); assertEq(manager.protocolFeesAccrued(currency1), 0); assertEq(nativeCurrency.balanceOf(address(1)), 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.collectProtocolFees(address(1), nativeCurrency, expectedFees); snapLastCall("native collect protocol fees"); assertEq(nativeCurrency.balanceOf(address(1)), expectedFees); @@ -1106,7 +1105,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { (,, uint24 slot0ProtocolFee,) = manager.getSlot0(nativeKey.toId()); assertEq(slot0ProtocolFee, 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.setProtocolFee(nativeKey, MAX_PROTOCOL_FEE_BOTH_TOKENS); (,, slot0ProtocolFee,) = manager.getSlot0(nativeKey.toId()); @@ -1122,7 +1121,7 @@ contract PoolManagerTest is Test, Deployers, GasSnapshot { assertEq(manager.protocolFeesAccrued(nativeCurrency), expectedFees); assertEq(manager.protocolFeesAccrued(currency1), 0); assertEq(nativeCurrency.balanceOf(address(1)), 0); - vm.prank(address(feeController)); + vm.prank(feeController); manager.collectProtocolFees(address(1), nativeCurrency, 0); assertEq(nativeCurrency.balanceOf(address(1)), expectedFees); assertEq(manager.protocolFeesAccrued(nativeCurrency), 0); diff --git a/test/PoolManagerInitialize.t.sol b/test/PoolManagerInitialize.t.sol index b4c9b43d0..006b37c6c 100644 --- a/test/PoolManagerInitialize.t.sol +++ b/test/PoolManagerInitialize.t.sol @@ -19,8 +19,6 @@ import {PoolKey} from "../src/types/PoolKey.sol"; import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; import {PoolId} from "../src/types/PoolId.sol"; import {LPFeeLibrary} from "../src/libraries/LPFeeLibrary.sol"; -import {ProtocolFeeControllerTest} from "../src/test/ProtocolFeeControllerTest.sol"; -import {IProtocolFeeController} from "../src/interfaces/IProtocolFeeController.sol"; import {ProtocolFeeLibrary} from "../src/libraries/ProtocolFeeLibrary.sol"; import {StateLibrary} from "../src/libraries/StateLibrary.sol"; diff --git a/test/ProtocolFeesImplementation.t.sol b/test/ProtocolFeesImplementation.t.sol index f5f7007ea..d2e46c6a2 100644 --- a/test/ProtocolFeesImplementation.t.sol +++ b/test/ProtocolFeesImplementation.t.sol @@ -14,7 +14,6 @@ import {Deployers} from "../test/utils/Deployers.sol"; import {PoolId} from "../src/types/PoolId.sol"; import {IHooks} from "../src/interfaces/IHooks.sol"; import {Constants} from "../test/utils/Constants.sol"; -import {ProtocolFeeControllerTest} from "../src/test/ProtocolFeeControllerTest.sol"; contract ProtocolFeesTest is Test, GasSnapshot, Deployers { using ProtocolFeeLibrary for uint24; @@ -28,26 +27,26 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { function setUp() public { protocolFees = new ProtocolFeesImplementation(); - feeController = new ProtocolFeeControllerTest(); + feeController = makeAddr("feeController"); (currency0, currency1) = deployAndMint2Currencies(); MockERC20(Currency.unwrap(currency0)).transfer(address(protocolFees), 2 ** 255); } function test_setProtocolFeeController_succeedsNoRevert() public { - assertEq(address(protocolFees.protocolFeeController()), address(0)); + assertEq(protocolFees.protocolFeeController(), address(0)); vm.expectEmit(true, false, false, false, address(protocolFees)); - emit ProtocolFeeControllerUpdated(address(feeController)); + emit ProtocolFeeControllerUpdated(feeController); protocolFees.setProtocolFeeController(feeController); - assertEq(address(protocolFees.protocolFeeController()), address(feeController)); + assertEq(protocolFees.protocolFeeController(), feeController); } function test_setProtocolFeeController_revertsWithNotAuthorized() public { - assertEq(address(protocolFees.protocolFeeController()), address(0)); + assertEq(protocolFees.protocolFeeController(), address(0)); vm.prank(address(1)); // not the owner address vm.expectRevert("UNAUTHORIZED"); protocolFees.setProtocolFeeController(feeController); - assertEq(address(protocolFees.protocolFeeController()), address(0)); + assertEq(protocolFees.protocolFeeController(), address(0)); } function test_setProtocolFee_succeeds_gas() public { @@ -55,7 +54,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { protocolFees.setProtocolFeeController(feeController); // Set price to pretend that the pool is initialized protocolFees.setPrice(key, Constants.SQRT_PRICE_1_1); - vm.prank(address(feeController)); + vm.prank(feeController); vm.expectEmit(true, false, false, true, address(protocolFees)); emit ProtocolFeeUpdated(key.toId(), MAX_PROTOCOL_FEE_BOTH_TOKENS); protocolFees.setProtocolFee(key, MAX_PROTOCOL_FEE_BOTH_TOKENS); @@ -72,12 +71,12 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { uint24 protocolFee = MAX_PROTOCOL_FEE_BOTH_TOKENS + 1; protocolFees.setProtocolFeeController(feeController); - vm.prank(address(feeController)); + vm.prank(feeController); vm.expectRevert(abi.encodeWithSelector(IProtocolFees.ProtocolFeeTooLarge.selector, protocolFee)); protocolFees.setProtocolFee(key, protocolFee); protocolFee = MAX_PROTOCOL_FEE_BOTH_TOKENS + (1 << 12); - vm.prank(address(feeController)); + vm.prank(feeController); vm.expectRevert(abi.encodeWithSelector(IProtocolFees.ProtocolFeeTooLarge.selector, protocolFee)); protocolFees.setProtocolFee(key, protocolFee); } @@ -88,7 +87,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { protocolFees.setPrice(key, Constants.SQRT_PRICE_1_1); uint16 fee0 = protocolFee.getZeroForOneFee(); uint16 fee1 = protocolFee.getOneForZeroFee(); - vm.prank(address(feeController)); + vm.prank(feeController); if ((fee0 > 1000) || (fee1 > 1000)) { vm.expectRevert(abi.encodeWithSelector(IProtocolFees.ProtocolFeeTooLarge.selector, protocolFee)); protocolFees.setProtocolFee(key, protocolFee); @@ -108,7 +107,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { protocolFees.setIsUnlocked(true); protocolFees.setProtocolFeeController(feeController); - vm.prank(address(feeController)); + vm.prank(feeController); vm.expectRevert(IProtocolFees.ContractUnlocked.selector); protocolFees.collectProtocolFees(address(1), currency0, 0); @@ -120,7 +119,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { assertEq(protocolFees.protocolFeesAccrued(currency0), 100); protocolFees.setProtocolFeeController(feeController); - vm.prank(address(feeController)); + vm.prank(feeController); protocolFees.collectProtocolFees(address(this), currency0, 100); assertEq(protocolFees.protocolFeesAccrued(currency0), 0); assertEq(currency0.balanceOf(address(this)), 100); @@ -140,7 +139,7 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { } protocolFees.setProtocolFeeController(feeController); - vm.prank(address(feeController)); + vm.prank(feeController); if (amount > feesAccrued) { vm.expectRevert(); } diff --git a/test/utils/Deployers.sol b/test/utils/Deployers.sol index f15b42461..27b179a4c 100644 --- a/test/utils/Deployers.sol +++ b/test/utils/Deployers.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; +import "forge-std/Test.sol"; import {MockERC20} from "solmate/src/test/utils/mocks/MockERC20.sol"; import {Hooks} from "../../src/libraries/Hooks.sol"; import {Currency, CurrencyLibrary} from "../../src/types/Currency.sol"; @@ -25,9 +26,8 @@ import {PoolClaimsTest} from "../../src/test/PoolClaimsTest.sol"; import {ActionsRouter} from "../../src/test/ActionsRouter.sol"; import {LiquidityAmounts} from "../../test/utils/LiquidityAmounts.sol"; import {StateLibrary} from "../../src/libraries/StateLibrary.sol"; -import {ProtocolFeeControllerTest} from "../../src/test/ProtocolFeeControllerTest.sol"; -contract Deployers { +contract Deployers is Test { using LPFeeLibrary for uint24; using StateLibrary for IPoolManager; @@ -63,7 +63,7 @@ contract Deployers { PoolClaimsTest claimsRouter; PoolNestedActionsTest nestedActionRouter; - ProtocolFeeControllerTest feeController; + address feeController; PoolKey key; PoolKey nativeKey; @@ -88,7 +88,7 @@ contract Deployers { takeRouter = new PoolTakeTest(manager); claimsRouter = new PoolClaimsTest(manager); nestedActionRouter = new PoolNestedActionsTest(manager); - feeController = new ProtocolFeeControllerTest(); + feeController = makeAddr("feeController"); actionsRouter = new ActionsRouter(manager); manager.setProtocolFeeController(feeController);