chore: Remove permit2 from executor constructor...
whenever not needed.
This commit is contained in:
@@ -5,30 +5,27 @@ const hre = require("hardhat");
|
|||||||
// Comment out the executors you don't want to deploy
|
// Comment out the executors you don't want to deploy
|
||||||
const executors_to_deploy = {
|
const executors_to_deploy = {
|
||||||
"ethereum": [
|
"ethereum": [
|
||||||
// USV2 - Args: Factory, Pool Init Code Hash, Permit2, Fee BPS
|
// USV2 - Args: Factory, Pool Init Code Hash, Fee BPS
|
||||||
{
|
{
|
||||||
exchange: "UniswapV2Executor", args: [
|
exchange: "UniswapV2Executor", args: [
|
||||||
"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
|
"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
|
||||||
"0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",
|
"0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",
|
||||||
"0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
||||||
30
|
30
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// SUSHISWAP - Args: Factory, Pool Init Code Hash, Fee BPS, Permit2, Fee BPS
|
// SUSHISWAP - Args: Factory, Pool Init Code Hash, Fee BPS, Fee BPS
|
||||||
{
|
{
|
||||||
exchange: "UniswapV2Executor", args: [
|
exchange: "UniswapV2Executor", args: [
|
||||||
"0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac",
|
"0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac",
|
||||||
"0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303",
|
"0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303",
|
||||||
"0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
||||||
30
|
30
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// PANCAKESWAP V2 - Args: Factory, Pool Init Code Hash, Permit2, Fee BPS
|
// PANCAKESWAP V2 - Args: Factory, Pool Init Code Hash, Fee BPS
|
||||||
{
|
{
|
||||||
exchange: "UniswapV2Executor", args: [
|
exchange: "UniswapV2Executor", args: [
|
||||||
"0x1097053Fd2ea711dad45caCcc45EfF7548fCB362",
|
"0x1097053Fd2ea711dad45caCcc45EfF7548fCB362",
|
||||||
"0x57224589c67f3f30a6b0d7a1b54cf3153ab84563bc609ef41dfb34f8b2974d2d",
|
"0x57224589c67f3f30a6b0d7a1b54cf3153ab84563bc609ef41dfb34f8b2974d2d",
|
||||||
"0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
||||||
25
|
25
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -53,8 +50,8 @@ const executors_to_deploy = {
|
|||||||
"0x000000000004444c5dc75cB358380D2e3dE08A90",
|
"0x000000000004444c5dc75cB358380D2e3dE08A90",
|
||||||
"0x000000000022D473030F116dDEE9F6B43aC78BA3"
|
"0x000000000022D473030F116dDEE9F6B43aC78BA3"
|
||||||
]},
|
]},
|
||||||
// Args: Permit2
|
// Args: None
|
||||||
{exchange: "BalancerV2Executor", args: ["0x000000000022D473030F116dDEE9F6B43aC78BA3"]},
|
{exchange: "BalancerV2Executor", args: []},
|
||||||
// Args: Ekubo core contract, Permit2
|
// Args: Ekubo core contract, Permit2
|
||||||
{
|
{
|
||||||
exchange: "EkuboExecutor", args: [
|
exchange: "EkuboExecutor", args: [
|
||||||
@@ -62,69 +59,64 @@ const executors_to_deploy = {
|
|||||||
"0x000000000022D473030F116dDEE9F6B43aC78BA3"
|
"0x000000000022D473030F116dDEE9F6B43aC78BA3"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// Args: ETH address in curve pools, Permit2
|
// Args: ETH address in curve pools
|
||||||
{
|
{
|
||||||
exchange: "CurveExecutor", args: [
|
exchange: "CurveExecutor", args: [
|
||||||
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
|
||||||
"0x000000000022D473030F116dDEE9F6B43aC78BA3"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"base": [
|
"base": [
|
||||||
// // Args: Factory, Pool Init Code Hash, Permit2, Fee BPS
|
// Args: Factory, Pool Init Code Hash, Fee BPS
|
||||||
// {
|
{
|
||||||
// exchange: "UniswapV2Executor", args: [
|
exchange: "UniswapV2Executor", args: [
|
||||||
// "0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6",
|
"0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6",
|
||||||
// "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",
|
"0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",
|
||||||
// "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
30
|
||||||
// 30
|
]
|
||||||
// ]
|
},
|
||||||
// },
|
// SUSHISWAP V2 - Args: Factory, Pool Init Code Hash, Fee BPS
|
||||||
// // SUSHISWAP V2 - Args: Factory, Pool Init Code Hash, Permit2, Fee BPS
|
{
|
||||||
// {
|
exchange: "UniswapV2Executor", args: [
|
||||||
// exchange: "UniswapV2Executor", args: [
|
"0x71524B4f93c58fcbF659783284E38825f0622859",
|
||||||
// "0x71524B4f93c58fcbF659783284E38825f0622859",
|
"0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303",
|
||||||
// "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303",
|
30
|
||||||
// "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
]
|
||||||
// 30
|
},
|
||||||
// ]
|
// PANCAKESWAP V2 - Args: Factory, Pool Init Code Hash, Fee BPS
|
||||||
// },
|
|
||||||
// PANCAKESWAP V2 - Args: Factory, Pool Init Code Hash, Permit2, Fee BPS
|
|
||||||
{
|
{
|
||||||
exchange: "UniswapV2Executor", args: [
|
exchange: "UniswapV2Executor", args: [
|
||||||
"0x1097053Fd2ea711dad45caCcc45EfF7548fCB362",
|
"0x1097053Fd2ea711dad45caCcc45EfF7548fCB362",
|
||||||
"0x57224589c67f3f30a6b0d7a1b54cf3153ab84563bc609ef41dfb34f8b2974d2d",
|
"0x57224589c67f3f30a6b0d7a1b54cf3153ab84563bc609ef41dfb34f8b2974d2d",
|
||||||
"0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
||||||
25
|
25
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// // USV3 - Args: Factory, Pool Init Code Hash, Permit2
|
// USV3 - Args: Factory, Pool Init Code Hash, Permit2
|
||||||
// {
|
{
|
||||||
// exchange: "UniswapV3Executor", args: [
|
exchange: "UniswapV3Executor", args: [
|
||||||
// "0x33128a8fC17869897dcE68Ed026d694621f6FDfD",
|
"0x33128a8fC17869897dcE68Ed026d694621f6FDfD",
|
||||||
// "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54",
|
"0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54",
|
||||||
// "0x000000000022D473030F116dDEE9F6B43aC78BA3"
|
"0x000000000022D473030F116dDEE9F6B43aC78BA3"
|
||||||
// ]
|
]
|
||||||
// },
|
},
|
||||||
// // PANCAKESWAP V3 - Args: Deployer, Pool Init Code Hash, Permit2
|
// PANCAKESWAP V3 - Args: Deployer, Pool Init Code Hash, Permit2
|
||||||
// {
|
{
|
||||||
// exchange: "UniswapV3Executor", args: [
|
exchange: "UniswapV3Executor", args: [
|
||||||
// "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9",
|
"0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9",
|
||||||
// "0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2",
|
"0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2",
|
||||||
// "0x000000000022D473030F116dDEE9F6B43aC78BA3"
|
"0x000000000022D473030F116dDEE9F6B43aC78BA3"
|
||||||
// ]
|
]
|
||||||
// },
|
},
|
||||||
// // Args: Pool manager
|
// Args: Pool manager
|
||||||
// {exchange: "UniswapV4Executor", args: ["0x498581ff718922c3f8e6a244956af099b2652b2b"]},
|
{exchange: "UniswapV4Executor", args: ["0x498581ff718922c3f8e6a244956af099b2652b2b"]},
|
||||||
// {exchange: "BalancerV2Executor", args: []},
|
{exchange: "BalancerV2Executor", args: []},
|
||||||
],
|
],
|
||||||
"unichain": [
|
"unichain": [
|
||||||
// Args: Factory, Pool Init Code Hash, Permit2, Fee BPS
|
// Args: Factory, Pool Init Code Hash, Fee BPS
|
||||||
{
|
{
|
||||||
exchange: "UniswapV2Executor", args: [
|
exchange: "UniswapV2Executor", args: [
|
||||||
"0x1f98400000000000000000000000000000000002",
|
"0x1f98400000000000000000000000000000000002",
|
||||||
"0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",
|
"0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f",
|
||||||
"0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
||||||
30
|
30
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ contract BalancerV2Executor is IExecutor {
|
|||||||
|
|
||||||
address private constant VAULT = 0xBA12222222228d8Ba445958a75a0704d566BF2C8;
|
address private constant VAULT = 0xBA12222222228d8Ba445958a75a0704d566BF2C8;
|
||||||
|
|
||||||
constructor(address _permit2) {}
|
|
||||||
|
|
||||||
// slither-disable-next-line locked-ether
|
// slither-disable-next-line locked-ether
|
||||||
function swap(uint256 givenAmount, bytes calldata data)
|
function swap(uint256 givenAmount, bytes calldata data)
|
||||||
external
|
external
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ contract CurveExecutor is IExecutor {
|
|||||||
|
|
||||||
address public immutable nativeToken;
|
address public immutable nativeToken;
|
||||||
|
|
||||||
constructor(address _nativeToken, address _permit2) {
|
constructor(address _nativeToken) {
|
||||||
if (_nativeToken == address(0)) {
|
if (_nativeToken == address(0)) {
|
||||||
revert CurveExecutor__AddressZero();
|
revert CurveExecutor__AddressZero();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ contract MaverickV2Executor is IExecutor {
|
|||||||
|
|
||||||
address public immutable factory;
|
address public immutable factory;
|
||||||
|
|
||||||
constructor(address _factory, address _permit2) {
|
constructor(address _factory) {
|
||||||
if (_factory == address(0)) {
|
if (_factory == address(0)) {
|
||||||
revert MaverickV2Executor__InvalidFactory();
|
revert MaverickV2Executor__InvalidFactory();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,12 +19,7 @@ contract UniswapV2Executor is IExecutor {
|
|||||||
address private immutable self;
|
address private immutable self;
|
||||||
uint256 public immutable feeBps;
|
uint256 public immutable feeBps;
|
||||||
|
|
||||||
constructor(
|
constructor(address _factory, bytes32 _initCode, uint256 _feeBps) {
|
||||||
address _factory,
|
|
||||||
bytes32 _initCode,
|
|
||||||
address _permit2,
|
|
||||||
uint256 _feeBps
|
|
||||||
) {
|
|
||||||
if (_factory == address(0)) {
|
if (_factory == address(0)) {
|
||||||
revert UniswapV2Executor__InvalidFactory();
|
revert UniswapV2Executor__InvalidFactory();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,19 +101,17 @@ contract TychoRouterTestSetup is Constants, Permit2TestHelper, TestUtils {
|
|||||||
address ekuboCore = 0xe0e0e08A6A4b9Dc7bD67BCB7aadE5cF48157d444;
|
address ekuboCore = 0xe0e0e08A6A4b9Dc7bD67BCB7aadE5cF48157d444;
|
||||||
|
|
||||||
IPoolManager poolManager = IPoolManager(poolManagerAddress);
|
IPoolManager poolManager = IPoolManager(poolManagerAddress);
|
||||||
usv2Executor =
|
usv2Executor = new UniswapV2Executor(factoryV2, initCodeV2, 30);
|
||||||
new UniswapV2Executor(factoryV2, initCodeV2, PERMIT2_ADDRESS, 30);
|
|
||||||
usv3Executor =
|
usv3Executor =
|
||||||
new UniswapV3Executor(factoryV3, initCodeV3, PERMIT2_ADDRESS);
|
new UniswapV3Executor(factoryV3, initCodeV3, PERMIT2_ADDRESS);
|
||||||
usv4Executor = new UniswapV4Executor(poolManager, PERMIT2_ADDRESS);
|
usv4Executor = new UniswapV4Executor(poolManager, PERMIT2_ADDRESS);
|
||||||
pancakev3Executor = new UniswapV3Executor(
|
pancakev3Executor = new UniswapV3Executor(
|
||||||
factoryPancakeV3, initCodePancakeV3, PERMIT2_ADDRESS
|
factoryPancakeV3, initCodePancakeV3, PERMIT2_ADDRESS
|
||||||
);
|
);
|
||||||
balancerv2Executor = new BalancerV2Executor(PERMIT2_ADDRESS);
|
balancerv2Executor = new BalancerV2Executor();
|
||||||
ekuboExecutor = new EkuboExecutor(ekuboCore, PERMIT2_ADDRESS);
|
ekuboExecutor = new EkuboExecutor(ekuboCore, PERMIT2_ADDRESS);
|
||||||
curveExecutor = new CurveExecutor(ETH_ADDR_FOR_CURVE, PERMIT2_ADDRESS);
|
curveExecutor = new CurveExecutor(ETH_ADDR_FOR_CURVE);
|
||||||
maverickv2Executor =
|
maverickv2Executor = new MaverickV2Executor(MAVERICK_V2_FACTORY);
|
||||||
new MaverickV2Executor(MAVERICK_V2_FACTORY, PERMIT2_ADDRESS);
|
|
||||||
|
|
||||||
address[] memory executors = new address[](8);
|
address[] memory executors = new address[](8);
|
||||||
executors[0] = address(usv2Executor);
|
executors[0] = address(usv2Executor);
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import "@src/executors/BalancerV2Executor.sol";
|
|||||||
import {Constants} from "../Constants.sol";
|
import {Constants} from "../Constants.sol";
|
||||||
|
|
||||||
contract BalancerV2ExecutorExposed is BalancerV2Executor {
|
contract BalancerV2ExecutorExposed is BalancerV2Executor {
|
||||||
constructor(address _permit2) BalancerV2Executor(_permit2) {}
|
|
||||||
|
|
||||||
function decodeParams(bytes calldata data)
|
function decodeParams(bytes calldata data)
|
||||||
external
|
external
|
||||||
pure
|
pure
|
||||||
@@ -36,7 +34,7 @@ contract BalancerV2ExecutorTest is Constants, TestUtils {
|
|||||||
function setUp() public {
|
function setUp() public {
|
||||||
uint256 forkBlock = 17323404;
|
uint256 forkBlock = 17323404;
|
||||||
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
||||||
balancerV2Exposed = new BalancerV2ExecutorExposed(PERMIT2_ADDRESS);
|
balancerV2Exposed = new BalancerV2ExecutorExposed();
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDecodeParams() public view {
|
function testDecodeParams() public view {
|
||||||
|
|||||||
@@ -22,9 +22,7 @@ interface MetaRegistry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
contract CurveExecutorExposed is CurveExecutor {
|
contract CurveExecutorExposed is CurveExecutor {
|
||||||
constructor(address _nativeToken, address _permit2)
|
constructor(address _nativeToken) CurveExecutor(_nativeToken) {}
|
||||||
CurveExecutor(_nativeToken, _permit2)
|
|
||||||
{}
|
|
||||||
|
|
||||||
function decodeData(bytes calldata data)
|
function decodeData(bytes calldata data)
|
||||||
external
|
external
|
||||||
@@ -54,8 +52,7 @@ contract CurveExecutorTest is Test, Constants {
|
|||||||
function setUp() public {
|
function setUp() public {
|
||||||
uint256 forkBlock = 22031795;
|
uint256 forkBlock = 22031795;
|
||||||
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
||||||
curveExecutorExposed =
|
curveExecutorExposed = new CurveExecutorExposed(ETH_ADDR_FOR_CURVE);
|
||||||
new CurveExecutorExposed(ETH_ADDR_FOR_CURVE, PERMIT2_ADDRESS);
|
|
||||||
metaRegistry = MetaRegistry(CURVE_META_REGISTRY);
|
metaRegistry = MetaRegistry(CURVE_META_REGISTRY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ import {Constants} from "../Constants.sol";
|
|||||||
import "../TestUtils.sol";
|
import "../TestUtils.sol";
|
||||||
|
|
||||||
contract MaverickV2ExecutorExposed is MaverickV2Executor {
|
contract MaverickV2ExecutorExposed is MaverickV2Executor {
|
||||||
constructor(address _factory, address _permit2)
|
constructor(address _factory) MaverickV2Executor(_factory) {}
|
||||||
MaverickV2Executor(_factory, _permit2)
|
|
||||||
{}
|
|
||||||
|
|
||||||
function decodeParams(bytes calldata data)
|
function decodeParams(bytes calldata data)
|
||||||
external
|
external
|
||||||
@@ -34,8 +32,7 @@ contract MaverickV2ExecutorTest is TestUtils, Constants {
|
|||||||
function setUp() public {
|
function setUp() public {
|
||||||
uint256 forkBlock = 22096000;
|
uint256 forkBlock = 22096000;
|
||||||
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
||||||
maverickV2Exposed =
|
maverickV2Exposed = new MaverickV2ExecutorExposed(MAVERICK_V2_FACTORY);
|
||||||
new MaverickV2ExecutorExposed(MAVERICK_V2_FACTORY, PERMIT2_ADDRESS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDecodeParams() public view {
|
function testDecodeParams() public view {
|
||||||
|
|||||||
@@ -8,12 +8,9 @@ import {Permit2TestHelper} from "../Permit2TestHelper.sol";
|
|||||||
import {Test} from "../../lib/forge-std/src/Test.sol";
|
import {Test} from "../../lib/forge-std/src/Test.sol";
|
||||||
|
|
||||||
contract UniswapV2ExecutorExposed is UniswapV2Executor {
|
contract UniswapV2ExecutorExposed is UniswapV2Executor {
|
||||||
constructor(
|
constructor(address _factory, bytes32 _initCode, uint256 _feeBps)
|
||||||
address _factory,
|
UniswapV2Executor(_factory, _initCode, _feeBps)
|
||||||
bytes32 _initCode,
|
{}
|
||||||
address _permit2,
|
|
||||||
uint256 _feeBps
|
|
||||||
) UniswapV2Executor(_factory, _initCode, _permit2, _feeBps) {}
|
|
||||||
|
|
||||||
function decodeParams(bytes calldata data)
|
function decodeParams(bytes calldata data)
|
||||||
external
|
external
|
||||||
@@ -65,19 +62,13 @@ contract UniswapV2ExecutorTest is Constants, Permit2TestHelper, TestUtils {
|
|||||||
uint256 forkBlock = 17323404;
|
uint256 forkBlock = 17323404;
|
||||||
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
||||||
uniswapV2Exposed = new UniswapV2ExecutorExposed(
|
uniswapV2Exposed = new UniswapV2ExecutorExposed(
|
||||||
USV2_FACTORY_ETHEREUM, USV2_POOL_CODE_INIT_HASH, PERMIT2_ADDRESS, 30
|
USV2_FACTORY_ETHEREUM, USV2_POOL_CODE_INIT_HASH, 30
|
||||||
);
|
);
|
||||||
sushiswapV2Exposed = new UniswapV2ExecutorExposed(
|
sushiswapV2Exposed = new UniswapV2ExecutorExposed(
|
||||||
SUSHISWAPV2_FACTORY_ETHEREUM,
|
SUSHISWAPV2_FACTORY_ETHEREUM, SUSHIV2_POOL_CODE_INIT_HASH, 30
|
||||||
SUSHIV2_POOL_CODE_INIT_HASH,
|
|
||||||
PERMIT2_ADDRESS,
|
|
||||||
30
|
|
||||||
);
|
);
|
||||||
pancakeswapV2Exposed = new UniswapV2ExecutorExposed(
|
pancakeswapV2Exposed = new UniswapV2ExecutorExposed(
|
||||||
PANCAKESWAPV2_FACTORY_ETHEREUM,
|
PANCAKESWAPV2_FACTORY_ETHEREUM, PANCAKEV2_POOL_CODE_INIT_HASH, 25
|
||||||
PANCAKEV2_POOL_CODE_INIT_HASH,
|
|
||||||
PERMIT2_ADDRESS,
|
|
||||||
25
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user