From eb1aa6cdcd03a462ea8f1a5d35b0171d4c7531af Mon Sep 17 00:00:00 2001 From: Diana Carvalho Date: Wed, 16 Apr 2025 19:00:43 +0100 Subject: [PATCH] chore: Correct typo in all balancerAfter/Before (again) --- don't change below this line --- ENG-4314 Took 1 hour 14 minutes --- foundry/src/TychoRouter.sol | 1 - foundry/test/TychoRouterIntegration.t.sol | 68 +++++++++++------------ foundry/test/TychoRouterSingleSwap.t.sol | 12 ++-- 3 files changed, 40 insertions(+), 41 deletions(-) diff --git a/foundry/src/TychoRouter.sol b/foundry/src/TychoRouter.sol index f9597a1..9e244f3 100644 --- a/foundry/src/TychoRouter.sol +++ b/foundry/src/TychoRouter.sol @@ -537,7 +537,6 @@ contract TychoRouter is AccessControl, Dispatcher, Pausable, ReentrancyGuard { uint256 initialBalanceTokenOut = _balanceOf(tokenOut, receiver); amountOut = _sequentialSwap(amountIn, swaps); - uint256 currentBalanceTokenIn = _balanceOf(tokenIn, address(this)); if (amountOut < minAmountOut) { revert TychoRouter__NegativeSlippage(amountOut, minAmountOut); diff --git a/foundry/test/TychoRouterIntegration.t.sol b/foundry/test/TychoRouterIntegration.t.sol index f168175..c1ee318 100644 --- a/foundry/test/TychoRouterIntegration.t.sol +++ b/foundry/test/TychoRouterIntegration.t.sol @@ -9,16 +9,16 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { deal(WETH_ADDR, ALICE, 1 ether); vm.startPrank(ALICE); IERC20(WETH_ADDR).approve(address(tychoRouterAddr), 1 ether); - uint256 balancerBefore = IERC20(DAI_ADDR).balanceOf(ALICE); + uint256 balanceBefore = IERC20(DAI_ADDR).balanceOf(ALICE); // Encoded solution generated using `test_split_swap_strategy_encoder_no_permit2` (bool success,) = tychoRouterAddr.call( hex"79b9b93b0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000008f1d5c1cae37400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000059005700010000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a478c2975ab1ea89e8196811f51a7b7ade33eb11cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000100000000000000" ); vm.stopPrank(); - uint256 balancerAfter = IERC20(DAI_ADDR).balanceOf(ALICE); + uint256 balanceAfter = IERC20(DAI_ADDR).balanceOf(ALICE); assertTrue(success, "Call Failed"); - assertEq(balancerAfter - balancerBefore, 2659881924818443699787); + assertEq(balanceAfter - balanceBefore, 2659881924818443699787); } function testSplitUSV4Integration() public { @@ -30,7 +30,7 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { // USDC ──(USV4)──> ETH ───(USV4)──> PEPE // deal(USDC_ADDR, ALICE, 1 ether); - uint256 balancerBefore = IERC20(PEPE_ADDR).balanceOf(ALICE); + uint256 balanceBefore = IERC20(PEPE_ADDR).balanceOf(ALICE); // Approve permit2 vm.startPrank(ALICE); @@ -42,10 +42,10 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { vm.stopPrank(); - uint256 balancerAfter = IERC20(PEPE_ADDR).balanceOf(ALICE); + uint256 balanceAfter = IERC20(PEPE_ADDR).balanceOf(ALICE); assertTrue(success, "Call Failed"); - assertEq(balancerAfter - balancerBefore, 97191013220606467325121599); + assertEq(balanceAfter - balanceBefore, 97191013220606467325121599); } function testSplitUSV4IntegrationInputETH() public { @@ -56,7 +56,7 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { // ETH ───(USV4)──> PEPE // deal(ALICE, 1 ether); - uint256 balancerBefore = IERC20(PEPE_ADDR).balanceOf(ALICE); + uint256 balanceBefore = IERC20(PEPE_ADDR).balanceOf(ALICE); // Encoded solution generated using `test_split_encoding_strategy_usv4_eth_in` (bool success,) = tychoRouterAddr.call{value: 1 ether}( @@ -65,10 +65,10 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { vm.stopPrank(); - uint256 balancerAfter = IERC20(PEPE_ADDR).balanceOf(ALICE); + uint256 balanceAfter = IERC20(PEPE_ADDR).balanceOf(ALICE); assertTrue(success, "Call Failed"); - assertEq(balancerAfter - balancerBefore, 242373460199848577067005852); + assertEq(balanceAfter - balanceBefore, 242373460199848577067005852); } function testSplitUSV4IntegrationOutputETH() public { @@ -79,7 +79,7 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { // USDC ───(USV4)──> ETH // deal(USDC_ADDR, ALICE, 3000_000000); - uint256 balancerBefore = ALICE.balance; + uint256 balanceBefore = ALICE.balance; // Approve permit2 vm.startPrank(ALICE); @@ -92,18 +92,18 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { vm.stopPrank(); - uint256 balancerAfter = ALICE.balance; + uint256 balanceAfter = ALICE.balance; assertTrue(success, "Call Failed"); - console.logUint(balancerAfter - balancerBefore); - assertEq(balancerAfter - balancerBefore, 1117254495486192350); + console.logUint(balanceAfter - balanceBefore); + assertEq(balanceAfter - balanceBefore, 1117254495486192350); } function testSplitSwapSingleWithWrapIntegration() public { // Tests swapping WETH -> DAI on a USV2 pool, but ETH is received from the user // and wrapped before the swap deal(ALICE, 1 ether); - uint256 balancerBefore = IERC20(DAI_ADDR).balanceOf(ALICE); + uint256 balanceBefore = IERC20(DAI_ADDR).balanceOf(ALICE); // Approve permit2 vm.startPrank(ALICE); @@ -114,17 +114,17 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { vm.stopPrank(); - uint256 balancerAfter = IERC20(DAI_ADDR).balanceOf(ALICE); + uint256 balanceAfter = IERC20(DAI_ADDR).balanceOf(ALICE); assertTrue(success, "Call Failed"); - assertEq(balancerAfter - balancerBefore, 2659881924818443699787); + assertEq(balanceAfter - balanceBefore, 2659881924818443699787); } function testSplitSwapSingleWithUnwrapIntegration() public { // Tests swapping DAI -> WETH on a USV2 pool, and WETH is unwrapped to ETH // before sending back to the user deal(DAI_ADDR, ALICE, 3000 ether); - uint256 balancerBefore = ALICE.balance; + uint256 balanceBefore = ALICE.balance; // Approve permit2 vm.startPrank(ALICE); @@ -136,10 +136,10 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { vm.stopPrank(); - uint256 balancerAfter = ALICE.balance; + uint256 balanceAfter = ALICE.balance; assertTrue(success, "Call Failed"); - assertEq(balancerAfter - balancerBefore, 1120007305574805922); + assertEq(balanceAfter - balanceBefore, 1120007305574805922); } function testSplitEkuboIntegration() public { @@ -153,7 +153,7 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { vm.stopPrank(); deal(ALICE, 1 ether); - uint256 balancerBefore = IERC20(USDC_ADDR).balanceOf(ALICE); + uint256 balanceBefore = IERC20(USDC_ADDR).balanceOf(ALICE); // Approve permit2 vm.startPrank(ALICE); @@ -162,10 +162,10 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { hex"79b9b93b0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc200000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000078007600010000003d7ebc40af7092e3f1c81f2e996cba5cae2090d705cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc20000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4851d02a5948496a67827242eabc5725531342527c0000000000000000000000000000000000000000" ); - uint256 balancerAfter = IERC20(USDC_ADDR).balanceOf(ALICE); + uint256 balanceAfter = IERC20(USDC_ADDR).balanceOf(ALICE); assertTrue(success, "Call Failed"); - assertGe(balancerAfter - balancerBefore, 26173932); + assertGe(balanceAfter - balanceBefore, 26173932); assertEq(IERC20(WETH_ADDR).balanceOf(tychoRouterAddr), 0); } @@ -176,7 +176,7 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { // WETH ─┤ // └──(USV2)──> DAI ───(USV2)──> USDC deal(WETH_ADDR, ALICE, 1 ether); - uint256 balancerBefore = IERC20(USDC_ADDR).balanceOf(ALICE); + uint256 balanceBefore = IERC20(USDC_ADDR).balanceOf(ALICE); // Approve permit2 vm.startPrank(ALICE); @@ -188,10 +188,10 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { vm.stopPrank(); - uint256 balancerAfter = IERC20(USDC_ADDR).balanceOf(ALICE); + uint256 balanceAfter = IERC20(USDC_ADDR).balanceOf(ALICE); assertTrue(success, "Call Failed"); - assertGe(balancerAfter - balancerBefore, 26173932); + assertGe(balanceAfter - balanceBefore, 26173932); // All input tokens are transferred to the router at first. Make sure we used // all of it (and thus our splits are correct). @@ -203,22 +203,22 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { // // WETH ──(USV2)──> WBTC ───(USV2)──> USDC deal(WETH_ADDR, ALICE, 1 ether); - uint256 balancerBefore = IERC20(USDC_ADDR).balanceOf(ALICE); + uint256 balanceBefore = IERC20(USDC_ADDR).balanceOf(ALICE); // Approve permit2 vm.startPrank(ALICE); IERC20(WETH_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max); // Encoded solution generated using `test_sequential_swap_strategy_encoder_complex_route` (bool success,) = tychoRouterAddr.call( - hex"51bcc7b60000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000018f61ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000006826193a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067fe934200000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000041d137d0776bc16ff9c49bfd3e96103ceb6926654f314489cafcf5a64ab7a9c4f2061ed5ffdef67c33c3c5b78036d28d9eb73da156a0e68d8740235be50e88a3481b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a800525615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2bb2b8038a1640196fbe3e38816f3e67cba72d9403ede3eca2a72b3aecc820e955b36f38437d01395000200525615deb798bb3e4dfa0139dfa1b3d433cc23b72f2260fac5e5542a773aa44fbcfedf7c193bc2c599004375dff511095cc5a197a54140a24efef3a416cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc20100000000000000000000000000000000000000000000000000" + hex"51bcc7b60000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000018f61ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000682714ab00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ff8eb300000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000412fe66c22814eb271e37bb03303bae445eb96aa50fae9680a0ae685ee5795aebf1f5bb7718154c69680bcfc00cc9be525b2b021f57a1bddb4db622139acd425d41b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a800525615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2bb2b8038a1640196fbe3e38816f3e67cba72d940004375dff511095cc5a197a54140a24efef3a416000200525615deb798bb3e4dfa0139dfa1b3d433cc23b72f2260fac5e5542a773aa44fbcfedf7c193bc2c599004375dff511095cc5a197a54140a24efef3a416cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc20105000000000000000000000000000000000000000000000000" ); vm.stopPrank(); - uint256 balancerAfter = IERC20(USDC_ADDR).balanceOf(ALICE); + uint256 balanceAfter = IERC20(USDC_ADDR).balanceOf(ALICE); assertTrue(success, "Call Failed"); - assertEq(balancerAfter - balancerBefore, 2552915143); + assertEq(balanceAfter - balanceBefore, 2552915143); assertEq(IERC20(WETH_ADDR).balanceOf(tychoRouterAddr), 0); } @@ -227,22 +227,22 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { // // WETH ──(USV2)──> WBTC ───(USV2)──> USDC deal(WETH_ADDR, ALICE, 1 ether); - uint256 balancerBefore = IERC20(USDC_ADDR).balanceOf(ALICE); + uint256 balanceBefore = IERC20(USDC_ADDR).balanceOf(ALICE); // Approve permit2 vm.startPrank(ALICE); IERC20(WETH_ADDR).approve(tychoRouterAddr, type(uint256).max); // Encoded solution generated using `test_sequential_swap_strategy_encoder_no_permit2` (bool success,) = tychoRouterAddr.call( - hex"e8a980d70000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000018f61ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000a800525615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2bb2b8038a1640196fbe3e38816f3e67cba72d9403ede3eca2a72b3aecc820e955b36f38437d01395000100525615deb798bb3e4dfa0139dfa1b3d433cc23b72f2260fac5e5542a773aa44fbcfedf7c193bc2c599004375dff511095cc5a197a54140a24efef3a416cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc20100000000000000000000000000000000000000000000000000" + hex"e8a980d70000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000018f61ec00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000a800525615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2bb2b8038a1640196fbe3e38816f3e67cba72d940004375dff511095cc5a197a54140a24efef3a416000100525615deb798bb3e4dfa0139dfa1b3d433cc23b72f2260fac5e5542a773aa44fbcfedf7c193bc2c599004375dff511095cc5a197a54140a24efef3a416cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc20105000000000000000000000000000000000000000000000000" ); vm.stopPrank(); - uint256 balancerAfter = IERC20(USDC_ADDR).balanceOf(ALICE); + uint256 balanceAfter = IERC20(USDC_ADDR).balanceOf(ALICE); assertTrue(success, "Call Failed"); - assertEq(balancerAfter - balancerBefore, 2552915143); + assertEq(balanceAfter - balanceBefore, 2552915143); assertEq(IERC20(WETH_ADDR).balanceOf(tychoRouterAddr), 0); } @@ -254,7 +254,7 @@ contract TychoRouterTestIntegration is TychoRouterTestSetup { IERC20(USDC_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max); // Encoded solution generated using `test_cyclic_sequential_swap_split_strategy` (bool success,) = tychoRouterAddr.call( - hex"7c5538460000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f4308e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000000000000000000000000000000000006826193a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067fe934200000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000004194fc497ac440b520981d23b4713425da21dc1c801e657d218a917b5c51339a660b9a5fe0a346cb0aacc0d67ebf03f8fa3ec9fade437ef1b08ea837b2442931b61b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0006e00010000002e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f43ede3eca2a72b3aecc820e955b36f38437d0139588e6a0c2ddd26feeb64f039a2c41296fcb3f56400102006e01000000002e234dae75c793f67a35089c9d99245e1c58470bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000bb8cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc28ad599c3a0ff1de082011efddc58f1908eb6e6d80000" + hex"7c5538460000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f4308e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000000682714ab00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067ff8eb30000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000028000000000000000000000000000000000000000000000000000000000000000417badef4d6a9158869bdd061a492f6ca4eb4e012b9295f5562414f83ccbc37982241b4de1d934b4f9f0d51f792b12019f806953e7a7ba49d6cfe0487458753e871b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0006e00010000002e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f43ede3eca2a72b3aecc820e955b36f38437d0139588e6a0c2ddd26feeb64f039a2c41296fcb3f56400102006e01000000002e234dae75c793f67a35089c9d99245e1c58470bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000bb8cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc28ad599c3a0ff1de082011efddc58f1908eb6e6d80000" ); assertTrue(success, "Call Failed"); diff --git a/foundry/test/TychoRouterSingleSwap.t.sol b/foundry/test/TychoRouterSingleSwap.t.sol index f2fba1b..93beba0 100644 --- a/foundry/test/TychoRouterSingleSwap.t.sol +++ b/foundry/test/TychoRouterSingleSwap.t.sol @@ -290,7 +290,7 @@ contract TychoRouterSingleSwapTest is TychoRouterTestSetup { function testSingleSwapIntegration() public { // Tests swapping WETH -> DAI on a USV2 pool with regular approvals deal(WETH_ADDR, ALICE, 1 ether); - uint256 balancerBefore = IERC20(DAI_ADDR).balanceOf(ALICE); + uint256 balanceBefore = IERC20(DAI_ADDR).balanceOf(ALICE); vm.startPrank(ALICE); IERC20(WETH_ADDR).approve(tychoRouterAddr, type(uint256).max); @@ -301,15 +301,15 @@ contract TychoRouterSingleSwapTest is TychoRouterTestSetup { vm.stopPrank(); - uint256 balancerAfter = IERC20(DAI_ADDR).balanceOf(ALICE); + uint256 balanceAfter = IERC20(DAI_ADDR).balanceOf(ALICE); assertTrue(success, "Call Failed"); - assertEq(balancerAfter - balancerBefore, 2659881924818443699787); + assertEq(balanceAfter - balanceBefore, 2659881924818443699787); } function testSingleSwapIntegrationPermit2() public { // Tests swapping WETH -> DAI on a USV2 pool with permit2 deal(WETH_ADDR, ALICE, 1 ether); - uint256 balancerBefore = IERC20(DAI_ADDR).balanceOf(ALICE); + uint256 balanceBefore = IERC20(DAI_ADDR).balanceOf(ALICE); vm.startPrank(ALICE); IERC20(WETH_ADDR).approve(PERMIT2_ADDRESS, type(uint256).max); @@ -320,8 +320,8 @@ contract TychoRouterSingleSwapTest is TychoRouterTestSetup { vm.stopPrank(); - uint256 balancerAfter = IERC20(DAI_ADDR).balanceOf(ALICE); + uint256 balanceAfter = IERC20(DAI_ADDR).balanceOf(ALICE); assertTrue(success, "Call Failed"); - assertEq(balancerAfter - balancerBefore, 2659881924818443699787); + assertEq(balanceAfter - balanceBefore, 2659881924818443699787); } }