From 41485cf2f87de81d8270c6f79fde0b48607b9a7f Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Tue, 22 Oct 2024 12:36:57 +0200 Subject: [PATCH] resolve mainnet names --- .../v0.8/ccip/test/MOAFT/CCIPTestSuite.sol | 27 ++++++++++++++++++- .../src/v0.8/ccip/test/MOAFT/chainLoading.sol | 25 +++++++++++++---- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/contracts/src/v0.8/ccip/test/MOAFT/CCIPTestSuite.sol b/contracts/src/v0.8/ccip/test/MOAFT/CCIPTestSuite.sol index 6f45230b65..144218b455 100644 --- a/contracts/src/v0.8/ccip/test/MOAFT/CCIPTestSuite.sol +++ b/contracts/src/v0.8/ccip/test/MOAFT/CCIPTestSuite.sol @@ -20,6 +20,7 @@ library Constants { function _resolveChainSelector( uint64 chainSelector ) internal pure returns (string memory) { + // Testnets if (chainSelector == 3478487238524512106) { return "Arbitrum Sepolia"; } else if (chainSelector == 8871595565390010547) { @@ -41,6 +42,30 @@ library Constants { } else if (chainSelector == 14767482510784806043) { return "Avax Fuji"; } + // Mainnets + if (chainSelector == 5009297550715157269) { + return "Ethereum mainnet"; + } else if (chainSelector == 4411394078118774322) { + return "Blast"; + } else if (chainSelector == 5009297550715157269) { + return "Ethereum mainnet"; + } else if (chainSelector == 465200170687744372) { + return "Gnosis"; + } else if (chainSelector == 13274425992935471758) { + return "Binance Smart Chain"; + } else if (chainSelector == 7264351850409363825) { + return "Mode"; + } else if (chainSelector == 3734403246176062136) { + return "Optimism"; + } else if (chainSelector == 4051577828743386545) { + return "Polygon"; + } else if (chainSelector == 4949039107694359620) { + return "Arbitrum"; + } else if (chainSelector == 6433500567565415381) { + return "Avalanche"; + } else if (chainSelector == 15971525489660198786) { + return "Base"; + } return "Unknown"; } @@ -224,7 +249,7 @@ contract CCIPTestSuite is Test { deal(token, address(this), TOKENS_TO_SEND * 10); IERC20(token).approve(address(i_router), TOKENS_TO_SEND); - i_router.ccipSend{value: 1 ether}( + i_router.ccipSend{value: 100 ether}( destChainSelector, Client.EVM2AnyMessage({ receiver: abi.encode(_getRandomAddress()), diff --git a/contracts/src/v0.8/ccip/test/MOAFT/chainLoading.sol b/contracts/src/v0.8/ccip/test/MOAFT/chainLoading.sol index 63ac46c397..01f3667dec 100644 --- a/contracts/src/v0.8/ccip/test/MOAFT/chainLoading.sol +++ b/contracts/src/v0.8/ccip/test/MOAFT/chainLoading.sol @@ -24,7 +24,7 @@ import {Test} from "forge-std/Test.sol"; /// _RPC_URL='' /// # The Router contract address /// _ROUTER=0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59 -/// # The block before the migration was applied. Use 0 if the migration has not been applied yet. +/// # Any block before the migration was applied. /// _PRE_BLOCK=6797746 /// # Any block after the migration was applied. Use 0 if the migration has not been applied yet. /// _POST_BLOCK=6904314 @@ -54,8 +54,18 @@ contract ChainLoading is Test { uint256 internal constant FourHours = 4 * 60 * 60; - string[] internal s_allTestnets = [SEPOLIA, OPT_SEPOLIA, ARB_SEPOLIA]; - string[] internal s_allMainnets = [ETHEREUM]; + string[] internal s_allTestnets = [ + SEPOLIA, + GNOSIS_TESTNET, + BNB_TESTNET, + MODE_TESTNET, + OPT_SEPOLIA, + POLYGON_AMOY, + ARB_SEPOLIA, + AVAX_FUJI, + BASE_SEPOLIA + ]; + string[] internal s_allMainnets = [BLAST, ETHEREUM, GNOSIS, BNB, MODE, OPTIMISM, POLYGON, ARBITRUM, AVAX, BASE]; mapping(string chainName => ForkedChainTestSetup) public s_chains; @@ -88,8 +98,8 @@ contract ChainLoading is Test { } function test_all_chains() public { - for (uint256 i = 0; i < s_allTestnets.length; ++i) { - run(s_allTestnets[i]); + for (uint256 i = 0; i < s_allMainnets.length; ++i) { + run(s_allMainnets[i]); } } @@ -130,6 +140,11 @@ contract ChainLoading is Test { chain.testSuite.sendAllTokens(false); + if (chain.postMigrationBlock == 0) { + console2.logString("Migration not applied yet"); + return; + } + console2.logString(" +------------------------------------------------+"); console2.logString(" | After migration |"); console2.logString(" +------------------------------------------------+");