diff --git a/foundry.toml b/foundry.toml index f9679ee6..c873eaa4 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,7 +3,7 @@ fs_permissions = [{ access = "read-write", path = "./"}] [rpc_endpoints] # The RPC URLs are modified versions of the default for testing initialization. -mainnet = "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3" # Different API key. +mainnet = "https://eth-mainnet.alchemyapi.io/v2/WV407BEiBmjNJfKo9Uo_55u0z0ITyCOX" # Different API key. optimism_goerli = "https://goerli.optimism.io/" # Adds a trailing slash. arbitrum_one_goerli = "https://goerli-rollup.arbitrum.io/rpc/" # Adds a trailing slash. needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}" diff --git a/src/StdChains.sol b/src/StdChains.sol index 0e8e4351..27e1bf25 100644 --- a/src/StdChains.sol +++ b/src/StdChains.sol @@ -197,7 +197,7 @@ abstract contract StdChains { // If adding an RPC here, make sure to test the default RPC URL in `testRpcs` setChainWithDefaultRpcUrl("anvil", ChainData("Anvil", 31337, "http://127.0.0.1:8545")); setChainWithDefaultRpcUrl( - "mainnet", ChainData("Mainnet", 1, "https://mainnet.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001") + "mainnet", ChainData("Mainnet", 1, "https://eth-mainnet.alchemyapi.io/v2/pwc5rmJhrdoaSEfimoKEmsvOjKSmPDrP") ); setChainWithDefaultRpcUrl( "goerli", ChainData("Goerli", 5, "https://goerli.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001") diff --git a/src/Test.sol b/src/Test.sol index 9c7cbd68..5ff60ea3 100644 --- a/src/Test.sol +++ b/src/Test.sol @@ -27,4 +27,7 @@ import {Vm} from "./Vm.sol"; import {TestBase} from "./Base.sol"; // ⭐️ TEST -abstract contract Test is TestBase, StdAssertions, StdChains, StdCheats, StdInvariant, StdUtils {} +abstract contract Test is TestBase, StdAssertions, StdChains, StdCheats, StdInvariant, StdUtils { + // Note: IS_TEST() must return true. + bool public IS_TEST = true; +} diff --git a/test/StdChains.t.sol b/test/StdChains.t.sol index 9a8f238b..4c3283a7 100644 --- a/test/StdChains.t.sol +++ b/test/StdChains.t.sol @@ -24,7 +24,7 @@ contract StdChainsMock is Test { contract StdChainsTest is Test { function test_ChainRpcInitialization() public { // RPCs specified in `foundry.toml` should be updated. - assertEq(getChain(1).rpcUrl, "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3"); + assertEq(getChain(1).rpcUrl, "https://eth-mainnet.alchemyapi.io/v2/WV407BEiBmjNJfKo9Uo_55u0z0ITyCOX"); assertEq(getChain("optimism_goerli").rpcUrl, "https://goerli.optimism.io/"); assertEq(getChain("arbitrum_one_goerli").rpcUrl, "https://goerli-rollup.arbitrum.io/rpc/"); @@ -36,7 +36,7 @@ contract StdChainsTest is Test { // Cannot override RPCs defined in `foundry.toml` vm.setEnv("MAINNET_RPC_URL", "myoverride2"); - assertEq(getChain("mainnet").rpcUrl, "https://mainnet.infura.io/v3/b1d3925804e74152b316ca7da97060d3"); + assertEq(getChain("mainnet").rpcUrl, "https://eth-mainnet.alchemyapi.io/v2/WV407BEiBmjNJfKo9Uo_55u0z0ITyCOX"); // Other RPCs should remain unchanged. assertEq(getChain(31337).rpcUrl, "http://127.0.0.1:8545");