feat: Fix rollFork usage for Ekubo test
- Created methods to deploy the router and the executors. Whenever we use rollFork we need to redeploy everything! Notice that the addresses will be different then! - Created a test_executor_addresses.json to be used in the encoding tests, this way the calldata for the integration tests is already correct and we don't need to do any manual replacing (this was annoying). The addresses in this file match with the addresses used in the solidity tests --- don't change below this line --- ENG-4411 Took 1 hour 9 minutes Took 28 minutes Took 4 minutes Took 45 minutes
This commit is contained in:
12
config/test_executor_addresses.json
Normal file
12
config/test_executor_addresses.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"ethereum": {
|
||||||
|
"uniswap_v2": "0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f",
|
||||||
|
"sushiswap_v2": "0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f",
|
||||||
|
"pancakeswap_v2": "0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f",
|
||||||
|
"uniswap_v3": "0x2e234DAe75C793f67A35089C9d99245E1C58470b",
|
||||||
|
"pancakeswap_v3": "0x5991A2dF15A8F6A256D3Ec51E99254Cd3fb576A9",
|
||||||
|
"uniswap_v4": "0xF62849F9A0B5Bf2913b396098F7c7019b51A820a",
|
||||||
|
"vm:balancer_v2": "0xc7183455a4C133Ae270771860664b6B7ec320bB1",
|
||||||
|
"ekubo_v2": "0x2a07706473244BC757E10F2a9E86fB532828afe3"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -849,11 +849,8 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
vm.startPrank(ALICE);
|
vm.startPrank(ALICE);
|
||||||
IERC20(WETH_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
IERC20(WETH_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
||||||
// Encoded solution generated using `test_split_swap_strategy_encoder_simple`
|
// Encoded solution generated using `test_split_swap_strategy_encoder_simple`
|
||||||
// but manually replacing the executor address
|
|
||||||
// `5c2f5a71f67c01775180adc06909288b4c329308` with the one in this test
|
|
||||||
// `5615deb798bb3e4dfa0139dfa1b3d433cc23b72f`
|
|
||||||
(bool success,) = tychoRouterAddr.call(
|
(bool success,) = tychoRouterAddr.call(
|
||||||
hex"d499aa880000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000903146e5f6c59c064b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000067e4225a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067bc9c620000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000411fdbe0ac6bdafd51044f24b158235effa29797f468cd4684efa379053d3d15d47ed8b8206e3f6e7349f40aad231cc7e04ed25cbea1ac659b575be8cc168fc2361c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058005600010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a478c2975ab1ea89e8196811f51a7b7ade33eb113ede3eca2a72b3aecc820e955b36f38437d01395000000000000000000"
|
hex"d499aa880000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000903146e5f6c59c064b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000681362ea00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ebdcf2000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041a82e9bdde90314de4b1bf918cc2e8b27da98adcab46e8e99d4e77472a572d6381837e9453095f4cc5e9b25691b678288174e547e040a67d12b36ddfdd1e672d21b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058005600010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a478c2975ab1ea89e8196811f51a7b7ade33eb113ede3eca2a72b3aecc820e955b36f38437d01395000000000000000000"
|
||||||
);
|
);
|
||||||
|
|
||||||
vm.stopPrank();
|
vm.stopPrank();
|
||||||
@@ -874,9 +871,6 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
IERC20(WETH_ADDR).approve(address(tychoRouterAddr), 1 ether);
|
IERC20(WETH_ADDR).approve(address(tychoRouterAddr), 1 ether);
|
||||||
uint256 balancerBefore = IERC20(DAI_ADDR).balanceOf(ALICE);
|
uint256 balancerBefore = IERC20(DAI_ADDR).balanceOf(ALICE);
|
||||||
// Encoded solution generated using `test_split_swap_strategy_encoder_simple_route_no_permit2`
|
// Encoded solution generated using `test_split_swap_strategy_encoder_simple_route_no_permit2`
|
||||||
// but manually replacing the executor address
|
|
||||||
// `5c2f5a71f67c01775180adc06909288b4c329308` with the one in this test
|
|
||||||
// `5615deb798bb3e4dfa0139dfa1b3d433cc23b72f`
|
|
||||||
(bool success,) = tychoRouterAddr.call(
|
(bool success,) = tychoRouterAddr.call(
|
||||||
hex"0a83cb080000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000008f1d5c1cae37400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000058005600010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a478c2975ab1ea89e8196811f51a7b7ade33eb113ede3eca2a72b3aecc820e955b36f38437d01395000000000000000000"
|
hex"0a83cb080000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000008f1d5c1cae37400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000058005600010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a478c2975ab1ea89e8196811f51a7b7ade33eb113ede3eca2a72b3aecc820e955b36f38437d01395000000000000000000"
|
||||||
);
|
);
|
||||||
@@ -902,10 +896,8 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
vm.startPrank(ALICE);
|
vm.startPrank(ALICE);
|
||||||
IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
||||||
// Encoded solution generated using `test_split_encoding_strategy_usv4`
|
// Encoded solution generated using `test_split_encoding_strategy_usv4`
|
||||||
// and ensuring that the encoded executor address is the one in this test
|
|
||||||
// `f62849f9a0b5bf2913b396098f7c7019b51a820a`
|
|
||||||
(bool success,) = tychoRouterAddr.call(
|
(bool success,) = tychoRouterAddr.call(
|
||||||
hex"d499aa88000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000006982508145454ce325ddbe47a25d4ec3d23119330000000000000000000000000000000000000000005064ff624d54346285543f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000067e4237600000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067bc9d7e00000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000004166b5d3bb274c323e08eeba45d308cc9c11216f9aaafad2a22e94b94fec39293e5480f65f6238d7c8f1e8177f39118373e1041b0ab3a674d3041d119bdb6bc39c1b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008c008a0001000000f62849f9a0b5bf2913b396098f7c7019b51a820aa0b86991c6218b36c1d19d4a2e9eb0ce3606eb486982508145454ce325ddbe47a25d4ec3d231193300f62849f9a0b5bf2913b396098f7c7019b51a820a0000000000000000000000000000000000000000000bb800003c6982508145454ce325ddbe47a25d4ec3d23119330061a80001f40000000000000000000000000000000000000000"
|
hex"d499aa88000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000006982508145454ce325ddbe47a25d4ec3d23119330000000000000000000000000000000000000000005064ff624d54346285543f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000006813635000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ebdd58000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041a9d2d60e4e7751afcad957b3374d346882998bd46b7ba1c1194fde0e834ed6686c33c9588e7cf395d5cfc92b0c03d834e4087f4e8f64f0ff7579e4f1f93bb5051b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007800760001000000f62849f9a0b5bf2913b396098f7c7019b51a820aa0b86991c6218b36c1d19d4a2e9eb0ce3606eb486982508145454ce325ddbe47a25d4ec3d2311933000000000000000000000000000000000000000000000bb800003c6982508145454ce325ddbe47a25d4ec3d23119330061a80001f40000000000000000"
|
||||||
);
|
);
|
||||||
|
|
||||||
vm.stopPrank();
|
vm.stopPrank();
|
||||||
@@ -927,10 +919,8 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
uint256 balancerBefore = IERC20(PEPE_ADDR).balanceOf(ALICE);
|
uint256 balancerBefore = IERC20(PEPE_ADDR).balanceOf(ALICE);
|
||||||
|
|
||||||
// Encoded solution generated using `test_split_encoding_strategy_usv4_eth_in`
|
// Encoded solution generated using `test_split_encoding_strategy_usv4_eth_in`
|
||||||
// and ensuring that the encoded executor address is the one in this test
|
|
||||||
// `f62849f9a0b5bf2913b396098f7c7019b51a820a`
|
|
||||||
(bool success,) = tychoRouterAddr.call{value: 1 ether}(
|
(bool success,) = tychoRouterAddr.call{value: 1 ether}(
|
||||||
hex"d499aa880000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006982508145454ce325ddbe47a25d4ec3d2311933000000000000000000000000000000000000000000c87c939ae635f92dc2379c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000067f01a7800000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067c894800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000416642950b804a47a0abcb17d81cc2a7967d606e00e8de470e0e7827347658160a28b9892f147248b9bf31aad8faa06181aee0c4a612151e9ef4889991b9930b791b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007200700001000000f62849f9a0b5bf2913b396098f7c7019b51a820a00000000000000000000000000000000000000006982508145454ce325ddbe47a25d4ec3d231193301f62849f9a0b5bf2913b396098f7c7019b51a820a6982508145454ce325ddbe47a25d4ec3d23119330061a80001f40000000000000000000000000000"
|
hex"d499aa880000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006982508145454ce325ddbe47a25d4ec3d2311933000000000000000000000000000000000000000000c87c939ae635f92dc2379c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000006813636000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ebdd68000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041ca3b21ccc343ae30cfa6d1430e52701e379222f7345306e7ad5243760f590da26fb81a316249fdaa0686786c0d5e321718908a2ac4c74949b8657ebd7286d89f1c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005e005c0001000000f62849f9a0b5bf2913b396098f7c7019b51a820a00000000000000000000000000000000000000006982508145454ce325ddbe47a25d4ec3d2311933016982508145454ce325ddbe47a25d4ec3d23119330061a80001f40000"
|
||||||
);
|
);
|
||||||
|
|
||||||
vm.stopPrank();
|
vm.stopPrank();
|
||||||
@@ -956,10 +946,8 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
||||||
|
|
||||||
// Encoded solution generated using `test_split_encoding_strategy_usv4_eth_out`
|
// Encoded solution generated using `test_split_encoding_strategy_usv4_eth_out`
|
||||||
// and ensuring that the encoded executor address is the one in this test
|
|
||||||
// `f62849f9a0b5bf2913b396098f7c7019b51a820a`
|
|
||||||
(bool success,) = tychoRouterAddr.call(
|
(bool success,) = tychoRouterAddr.call(
|
||||||
hex"d499aa8800000000000000000000000000000000000000000000000000000000b2d05e00000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f81490b4f29aade000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000b2d05e000000000000000000000000000000000000000000000000000000000067f01af000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067c894f80000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000417811cd10b02278128a9e4df9ef2e099cff6ad46ec6ead5ba0b70dd1db5749d573cf4a8821a524bd6cc5b61ce0faf69d1d4b1f9233b93a4b203e79668f250b1a71c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007200700001000000f62849f9a0b5bf2913b396098f7c7019b51a820aa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000f62849f9a0b5bf2913b396098f7c7019b51a820a0000000000000000000000000000000000000000000bb800003c0000000000000000000000000000"
|
hex"d499aa8800000000000000000000000000000000000000000000000000000000b2d05e00000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f81490b4f29aade000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000b2d05e00000000000000000000000000000000000000000000000000000000006813637700000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ebdd7f000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041c94e2c4c06032716ba6f27c574e6e2aba6742f6c618dce347749aed82be3918754a405c2adf80fc544f8b45596462d6f3d2a2fb353b22e8929fdc4d01f2005761c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005e005c0001000000f62849f9a0b5bf2913b396098f7c7019b51a820aa0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000000000000000000000000000bb800003c0000"
|
||||||
);
|
);
|
||||||
|
|
||||||
vm.stopPrank();
|
vm.stopPrank();
|
||||||
@@ -982,13 +970,9 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
|
|
||||||
// Approve permit2
|
// Approve permit2
|
||||||
vm.startPrank(ALICE);
|
vm.startPrank(ALICE);
|
||||||
// Encoded solution generated using
|
// Encoded solution generated using `test_split_swap_strategy_encoder_simple_route_wrap`
|
||||||
// `test_split_swap_strategy_encoder_simple_route_wrap`
|
|
||||||
// but manually replacing the executor address
|
|
||||||
// `f6c5be66fff9dc69962d73da0a617a827c382329` with the one in this test
|
|
||||||
// `5615deb798bb3e4dfa0139dfa1b3d433cc23b72f`
|
|
||||||
(bool success,) = tychoRouterAddr.call{value: 1 ether}(
|
(bool success,) = tychoRouterAddr.call{value: 1 ether}(
|
||||||
hex"d499aa880000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000903146e5f6c59c064b000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000067f0192a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067c893320000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000419849ede1f59ad3092a3d8f6b5d7a4d3d854c8013d0a728b8556dc9744ddeed6c7edc4987c7724c280d493ca8dd55dd5aa5f5a66a66d85683f8a5b744908752a21b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058005600020000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a478c2975ab1ea89e8196811f51a7b7ade33eb113ede3eca2a72b3aecc820e955b36f38437d01395000000000000000000"
|
hex"d499aa880000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000903146e5f6c59c064b000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000006813638900000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ebdd91000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041f6ff7411a7ec76cb7dcafecf5e7f11121b1aa88af505635dc7faae6057e4f44e2859712f58331a14a1624f1e5edf2af80ddd2d90b5453d74df1b1fea10b9a2f91c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058005600020000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a478c2975ab1ea89e8196811f51a7b7ade33eb113ede3eca2a72b3aecc820e955b36f38437d01395000000000000000000"
|
||||||
);
|
);
|
||||||
|
|
||||||
vm.stopPrank();
|
vm.stopPrank();
|
||||||
@@ -1011,13 +995,9 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
// Approve permit2
|
// Approve permit2
|
||||||
vm.startPrank(ALICE);
|
vm.startPrank(ALICE);
|
||||||
IERC20(DAI_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
IERC20(DAI_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
||||||
// Encoded solution generated using
|
// Encoded solution generated using `test_split_swap_strategy_encoder_simple_route_unwrap`
|
||||||
// `test_split_swap_strategy_encoder_simple_route_unwrap`
|
|
||||||
// but manually replacing the executor address
|
|
||||||
// `f6c5be66fff9dc69962d73da0a617a827c382329` with the one in this test
|
|
||||||
// `5615deb798bb3e4dfa0139dfa1b3d433cc23b72f`
|
|
||||||
(bool success,) = tychoRouterAddr.call(
|
(bool success,) = tychoRouterAddr.call(
|
||||||
hex"d499aa880000000000000000000000000000000000000000000000a2a15d09519be000000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dbd2fc137a30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000a2a15d09519be000000000000000000000000000000000000000000000000000000000000067f017d700000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067c891df00000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000004181b0d9c7bbf7bd3270e22a7ff337b019b006ea60d9e357035b622bfc8e48126343fa9c1342383d3d072c2ddea2072fd5e447e7b6a4b56f5e7973963d18664e5d1b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058005600010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72f6b175474e89094c44da98b954eedeac495271d0fa478c2975ab1ea89e8196811f51a7b7ade33eb113ede3eca2a72b3aecc820e955b36f38437d01395010000000000000000"
|
hex"d499aa880000000000000000000000000000000000000000000000a2a15d09519be000000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000003000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000a2a15d09519be00000000000000000000000000000000000000000000000000000000000006813615200000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ebdb5a000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041a7da748b04674485a5da185055affefc85b6d8fe412accce55b6f67842116f0f7f7130de5d74c68c20e1cedcdf93b8741b9171de2e6a3f2567887382a0712e3f1b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058005600010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72f6b175474e89094c44da98b954eedeac495271d0fa478c2975ab1ea89e8196811f51a7b7ade33eb113ede3eca2a72b3aecc820e955b36f38437d01395010000000000000000"
|
||||||
);
|
);
|
||||||
|
|
||||||
vm.stopPrank();
|
vm.stopPrank();
|
||||||
@@ -1029,8 +1009,14 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function testEkuboIntegration() public {
|
function testEkuboIntegration() public {
|
||||||
vm.skip(true);
|
|
||||||
// Test needs to be run on block 22082754 or later
|
// Test needs to be run on block 22082754 or later
|
||||||
|
// notice that the addresses for the tycho router and the executors are different because we are redeploying
|
||||||
|
vm.rollFork(22082754);
|
||||||
|
tychoRouter = deployRouter();
|
||||||
|
address[] memory executors = deployExecutors();
|
||||||
|
vm.startPrank(EXECUTOR_SETTER);
|
||||||
|
tychoRouter.setExecutors(executors);
|
||||||
|
vm.stopPrank();
|
||||||
|
|
||||||
deal(ALICE, 1 ether);
|
deal(ALICE, 1 ether);
|
||||||
uint256 balancerBefore = IERC20(USDC_ADDR).balanceOf(ALICE);
|
uint256 balancerBefore = IERC20(USDC_ADDR).balanceOf(ALICE);
|
||||||
@@ -1038,8 +1024,8 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
// Approve permit2
|
// Approve permit2
|
||||||
vm.startPrank(ALICE);
|
vm.startPrank(ALICE);
|
||||||
// Encoded solution generated using `test_split_encoding_strategy_ekubo`
|
// Encoded solution generated using `test_split_encoding_strategy_ekubo`
|
||||||
(bool success,) = tychoRouterAddr.call{value: 1 ether}(
|
(bool success,) = address(tychoRouter).call{value: 1 ether}(
|
||||||
hex"0a83cb080000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000077007500010000005991a2df15a8f6a256d3ec51e99254cd3fb576a93ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4851d02a5948496a67827242eabc5725531342527c000000000000000000000000000000000000000000"
|
hex"0a83cb080000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000077007500010000002a07706473244bc757e10f2a9e86fb532828afe31d1499e622d69689cdf9004d05ec547d650ff2110000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4851d02a5948496a67827242eabc5725531342527c000000000000000000000000000000000000000000"
|
||||||
);
|
);
|
||||||
|
|
||||||
uint256 balancerAfter = IERC20(USDC_ADDR).balanceOf(ALICE);
|
uint256 balancerAfter = IERC20(USDC_ADDR).balanceOf(ALICE);
|
||||||
@@ -1068,11 +1054,8 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
vm.startPrank(ALICE);
|
vm.startPrank(ALICE);
|
||||||
IERC20(WETH_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
IERC20(WETH_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
||||||
// Encoded solution generated using `test_split_swap_strategy_encoder_complex`
|
// Encoded solution generated using `test_split_swap_strategy_encoder_complex`
|
||||||
// but manually replacing the executor address
|
|
||||||
// `f6c5be66FFf9DC69962d73da0A617a827c382329` with the one in this test
|
|
||||||
// `5615deb798bb3e4dfa0139dfa1b3d433cc23b72f`
|
|
||||||
(bool success,) = tychoRouterAddr.call(
|
(bool success,) = tychoRouterAddr.call(
|
||||||
hex"d499aa880000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000018f61ec000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000067f0198700000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067c8938f000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041308a3ba881e23ac794deca324cfd959b808c86bb239b81c9db8873c8392382411f87902e6ceb8e59636d8d6fab4ead1863727f9a2168246c93b678f3ae4ae37b1b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160005600028000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a478c2975ab1ea89e8196811f51a7b7ade33eb113ede3eca2a72b3aecc820e955b36f38437d0139500005600010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2bb2b8038a1640196fbe3e38816f3e67cba72d9403ede3eca2a72b3aecc820e955b36f38437d0139500005602030000005615deb798bb3e4dfa0139dfa1b3d433cc23b72f6b175474e89094c44da98b954eedeac495271d0fae461ca67b15dc8dc81ce7615e0320da1a9ab8d53ede3eca2a72b3aecc820e955b36f38437d0139501005601030000005615deb798bb3e4dfa0139dfa1b3d433cc23b72f2260fac5e5542a773aa44fbcfedf7c193bc2c599004375dff511095cc5a197a54140a24efef3a4163ede3eca2a72b3aecc820e955b36f38437d0139501"
|
hex"d499aa880000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000018f61ec000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000681363a300000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ebddab0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000415b7ff43991de10c4c3a0372653891d27eb305ce04228bfe46a7d84a0978063fc4cb05183f19b83511bcb689b002d4f8e170f1d3cd77cf18c638229ccb67e0cac1c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160005600028000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a478c2975ab1ea89e8196811f51a7b7ade33eb113ede3eca2a72b3aecc820e955b36f38437d0139500005600010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2bb2b8038a1640196fbe3e38816f3e67cba72d9403ede3eca2a72b3aecc820e955b36f38437d0139500005602030000005615deb798bb3e4dfa0139dfa1b3d433cc23b72f6b175474e89094c44da98b954eedeac495271d0fae461ca67b15dc8dc81ce7615e0320da1a9ab8d53ede3eca2a72b3aecc820e955b36f38437d0139501005601030000005615deb798bb3e4dfa0139dfa1b3d433cc23b72f2260fac5e5542a773aa44fbcfedf7c193bc2c599004375dff511095cc5a197a54140a24efef3a4163ede3eca2a72b3aecc820e955b36f38437d0139501"
|
||||||
);
|
);
|
||||||
|
|
||||||
vm.stopPrank();
|
vm.stopPrank();
|
||||||
@@ -1396,11 +1379,8 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
vm.startPrank(ALICE);
|
vm.startPrank(ALICE);
|
||||||
IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
||||||
// Encoded solution generated using `test_cyclic_sequential_swap`
|
// Encoded solution generated using `test_cyclic_sequential_swap`
|
||||||
// but manually replacing the executor address
|
|
||||||
// `dd8559c917393fc8dd2b4dd289c52ff445fde1b0` with the one in this test
|
|
||||||
// `2e234dae75c793f67a35089c9d99245e1c58470b`
|
|
||||||
(bool success,) = tychoRouterAddr.call(
|
(bool success,) = tychoRouterAddr.call(
|
||||||
hex"d499aa880000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f4308e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000000000000000000000000067f67a8b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067cef493000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041c07077fc73bb0f5129006061288fa0583c101631307377281d6b8f3feb50aa2d564f9948c92e0e4abc3771d592bd2f22ebb18ccf21b270459b05f272251ce1c71b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de006d00010000002e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f43ede3eca2a72b3aecc820e955b36f38437d0139588e6a0c2ddd26feeb64f039a2c41296fcb3f564001006d01000000002e234dae75c793f67a35089c9d99245e1c58470bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000bb83ede3eca2a72b3aecc820e955b36f38437d013958ad599c3a0ff1de082011efddc58f1908eb6e6d8000000"
|
hex"d499aa880000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f4308e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000000681363d200000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ebddda0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000418d58a54a3b8afc5d2e228ce6c5a1ab6b342cb5bfd9a00d57b869a4703ca2bb084d10d21f6842be9652a9ff2392673fbdcb961439ccc962de09f6bc64e5e665fe1c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de006d00010000002e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f43ede3eca2a72b3aecc820e955b36f38437d0139588e6a0c2ddd26feeb64f039a2c41296fcb3f564001006d01000000002e234dae75c793f67a35089c9d99245e1c58470bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000bb83ede3eca2a72b3aecc820e955b36f38437d013958ad599c3a0ff1de082011efddc58f1908eb6e6d8000000"
|
||||||
);
|
);
|
||||||
|
|
||||||
assertEq(IERC20(USDC_ADDR).balanceOf(ALICE), 99889294);
|
assertEq(IERC20(USDC_ADDR).balanceOf(ALICE), 99889294);
|
||||||
@@ -1415,11 +1395,8 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
vm.startPrank(ALICE);
|
vm.startPrank(ALICE);
|
||||||
IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
||||||
// Encoded solution generated using `test_split_input_cyclic_swap`
|
// Encoded solution generated using `test_split_input_cyclic_swap`
|
||||||
// but manually replacing the executor addresses with the ones in this test
|
|
||||||
// `dd8559c917393fc8dd2b4dd289c52ff445fde1b0` to `2e234dae75c793f67a35089c9d99245e1c58470b`
|
|
||||||
// `f6c5be66fff9dc69962d73da0a617a827c382329` to `5615deb798bb3e4dfa0139dfa1b3d433cc23b72f`
|
|
||||||
(bool success,) = tychoRouterAddr.call(
|
(bool success,) = tychoRouterAddr.call(
|
||||||
hex"d499aa880000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005ef619b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000000000000000000000000067f6c08700000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067cf3a8f000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041f248bfa39e6801b4173cd4d61e5e5d0c31942eb3c194785f964a82b2c3e05b4b302bccc0924fa4c4ef90854e42865db11f458d3b6a62afddee833f3eb069cd521b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000136006d00019999992e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f43ede3eca2a72b3aecc820e955b36f38437d0139588e6a0c2ddd26feeb64f039a2c41296fcb3f564001006d00010000002e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000bb83ede3eca2a72b3aecc820e955b36f38437d013958ad599c3a0ff1de082011efddc58f1908eb6e6d801005601000000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2b4e16d0168e52d35cacd2c6185b44281ec28c9dc3ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000"
|
hex"d499aa880000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005ef619b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000000681363ee00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ebddf6000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041358738c580b15c5aeb2cd79615e7405569255d599e45d2d537805c4d403a8ce4198cdde7c328a881afeb2f5dc721c5d13dfae03ded6e8e958a96e303e7fa07e91b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000136006d00019999992e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f43ede3eca2a72b3aecc820e955b36f38437d0139588e6a0c2ddd26feeb64f039a2c41296fcb3f564001006d00010000002e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000bb83ede3eca2a72b3aecc820e955b36f38437d013958ad599c3a0ff1de082011efddc58f1908eb6e6d801005601000000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2b4e16d0168e52d35cacd2c6185b44281ec28c9dc3ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000"
|
||||||
);
|
);
|
||||||
|
|
||||||
assertEq(IERC20(USDC_ADDR).balanceOf(ALICE), 99574171);
|
assertEq(IERC20(USDC_ADDR).balanceOf(ALICE), 99574171);
|
||||||
@@ -1434,11 +1411,8 @@ contract TychoRouterTest is TychoRouterTestSetup {
|
|||||||
vm.startPrank(ALICE);
|
vm.startPrank(ALICE);
|
||||||
IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max);
|
||||||
// Encoded solution generated using `test_split_output_cyclic_swap`
|
// Encoded solution generated using `test_split_output_cyclic_swap`
|
||||||
// but manually replacing the executor addresses with the ones in this test
|
|
||||||
// `dd8559c917393fc8dd2b4dd289c52ff445fde1b0` to `2e234dae75c793f67a35089c9d99245e1c58470b`
|
|
||||||
// `f6c5be66fff9dc69962d73da0a617a827c382329` to `5615deb798bb3e4dfa0139dfa1b3d433cc23b72f`
|
|
||||||
(bool success,) = tychoRouterAddr.call(
|
(bool success,) = tychoRouterAddr.call(
|
||||||
hex"d499aa880000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005eea514000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000000000000000000000000067f6be9400000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067cf389c000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041c02ad8eceede50085f35ce8e8313ebbac9b379396c6e72a35bb4df0970cbdaaa1a91e6f787641af55b13b926199c844df42fdd2ae7bb287db7e5cc2a8bc1d7f51b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000136005600010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48b4e16d0168e52d35cacd2c6185b44281ec28c9dc3ede3eca2a72b3aecc820e955b36f38437d0139501006d01009999992e234dae75c793f67a35089c9d99245e1c58470bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480001f43ede3eca2a72b3aecc820e955b36f38437d0139588e6a0c2ddd26feeb64f039a2c41296fcb3f564000006d01000000002e234dae75c793f67a35089c9d99245e1c58470bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000bb83ede3eca2a72b3aecc820e955b36f38437d013958ad599c3a0ff1de082011efddc58f1908eb6e6d80000000000000000000000"
|
hex"d499aa880000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005eea514000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000000000000000000000000000000000006813641000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ebde18000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041261a267c7d90a230d7f6d0917652953ef5cdaaabc80234a0c3d39ca20687f5af0b56421d0b0bec01d5ba66dd435d7cd63e95abcea114aa9fef6fe9d77589c12e1b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000136005600010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48b4e16d0168e52d35cacd2c6185b44281ec28c9dc3ede3eca2a72b3aecc820e955b36f38437d0139501006d01009999992e234dae75c793f67a35089c9d99245e1c58470bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480001f43ede3eca2a72b3aecc820e955b36f38437d0139588e6a0c2ddd26feeb64f039a2c41296fcb3f564000006d01000000002e234dae75c793f67a35089c9d99245e1c58470bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000bb83ede3eca2a72b3aecc820e955b36f38437d013958ad599c3a0ff1de082011efddc58f1908eb6e6d80000000000000000000000"
|
||||||
);
|
);
|
||||||
|
|
||||||
assertEq(IERC20(USDC_ADDR).balanceOf(ALICE), 99525908);
|
assertEq(IERC20(USDC_ADDR).balanceOf(ALICE), 99525908);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// SPDX-License-Identifier: BUSL-1.1
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
pragma solidity ^0.8.26;
|
pragma solidity ^0.8.26;
|
||||||
|
|
||||||
|
import "../src/executors/BalancerV2Executor.sol";
|
||||||
|
import "../src/executors/EkuboExecutor.sol";
|
||||||
import "../src/executors/UniswapV2Executor.sol";
|
import "../src/executors/UniswapV2Executor.sol";
|
||||||
import "../src/executors/UniswapV3Executor.sol";
|
import "../src/executors/UniswapV3Executor.sol";
|
||||||
import "../src/executors/UniswapV4Executor.sol";
|
import "../src/executors/UniswapV4Executor.sol";
|
||||||
@@ -8,9 +10,8 @@ import "./Constants.sol";
|
|||||||
import "./mock/MockERC20.sol";
|
import "./mock/MockERC20.sol";
|
||||||
import "@src/TychoRouter.sol";
|
import "@src/TychoRouter.sol";
|
||||||
import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
|
import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol";
|
||||||
import {WETH} from "../lib/permit2/lib/solmate/src/tokens/WETH.sol";
|
|
||||||
import {PoolManager} from "@uniswap/v4-core/src/PoolManager.sol";
|
import {PoolManager} from "@uniswap/v4-core/src/PoolManager.sol";
|
||||||
import "../src/executors/EkuboExecutor.sol";
|
import {WETH} from "../lib/permit2/lib/solmate/src/tokens/WETH.sol";
|
||||||
|
|
||||||
contract TychoRouterExposed is TychoRouter {
|
contract TychoRouterExposed is TychoRouter {
|
||||||
constructor(address _permit2, address weth) TychoRouter(_permit2, weth) {}
|
constructor(address _permit2, address weth) TychoRouter(_permit2, weth) {}
|
||||||
@@ -39,6 +40,7 @@ contract TychoRouterTestSetup is Test, Constants {
|
|||||||
UniswapV3Executor public usv3Executor;
|
UniswapV3Executor public usv3Executor;
|
||||||
UniswapV3Executor public pancakev3Executor;
|
UniswapV3Executor public pancakev3Executor;
|
||||||
UniswapV4Executor public usv4Executor;
|
UniswapV4Executor public usv4Executor;
|
||||||
|
BalancerV2Executor public balancerv2Executor;
|
||||||
EkuboExecutor public ekuboExecutor;
|
EkuboExecutor public ekuboExecutor;
|
||||||
MockERC20[] tokens;
|
MockERC20[] tokens;
|
||||||
|
|
||||||
@@ -47,6 +49,36 @@ contract TychoRouterTestSetup is Test, Constants {
|
|||||||
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
||||||
|
|
||||||
vm.startPrank(ADMIN);
|
vm.startPrank(ADMIN);
|
||||||
|
tychoRouter = deployRouter();
|
||||||
|
deployDummyContract();
|
||||||
|
vm.stopPrank();
|
||||||
|
|
||||||
|
address[] memory executors = deployExecutors();
|
||||||
|
vm.startPrank(EXECUTOR_SETTER);
|
||||||
|
tychoRouter.setExecutors(executors);
|
||||||
|
vm.stopPrank();
|
||||||
|
|
||||||
|
vm.startPrank(BOB);
|
||||||
|
tokens.push(new MockERC20("Token A", "A"));
|
||||||
|
tokens.push(new MockERC20("Token B", "B"));
|
||||||
|
tokens.push(new MockERC20("Token C", "C"));
|
||||||
|
vm.stopPrank();
|
||||||
|
}
|
||||||
|
|
||||||
|
function deployRouter() public returns (TychoRouterExposed) {
|
||||||
|
tychoRouter = new TychoRouterExposed(PERMIT2_ADDRESS, WETH_ADDR);
|
||||||
|
tychoRouterAddr = address(tychoRouter);
|
||||||
|
tychoRouter.grantRole(keccak256("FUND_RESCUER_ROLE"), FUND_RESCUER);
|
||||||
|
tychoRouter.grantRole(keccak256("FEE_SETTER_ROLE"), FEE_SETTER);
|
||||||
|
tychoRouter.grantRole(keccak256("PAUSER_ROLE"), PAUSER);
|
||||||
|
tychoRouter.grantRole(keccak256("UNPAUSER_ROLE"), UNPAUSER);
|
||||||
|
tychoRouter.grantRole(
|
||||||
|
keccak256("EXECUTOR_SETTER_ROLE"), EXECUTOR_SETTER
|
||||||
|
);
|
||||||
|
return tychoRouter;
|
||||||
|
}
|
||||||
|
|
||||||
|
function deployExecutors() public returns (address[] memory) {
|
||||||
address factoryV2 = USV2_FACTORY_ETHEREUM;
|
address factoryV2 = USV2_FACTORY_ETHEREUM;
|
||||||
address factoryV3 = USV3_FACTORY_ETHEREUM;
|
address factoryV3 = USV3_FACTORY_ETHEREUM;
|
||||||
address factoryPancakeV3 = PANCAKESWAPV3_DEPLOYER_ETHEREUM;
|
address factoryPancakeV3 = PANCAKESWAPV3_DEPLOYER_ETHEREUM;
|
||||||
@@ -57,40 +89,22 @@ contract TychoRouterTestSetup is Test, Constants {
|
|||||||
address ekuboCore = 0xe0e0e08A6A4b9Dc7bD67BCB7aadE5cF48157d444;
|
address ekuboCore = 0xe0e0e08A6A4b9Dc7bD67BCB7aadE5cF48157d444;
|
||||||
|
|
||||||
IPoolManager poolManager = IPoolManager(poolManagerAddress);
|
IPoolManager poolManager = IPoolManager(poolManagerAddress);
|
||||||
tychoRouter = new TychoRouterExposed(PERMIT2_ADDRESS, WETH_ADDR);
|
|
||||||
tychoRouterAddr = address(tychoRouter);
|
|
||||||
tychoRouter.grantRole(keccak256("FUND_RESCUER_ROLE"), FUND_RESCUER);
|
|
||||||
tychoRouter.grantRole(keccak256("FEE_SETTER_ROLE"), FEE_SETTER);
|
|
||||||
tychoRouter.grantRole(keccak256("PAUSER_ROLE"), PAUSER);
|
|
||||||
tychoRouter.grantRole(keccak256("UNPAUSER_ROLE"), UNPAUSER);
|
|
||||||
tychoRouter.grantRole(
|
|
||||||
keccak256("EXECUTOR_SETTER_ROLE"), EXECUTOR_SETTER
|
|
||||||
);
|
|
||||||
deployDummyContract();
|
|
||||||
vm.stopPrank();
|
|
||||||
|
|
||||||
usv2Executor = new UniswapV2Executor(factoryV2, initCodeV2);
|
usv2Executor = new UniswapV2Executor(factoryV2, initCodeV2);
|
||||||
usv3Executor = new UniswapV3Executor(factoryV3, initCodeV3);
|
usv3Executor = new UniswapV3Executor(factoryV3, initCodeV3);
|
||||||
usv4Executor = new UniswapV4Executor(poolManager);
|
usv4Executor = new UniswapV4Executor(poolManager);
|
||||||
pancakev3Executor =
|
pancakev3Executor =
|
||||||
new UniswapV3Executor(factoryPancakeV3, initCodePancakeV3);
|
new UniswapV3Executor(factoryPancakeV3, initCodePancakeV3);
|
||||||
|
balancerv2Executor = new BalancerV2Executor();
|
||||||
ekuboExecutor = new EkuboExecutor(ekuboCore);
|
ekuboExecutor = new EkuboExecutor(ekuboCore);
|
||||||
|
|
||||||
vm.startPrank(EXECUTOR_SETTER);
|
address[] memory executors = new address[](6);
|
||||||
address[] memory executors = new address[](5);
|
|
||||||
executors[0] = address(usv2Executor);
|
executors[0] = address(usv2Executor);
|
||||||
executors[1] = address(usv3Executor);
|
executors[1] = address(usv3Executor);
|
||||||
executors[2] = address(pancakev3Executor);
|
executors[2] = address(pancakev3Executor);
|
||||||
executors[3] = address(usv4Executor);
|
executors[3] = address(usv4Executor);
|
||||||
executors[4] = address(ekuboExecutor);
|
executors[4] = address(balancerv2Executor);
|
||||||
tychoRouter.setExecutors(executors);
|
executors[5] = address(ekuboExecutor);
|
||||||
vm.stopPrank();
|
return executors;
|
||||||
|
|
||||||
vm.startPrank(BOB);
|
|
||||||
tokens.push(new MockERC20("Token A", "A"));
|
|
||||||
tokens.push(new MockERC20("Token B", "B"));
|
|
||||||
tokens.push(new MockERC20("Token C", "C"));
|
|
||||||
vm.stopPrank();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -385,7 +385,8 @@ mod tests {
|
|||||||
|
|
||||||
fn get_swap_encoder_registry() -> SwapEncoderRegistry {
|
fn get_swap_encoder_registry() -> SwapEncoderRegistry {
|
||||||
let eth_chain = eth_chain();
|
let eth_chain = eth_chain();
|
||||||
SwapEncoderRegistry::new(None, eth_chain).unwrap()
|
SwapEncoderRegistry::new(Some("config/test_executor_addresses.json".to_string()), eth_chain)
|
||||||
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -428,7 +429,7 @@ mod tests {
|
|||||||
let hex_protocol_data = encode(&protocol_data);
|
let hex_protocol_data = encode(&protocol_data);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
executor_address,
|
executor_address,
|
||||||
Bytes::from_str("0xf6c5be66FFf9DC69962d73da0A617a827c382329").unwrap()
|
Bytes::from_str("0x5615deb798bb3e4dfa0139dfa1b3d433cc23b72f").unwrap()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
hex_protocol_data,
|
hex_protocol_data,
|
||||||
@@ -551,7 +552,7 @@ mod tests {
|
|||||||
let hex_protocol_data = encode(&protocol_data);
|
let hex_protocol_data = encode(&protocol_data);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
executor_address,
|
executor_address,
|
||||||
Bytes::from_str("0x042C0ebBEAb9d9987c2f64Ee05f2B3aeB86eAf70").unwrap()
|
Bytes::from_str("0xf62849f9a0b5bf2913b396098f7c7019b51a820a").unwrap()
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
hex_protocol_data,
|
hex_protocol_data,
|
||||||
@@ -692,7 +693,7 @@ mod tests {
|
|||||||
"01", // token out index
|
"01", // token out index
|
||||||
"000000", // split
|
"000000", // split
|
||||||
// Swap data
|
// Swap data
|
||||||
"f6c5be66fff9dc69962d73da0a617a827c382329", // executor address
|
"5615deb798bb3e4dfa0139dfa1b3d433cc23b72f", // executor address
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
||||||
"a478c2975ab1ea89e8196811f51a7b7ade33eb11", // component id
|
"a478c2975ab1ea89e8196811f51a7b7ade33eb11", // component id
|
||||||
"3ede3eca2a72b3aecc820e955b36f38437d01395", // receiver
|
"3ede3eca2a72b3aecc820e955b36f38437d01395", // receiver
|
||||||
@@ -1025,7 +1026,7 @@ mod tests {
|
|||||||
"01", // token out index
|
"01", // token out index
|
||||||
"000000", // split
|
"000000", // split
|
||||||
// Swap data header
|
// Swap data header
|
||||||
"042c0ebbeab9d9987c2f64ee05f2b3aeb86eaf70", // executor address
|
"f62849f9a0b5bf2913b396098f7c7019b51a820a", // executor address
|
||||||
// Protocol data
|
// Protocol data
|
||||||
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // group token in
|
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // group token in
|
||||||
"6982508145454ce325ddbe47a25d4ec3d2311933", // group token in
|
"6982508145454ce325ddbe47a25d4ec3d2311933", // group token in
|
||||||
@@ -1081,7 +1082,7 @@ mod tests {
|
|||||||
eth_chain(),
|
eth_chain(),
|
||||||
swap_encoder_registry,
|
swap_encoder_registry,
|
||||||
None,
|
None,
|
||||||
Some(Bytes::from_str("0x3Ede3eCa2a72B3aeCC820E955B36f38437D01395").unwrap()),
|
Some(Bytes::from_str("0x1d1499e622D69689cdf9004d05Ec547d650Ff211").unwrap()),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
@@ -1175,7 +1176,7 @@ mod tests {
|
|||||||
"01", // token out index
|
"01", // token out index
|
||||||
"000000", // split
|
"000000", // split
|
||||||
// Swap data
|
// Swap data
|
||||||
"f6c5be66fff9dc69962d73da0a617a827c382329", // executor address
|
"5615deb798bb3e4dfa0139dfa1b3d433cc23b72f", // executor address
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
||||||
"a478c2975ab1ea89e8196811f51a7b7ade33eb11", // component id
|
"a478c2975ab1ea89e8196811f51a7b7ade33eb11", // component id
|
||||||
"3ede3eca2a72b3aecc820e955b36f38437d01395", // receiver
|
"3ede3eca2a72b3aecc820e955b36f38437d01395", // receiver
|
||||||
@@ -1425,7 +1426,7 @@ mod tests {
|
|||||||
"00", // token in index
|
"00", // token in index
|
||||||
"01", // token out index
|
"01", // token out index
|
||||||
"000000", // split
|
"000000", // split
|
||||||
"dd8559c917393fc8dd2b4dd289c52ff445fde1b0", // executor address
|
"2e234dae75c793f67a35089c9d99245e1c58470b", // executor address
|
||||||
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token in
|
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token in
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token out
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token out
|
||||||
"0001f4", // pool fee
|
"0001f4", // pool fee
|
||||||
@@ -1435,7 +1436,7 @@ mod tests {
|
|||||||
"006d", // ple encoded swaps
|
"006d", // ple encoded swaps
|
||||||
"01", // token in index
|
"01", // token in index
|
||||||
"00000000", // split
|
"00000000", // split
|
||||||
"dd8559c917393fc8dd2b4dd289c52ff445fde1b0", // executor address
|
"2e234dae75c793f67a35089c9d99245e1c58470b", // executor address
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
||||||
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token out
|
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token out
|
||||||
"000bb8", // pool fee
|
"000bb8", // pool fee
|
||||||
@@ -1447,6 +1448,7 @@ mod tests {
|
|||||||
|
|
||||||
assert_eq!(hex_calldata[..520], expected_input);
|
assert_eq!(hex_calldata[..520], expected_input);
|
||||||
assert_eq!(hex_calldata[1288..], expected_swaps);
|
assert_eq!(hex_calldata[1288..], expected_swaps);
|
||||||
|
println!("{}", hex_calldata);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -1576,7 +1578,7 @@ mod tests {
|
|||||||
"00", // token in index
|
"00", // token in index
|
||||||
"01", // token out index
|
"01", // token out index
|
||||||
"999999", // split
|
"999999", // split
|
||||||
"dd8559c917393fc8dd2b4dd289c52ff445fde1b0", // executor address
|
"2e234dae75c793f67a35089c9d99245e1c58470b", // executor address
|
||||||
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token in
|
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token in
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token out
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token out
|
||||||
"0001f4", // pool fee
|
"0001f4", // pool fee
|
||||||
@@ -1587,7 +1589,7 @@ mod tests {
|
|||||||
"00", // token in index
|
"00", // token in index
|
||||||
"01", // token out index
|
"01", // token out index
|
||||||
"000000", // split
|
"000000", // split
|
||||||
"dd8559c917393fc8dd2b4dd289c52ff445fde1b0", // executor address
|
"2e234dae75c793f67a35089c9d99245e1c58470b", // executor address
|
||||||
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token in
|
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token in
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token out
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token out
|
||||||
"000bb8", // pool fee
|
"000bb8", // pool fee
|
||||||
@@ -1598,7 +1600,7 @@ mod tests {
|
|||||||
"01", // token in index
|
"01", // token in index
|
||||||
"00", // token out index
|
"00", // token out index
|
||||||
"000000", // split
|
"000000", // split
|
||||||
"f6c5be66fff9dc69962d73da0a617a827c382329", // executor address,
|
"5615deb798bb3e4dfa0139dfa1b3d433cc23b72f", // executor address,
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
||||||
"b4e16d0168e52d35cacd2c6185b44281ec28c9dc", // component id,
|
"b4e16d0168e52d35cacd2c6185b44281ec28c9dc", // component id,
|
||||||
"3ede3eca2a72b3aecc820e955b36f38437d01395", // router address
|
"3ede3eca2a72b3aecc820e955b36f38437d01395", // router address
|
||||||
@@ -1608,6 +1610,7 @@ mod tests {
|
|||||||
.join("");
|
.join("");
|
||||||
assert_eq!(hex_calldata[..520], expected_input);
|
assert_eq!(hex_calldata[..520], expected_input);
|
||||||
assert_eq!(hex_calldata[1288..], expected_swaps);
|
assert_eq!(hex_calldata[1288..], expected_swaps);
|
||||||
|
println!("{}", hex_calldata);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -1734,7 +1737,7 @@ mod tests {
|
|||||||
"00", // token in index
|
"00", // token in index
|
||||||
"01", // token out index
|
"01", // token out index
|
||||||
"000000", // split
|
"000000", // split
|
||||||
"f6c5be66fff9dc69962d73da0a617a827c382329", // executor address
|
"5615deb798bb3e4dfa0139dfa1b3d433cc23b72f", // executor address
|
||||||
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token in
|
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token in
|
||||||
"b4e16d0168e52d35cacd2c6185b44281ec28c9dc", // component id
|
"b4e16d0168e52d35cacd2c6185b44281ec28c9dc", // component id
|
||||||
"3ede3eca2a72b3aecc820e955b36f38437d01395", // router address
|
"3ede3eca2a72b3aecc820e955b36f38437d01395", // router address
|
||||||
@@ -1743,7 +1746,7 @@ mod tests {
|
|||||||
"01", // token in index
|
"01", // token in index
|
||||||
"00", // token out index
|
"00", // token out index
|
||||||
"999999", // split
|
"999999", // split
|
||||||
"dd8559c917393fc8dd2b4dd289c52ff445fde1b0", // executor address
|
"2e234dae75c793f67a35089c9d99245e1c58470b", // executor address
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
||||||
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token out
|
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token out
|
||||||
"0001f4", // pool fee
|
"0001f4", // pool fee
|
||||||
@@ -1754,7 +1757,7 @@ mod tests {
|
|||||||
"01", // token in index
|
"01", // token in index
|
||||||
"00", // token out index
|
"00", // token out index
|
||||||
"000000", // split
|
"000000", // split
|
||||||
"dd8559c917393fc8dd2b4dd289c52ff445fde1b0", // executor address
|
"2e234dae75c793f67a35089c9d99245e1c58470b", // executor address
|
||||||
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
||||||
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token out
|
"a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", // token out
|
||||||
"000bb8", // pool fee
|
"000bb8", // pool fee
|
||||||
@@ -1767,5 +1770,6 @@ mod tests {
|
|||||||
|
|
||||||
assert_eq!(hex_calldata[..520], expected_input);
|
assert_eq!(hex_calldata[..520], expected_input);
|
||||||
assert_eq!(hex_calldata[1288..], expected_swaps);
|
assert_eq!(hex_calldata[1288..], expected_swaps);
|
||||||
|
println!("{}", hex_calldata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user