diff --git a/src/interfaces/IPositionManager.sol b/src/interfaces/IPositionManager.sol index ba8e003f2..46772e6d2 100644 --- a/src/interfaces/IPositionManager.sol +++ b/src/interfaces/IPositionManager.sol @@ -16,7 +16,7 @@ interface IPositionManager is INotifier { /// @param deadline is the deadline for the batched actions to be executed function unlockAndModifyLiquidities(bytes calldata payload, uint256 deadline) external payable; - function modifyLiquidities(bytes memory actions, bytes[] memory params) external payable; + function modifyLiquidities(bytes calldata actions, bytes[] calldata params) external payable; function nextTokenId() external view returns (uint256); diff --git a/test/position-managers/PositionManager.modifiyLiquidities.t.sol b/test/position-managers/PositionManager.modifiyLiquidities.t.sol index ceb2175f7..f172c1c5a 100644 --- a/test/position-managers/PositionManager.modifiyLiquidities.t.sol +++ b/test/position-managers/PositionManager.modifiyLiquidities.t.sol @@ -10,31 +10,18 @@ import {Currency, CurrencyLibrary} from "@uniswap/v4-core/src/types/Currency.sol import {PoolId, PoolIdLibrary} from "@uniswap/v4-core/src/types/PoolId.sol"; import {PoolKey} from "@uniswap/v4-core/src/types/PoolKey.sol"; import {BalanceDelta} from "@uniswap/v4-core/src/types/BalanceDelta.sol"; -import {LiquidityAmounts} from "@uniswap/v4-core/test/utils/LiquidityAmounts.sol"; -import {TickMath} from "@uniswap/v4-core/src/libraries/TickMath.sol"; -import {FixedPointMathLib} from "solmate/src/utils/FixedPointMathLib.sol"; import {StateLibrary} from "@uniswap/v4-core/src/libraries/StateLibrary.sol"; -import {LPFeeLibrary} from "@uniswap/v4-core/src/libraries/LPFeeLibrary.sol"; -import {IAllowanceTransfer} from "permit2/src/interfaces/IAllowanceTransfer.sol"; import {Position} from "@uniswap/v4-core/src/libraries/Position.sol"; import {SafeCast} from "@uniswap/v4-core/src/libraries/SafeCast.sol"; -import {IERC20} from "forge-std/interfaces/IERC20.sol"; - import {IPositionManager} from "../../src/interfaces/IPositionManager.sol"; import {Actions} from "../../src/libraries/Actions.sol"; import {PositionManager} from "../../src/PositionManager.sol"; -import {DeltaResolver} from "../../src/base/DeltaResolver.sol"; import {PositionConfig} from "../../src/libraries/PositionConfig.sol"; -import {SlippageCheckLibrary} from "../../src/libraries/SlippageCheck.sol"; -import {BaseActionsRouter} from "../../src/base/BaseActionsRouter.sol"; -import {Constants} from "../../src/libraries/Constants.sol"; import {LiquidityFuzzers} from "../shared/fuzz/LiquidityFuzzers.sol"; import {Planner, Plan} from "../shared/Planner.sol"; import {PosmTestSetup} from "../shared/PosmTestSetup.sol"; -import {ReentrantToken} from "../mocks/ReentrantToken.sol"; -import {ReentrancyLock} from "../../src/base/ReentrancyLock.sol"; contract PositionManagerModifyLiquiditiesTest is Test, PosmTestSetup, LiquidityFuzzers { using StateLibrary for IPoolManager; diff --git a/test/shared/HookModifyLiquidities.sol b/test/shared/HookModifyLiquidities.sol index a1e4ebe2d..85bdb8977 100644 --- a/test/shared/HookModifyLiquidities.sol +++ b/test/shared/HookModifyLiquidities.sol @@ -14,7 +14,7 @@ import {IERC20} from "forge-std/interfaces/IERC20.sol"; import {IPositionManager} from "../../src/interfaces/IPositionManager.sol"; -/// @notice This contract is NOT a production use contract. It is meant to be used in testing to verify the delta amounts against changes in a user's balance. +/// @notice This contract is NOT a production use contract. It is meant to be used in testing to verify that external contracts can modify liquidity without a lock (IPositionManager.modifyLiquidities) /// @dev a hook that can modify liquidity in beforeSwap contract HookModifyLiquidities is HookSavesDelta { IPositionManager posm; diff --git a/test/shared/PosmTestSetup.sol b/test/shared/PosmTestSetup.sol index 00d1c1145..a1febbde6 100644 --- a/test/shared/PosmTestSetup.sol +++ b/test/shared/PosmTestSetup.sol @@ -35,6 +35,7 @@ contract PosmTestSetup is Test, Deployers, DeployPermit2, LiquidityOperations { hook = HookSavesDelta(hookAddr); } + /// @dev deploys a special test hook where beforeSwap hookData is used to modify liquidity function deployPosmHookModifyLiquidities() public { HookModifyLiquidities impl = new HookModifyLiquidities(); vm.etch(hookModifyLiquiditiesAddr, address(impl).code);