fix: make USV2 factory configurable in Executor

- This factory is not the same for Ethereum and Base, so Base txs were failing when verifying pool addresses.
- I've double checked that we don't have this problem for Balancer V2 - the vault address in the same on Base and on Ethereum Mainnet.
This commit is contained in:
TAMARA LIPOWSKI
2025-02-27 23:15:08 -05:00
parent 4b08910344
commit 33973a65b8
6 changed files with 35 additions and 13 deletions

View File

@@ -47,7 +47,8 @@ contract Constants is Test, BaseConstants {
address USDC_WBTC_POOL = 0x004375Dff511095CC5A197A54140a24eFEF3A416;
// uniswap v3
address USV3_FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
address USV3_FACTORY_ETHEREUM = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
address USV2_FACTORY_ETHEREUM = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
address DAI_WETH_USV3 = 0xC2e9F25Be6257c210d7Adf0D4Cd6E3E881ba25f8;
/**

View File

@@ -45,7 +45,8 @@ contract TychoRouterTestSetup is Test, Constants {
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
vm.startPrank(ADMIN);
address factoryV3 = USV3_FACTORY;
address factoryV3 = USV3_FACTORY_ETHEREUM;
address factoryV2 = USV2_FACTORY_ETHEREUM;
address poolManagerAddress = 0x000000000004444c5dc75cB358380D2e3dE08A90;
IPoolManager poolManager = IPoolManager(poolManagerAddress);
tychoRouter = new TychoRouterExposed(permit2Address, WETH_ADDR);
@@ -60,7 +61,7 @@ contract TychoRouterTestSetup is Test, Constants {
deployDummyContract();
vm.stopPrank();
usv2Executor = new UniswapV2Executor();
usv2Executor = new UniswapV2Executor(factoryV2);
usv3Executor = new UniswapV3Executor(factoryV3);
usv4Executor = new UniswapV4Executor(poolManager);
vm.startPrank(EXECUTOR_SETTER);

View File

@@ -6,6 +6,8 @@ import {Test} from "../../lib/forge-std/src/Test.sol";
import {Constants} from "../Constants.sol";
contract UniswapV2ExecutorExposed is UniswapV2Executor {
constructor(address _factory) UniswapV2Executor(_factory) {}
function decodeParams(bytes calldata data)
external
pure
@@ -42,7 +44,7 @@ contract FakeUniswapV2Pool {
}
}
contract UniswapV2ExecutorTest is UniswapV2ExecutorExposed, Test, Constants {
contract UniswapV2ExecutorTest is Test, Constants {
using SafeERC20 for IERC20;
UniswapV2ExecutorExposed uniswapV2Exposed;
@@ -52,7 +54,7 @@ contract UniswapV2ExecutorTest is UniswapV2ExecutorExposed, Test, Constants {
function setUp() public {
uint256 forkBlock = 17323404;
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
uniswapV2Exposed = new UniswapV2ExecutorExposed();
uniswapV2Exposed = new UniswapV2ExecutorExposed(USV2_FACTORY_ETHEREUM);
}
function testDecodeParams() public view {

View File

@@ -44,7 +44,7 @@ contract UniswapV3ExecutorTest is Test, Constants {
uint256 forkBlock = 17323404;
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
uniswapV3Exposed = new UniswapV3ExecutorExposed(USV3_FACTORY);
uniswapV3Exposed = new UniswapV3ExecutorExposed(USV3_FACTORY_ETHEREUM);
}
function testDecodeParams() public view {