test: add simple base network tests in usv2 and router

This commit is contained in:
royvardhan
2025-02-26 10:16:44 +05:30
parent 22c48e80d2
commit 2323ad3fd9
3 changed files with 48 additions and 1 deletions

View File

@@ -156,4 +156,21 @@ contract UniswapV2ExecutorTest is UniswapV2ExecutorExposed, Test, Constants {
vm.expectRevert(UniswapV2Executor__InvalidTarget.selector);
uniswapV2Exposed.swap(amountIn, protocolData);
}
// Base Network Tests
// Make sure to set the fork block to 26857267 for base network
function testSwapBaseNetwork() public {
vm.skip(true);
uint256 amountIn = 10 * 10 ** 6;
bool zeroForOne = true;
bytes memory protocolData =
abi.encodePacked(BASE_USDC, USDC_MAG7_POOL, BOB, zeroForOne);
deal(BASE_USDC, address(uniswapV2Exposed), amountIn);
uniswapV2Exposed.swap(amountIn, protocolData);
assertEq(IERC20(BASE_USDC).balanceOf(BOB), 0);
assertGe(IERC20(BASE_MAG7).balanceOf(BOB), 0);
}
}