Skip to content

Commit a116b72

Browse files
committed
Remove unused maxSlippage param
1 parent 1e0e598 commit a116b72

File tree

5 files changed

+0
-42
lines changed

5 files changed

+0
-42
lines changed

src/ForeignController.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,6 @@ contract ForeignController is AccessControl {
837837
tokenIn : tokenIn,
838838
amountIn : amountIn,
839839
minAmountOut : minAmountOut,
840-
maxSlippage : maxSlippages[pool],
841840
tickDelta : swapMaxTickDelta,
842841
poolParams : uniswapV3PoolParams[pool]
843842
})

src/MainnetController.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,6 @@ contract MainnetController is AccessControl {
653653
tokenIn : tokenIn,
654654
amountIn : amountIn,
655655
minAmountOut : minAmountOut,
656-
maxSlippage : maxSlippages[pool],
657656
tickDelta : swapMaxTickDelta,
658657
poolParams : uniswapV3PoolParams[pool]
659658
})

src/libraries/UniswapV3Lib.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ library UniswapV3Lib {
5151
uint256 amountIn;
5252
uint256 minAmountOut;
5353
uint24 tickDelta; // The maximum that the tick can move by after completing the swap; cannot exceed MAX_TICK_DELTA
54-
uint256 maxSlippage;
5554
}
5655

5756
struct SwapCache {
@@ -86,7 +85,6 @@ library UniswapV3Lib {
8685

8786
// Rate limit decreased by value of tokenIn (the amount actually spent)
8887
function swap(UniV3Context calldata context, SwapParams calldata params) external returns (uint256 amountOut) {
89-
require(params.maxSlippage > 0, "UniswapV3Lib/max-slippage-not-set");
9088
require(params.tickDelta <= params.poolParams.swapMaxTickDelta, "UniswapV3Lib/invalid-max-tick-delta");
9189
require(params.poolParams.twapSecondsAgo != 0, "UniswapV3Lib/zero-twap-seconds");
9290

test/grove-base-fork/UniswapV3.t.sol

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -289,25 +289,6 @@ contract ForeignControllerSwapUniswapV3FailureTests is UniswapV3TestBase {
289289
);
290290
}
291291

292-
function test_swapUniswapV3_maxSlippageNotSet() public {
293-
uint256 amountIn = 100_000e6;
294-
_fundProxy(amountIn, 0);
295-
296-
vm.prank(GROVE_EXECUTOR);
297-
foreignController.setMaxSlippage(_getPool(), 0);
298-
299-
vm.startPrank(ALM_RELAYER);
300-
vm.expectRevert("UniswapV3Lib/max-slippage-not-set");
301-
foreignController.swapUniswapV3(
302-
_getPool(),
303-
address(token0),
304-
amountIn,
305-
0,
306-
200
307-
);
308-
vm.stopPrank();
309-
}
310-
311292
function test_swapUniswapV3_invalidTokenIn() public {
312293
vm.startPrank(ALM_RELAYER);
313294
vm.expectRevert("UniswapV3Lib/invalid-token-pair");

test/grove-mainnet-fork/UniswapV3.t.sol

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -250,25 +250,6 @@ contract MainnetControllerSwapUniswapV3FailureTests is UniswapV3TestBase {
250250
);
251251
}
252252

253-
function test_swapUniswapV3_maxSlippageNotSet() public {
254-
uint256 amountIn = 100_000e6;
255-
_fundProxy(amountIn, 0);
256-
257-
vm.prank(GROVE_PROXY);
258-
mainnetController.setMaxSlippage(_getPool(), 0);
259-
260-
vm.startPrank(relayer);
261-
vm.expectRevert("UniswapV3Lib/max-slippage-not-set");
262-
mainnetController.swapUniswapV3(
263-
_getPool(),
264-
address(token0),
265-
amountIn,
266-
0,
267-
200
268-
);
269-
vm.stopPrank();
270-
}
271-
272253
function test_swapUniswapV3_invalidTokenIn() public {
273254
uint256 amountIn = 100_000e6;
274255
deal(address(dai), address(almProxy), amountIn);

0 commit comments

Comments
 (0)