test: add tests to generate runtime bytecode for the executors

This commit is contained in:
adrian
2025-09-09 11:29:32 +02:00
committed by Adrian Benavides
parent cefe7b1cfd
commit 299126da16
10 changed files with 37 additions and 4 deletions

1
foundry/test/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.runtime.json

View File

@@ -136,7 +136,6 @@ contract BalancerV2ExecutorTest is Constants, TestUtils {
}
function testExportContract() public {
vm.skip(true);
exportRuntimeBytecode(address(balancerV2Exposed), "BalancerV2");
}
}

View File

@@ -119,6 +119,10 @@ contract BalancerV3ExecutorTest is Constants, TestUtils {
assertGt(balanceAfter, balanceBefore);
assertEq(balanceAfter - balanceBefore, amountOut);
}
function testExportContract() public {
exportRuntimeBytecode(address(balancerV3Exposed), "BalancerV3");
}
}
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {

View File

@@ -46,7 +46,7 @@ contract CurveExecutorExposed is CurveExecutor {
}
}
contract CurveExecutorTest is Test, Constants {
contract CurveExecutorTest is Test, TestUtils, Constants {
using SafeERC20 for IERC20;
CurveExecutorExposed curveExecutorExposed;
@@ -393,6 +393,10 @@ contract CurveExecutorTest is Test, Constants {
metaRegistry.get_coin_indices(pool, tokenIn, tokenOut);
return (coinInIndex, coinOutIndex);
}
function testExportContract() public {
exportRuntimeBytecode(address(curveExecutorExposed), "Curve");
}
}
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {

View File

@@ -202,6 +202,10 @@ contract EkuboExecutorTest is Constants, TestUtils {
function testMultiHopSwapIntegration() public setUpFork(22082754) {
multiHopSwap(loadCallDataFromFile("test_ekubo_encode_swap_multi"));
}
function testExportContract() public {
exportRuntimeBytecode(address(executor), "Ekubo");
}
}
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {

View File

@@ -41,7 +41,7 @@ contract HashflowUtils is Test {
}
}
contract HashflowExecutorECR20Test is Constants, HashflowUtils {
contract HashflowExecutorECR20Test is Constants, TestUtils, HashflowUtils {
using SafeERC20 for IERC20;
HashflowExecutorExposed executor;

View File

@@ -126,6 +126,10 @@ contract MaverickV2ExecutorTest is TestUtils, Constants {
assertGt(balanceAfter, balanceBefore);
assertEq(balanceAfter - balanceBefore, amountOut);
}
function testExportContract() public {
exportRuntimeBytecode(address(maverickV2Exposed), "MaverickV2");
}
}
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {

View File

@@ -263,4 +263,8 @@ contract UniswapV2ExecutorTest is Constants, Permit2TestHelper, TestUtils {
assertEq(IERC20(BASE_MAG7).balanceOf(BOB), 1379830606);
}
function testExportContract() public {
exportRuntimeBytecode(address(uniswapV2Exposed), "UniswapV2");
}
}

View File

@@ -39,7 +39,12 @@ contract UniswapV3ExecutorExposed is UniswapV3Executor {
}
}
contract UniswapV3ExecutorTest is Test, Constants, Permit2TestHelper {
contract UniswapV3ExecutorTest is
Test,
TestUtils,
Constants,
Permit2TestHelper
{
using SafeERC20 for IERC20;
UniswapV3ExecutorExposed uniswapV3Exposed;
@@ -210,6 +215,10 @@ contract UniswapV3ExecutorTest is Test, Constants, Permit2TestHelper {
transferType
);
}
function testExportContract() public {
exportRuntimeBytecode(address(uniswapV3Exposed), "UniswapV3");
}
}
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {

View File

@@ -261,6 +261,10 @@ contract UniswapV4ExecutorTest is Constants, TestUtils {
);
assertTrue(IERC20(WETH_ADDR).balanceOf(ALICE) == amountOut);
}
function testExportContract() public {
exportRuntimeBytecode(address(uniswapV4Exposed), "UniswapV4");
}
}
contract TychoRouterForBalancerV3Test is TychoRouterTestSetup {