Revert "chore: Remove permit2 from executor constructor..."

This reverts commit b0b98c5e5d.
This commit is contained in:
TAMARA LIPOWSKI
2025-05-16 11:23:43 -04:00
parent fcd85c047f
commit 9b59b8b434
10 changed files with 96 additions and 62 deletions

View File

@@ -101,17 +101,19 @@ contract TychoRouterTestSetup is Constants, Permit2TestHelper, TestUtils {
address ekuboCore = 0xe0e0e08A6A4b9Dc7bD67BCB7aadE5cF48157d444;
IPoolManager poolManager = IPoolManager(poolManagerAddress);
usv2Executor = new UniswapV2Executor(factoryV2, initCodeV2, 30);
usv2Executor =
new UniswapV2Executor(factoryV2, initCodeV2, PERMIT2_ADDRESS, 30);
usv3Executor =
new UniswapV3Executor(factoryV3, initCodeV3, PERMIT2_ADDRESS);
usv4Executor = new UniswapV4Executor(poolManager, PERMIT2_ADDRESS);
pancakev3Executor = new UniswapV3Executor(
factoryPancakeV3, initCodePancakeV3, PERMIT2_ADDRESS
);
balancerv2Executor = new BalancerV2Executor();
balancerv2Executor = new BalancerV2Executor(PERMIT2_ADDRESS);
ekuboExecutor = new EkuboExecutor(ekuboCore, PERMIT2_ADDRESS);
curveExecutor = new CurveExecutor(ETH_ADDR_FOR_CURVE);
maverickv2Executor = new MaverickV2Executor(MAVERICK_V2_FACTORY);
curveExecutor = new CurveExecutor(ETH_ADDR_FOR_CURVE, PERMIT2_ADDRESS);
maverickv2Executor =
new MaverickV2Executor(MAVERICK_V2_FACTORY, PERMIT2_ADDRESS);
address[] memory executors = new address[](8);
executors[0] = address(usv2Executor);

View File

@@ -6,6 +6,8 @@ import "@src/executors/BalancerV2Executor.sol";
import {Constants} from "../Constants.sol";
contract BalancerV2ExecutorExposed is BalancerV2Executor {
constructor(address _permit2) BalancerV2Executor(_permit2) {}
function decodeParams(bytes calldata data)
external
pure
@@ -33,7 +35,7 @@ contract BalancerV2ExecutorTest is Constants, TestUtils {
function setUp() public {
uint256 forkBlock = 17323404;
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
balancerV2Exposed = new BalancerV2ExecutorExposed();
balancerV2Exposed = new BalancerV2ExecutorExposed(PERMIT2_ADDRESS);
}
function testDecodeParams() public view {

View File

@@ -22,7 +22,9 @@ interface MetaRegistry {
}
contract CurveExecutorExposed is CurveExecutor {
constructor(address _nativeToken) CurveExecutor(_nativeToken) {}
constructor(address _nativeToken, address _permit2)
CurveExecutor(_nativeToken, _permit2)
{}
function decodeData(bytes calldata data)
external
@@ -51,7 +53,8 @@ contract CurveExecutorTest is Test, Constants {
function setUp() public {
uint256 forkBlock = 22031795;
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
curveExecutorExposed = new CurveExecutorExposed(ETH_ADDR_FOR_CURVE);
curveExecutorExposed =
new CurveExecutorExposed(ETH_ADDR_FOR_CURVE, PERMIT2_ADDRESS);
metaRegistry = MetaRegistry(CURVE_META_REGISTRY);
}

View File

@@ -6,7 +6,9 @@ import {Constants} from "../Constants.sol";
import "../TestUtils.sol";
contract MaverickV2ExecutorExposed is MaverickV2Executor {
constructor(address _factory) MaverickV2Executor(_factory) {}
constructor(address _factory, address _permit2)
MaverickV2Executor(_factory, _permit2)
{}
function decodeParams(bytes calldata data)
external
@@ -32,7 +34,8 @@ contract MaverickV2ExecutorTest is TestUtils, Constants {
function setUp() public {
uint256 forkBlock = 22096000;
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
maverickV2Exposed = new MaverickV2ExecutorExposed(MAVERICK_V2_FACTORY);
maverickV2Exposed =
new MaverickV2ExecutorExposed(MAVERICK_V2_FACTORY, PERMIT2_ADDRESS);
}
function testDecodeParams() public view {

View File

@@ -8,9 +8,12 @@ import {Permit2TestHelper} from "../Permit2TestHelper.sol";
import {Test} from "../../lib/forge-std/src/Test.sol";
contract UniswapV2ExecutorExposed is UniswapV2Executor {
constructor(address _factory, bytes32 _initCode, uint256 _feeBps)
UniswapV2Executor(_factory, _initCode, _feeBps)
{}
constructor(
address _factory,
bytes32 _initCode,
address _permit2,
uint256 _feeBps
) UniswapV2Executor(_factory, _initCode, _permit2, _feeBps) {}
function decodeParams(bytes calldata data)
external
@@ -62,13 +65,19 @@ contract UniswapV2ExecutorTest is Constants, Permit2TestHelper, TestUtils {
uint256 forkBlock = 17323404;
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
uniswapV2Exposed = new UniswapV2ExecutorExposed(
USV2_FACTORY_ETHEREUM, USV2_POOL_CODE_INIT_HASH, 30
USV2_FACTORY_ETHEREUM, USV2_POOL_CODE_INIT_HASH, PERMIT2_ADDRESS, 30
);
sushiswapV2Exposed = new UniswapV2ExecutorExposed(
SUSHISWAPV2_FACTORY_ETHEREUM, SUSHIV2_POOL_CODE_INIT_HASH, 30
SUSHISWAPV2_FACTORY_ETHEREUM,
SUSHIV2_POOL_CODE_INIT_HASH,
PERMIT2_ADDRESS,
30
);
pancakeswapV2Exposed = new UniswapV2ExecutorExposed(
PANCAKESWAPV2_FACTORY_ETHEREUM, PANCAKEV2_POOL_CODE_INIT_HASH, 25
PANCAKESWAPV2_FACTORY_ETHEREUM,
PANCAKEV2_POOL_CODE_INIT_HASH,
PERMIT2_ADDRESS,
25
);
}