diff --git a/crates/anvil/src/eth/backend/executor.rs b/crates/anvil/src/eth/backend/executor.rs index 320d4688462c..5e68924c95c3 100644 --- a/crates/anvil/src/eth/backend/executor.rs +++ b/crates/anvil/src/eth/backend/executor.rs @@ -174,12 +174,14 @@ impl<'a, DB: Db + ?Sized, Validator: TransactionValidator> TransactionExecutor<' let ExecutedTransaction { transaction, logs, out, traces, exit_reason: exit, .. } = tx; logs_bloom(logs.clone(), &mut bloom); - let contract_address = if let Some(Output::Create(_, contract_address)) = out { - trace!(target: "backend", "New contract deployed: at {:?}", contract_address); - contract_address - } else { - None - }; + let contract_address = out.as_ref().and_then(|out| { + if let Output::Create(_, contract_address) = out { + trace!(target: "backend", "New contract deployed: at {:?}", contract_address); + *contract_address + } else { + None + } + }); let transaction_index = transaction_infos.len() as u32; let info = TransactionInfo { diff --git a/crates/cast/bin/cmd/wallet/mod.rs b/crates/cast/bin/cmd/wallet/mod.rs index 931ecefa483a..50467421c415 100644 --- a/crates/cast/bin/cmd/wallet/mod.rs +++ b/crates/cast/bin/cmd/wallet/mod.rs @@ -356,7 +356,7 @@ flag to set your key via: let phrase = Mnemonic::::new_from_phrase(mnemonic.as_str())?.to_phrase(); let builder = MnemonicBuilder::::default().phrase(phrase.as_str()); let derivation_path = "m/44'/60'/0'/0/"; - let index = if let Some(i) = mnemonic_index { i } else { 0 }; + let index = mnemonic_index.unwrap_or_default(); let wallet = builder .clone() .derivation_path(format!("{derivation_path}{index}"))? diff --git a/crates/forge/tests/it/test_helpers.rs b/crates/forge/tests/it/test_helpers.rs index bf31842b8e52..0112d4bb96cc 100644 --- a/crates/forge/tests/it/test_helpers.rs +++ b/crates/forge/tests/it/test_helpers.rs @@ -292,6 +292,12 @@ pub fn rpc_endpoints() -> RpcEndpoints { "https://eth-mainnet.alchemyapi.io/v2/Lc7oIGYeL_QvInzI0Wiu_pOZZDEKBrdf".to_string(), ), ), + ( + "rpcAliasSepolia", + RpcEndpoint::Url( + "https://eth-sepolia.g.alchemy.com/v2/Lc7oIGYeL_QvInzI0Wiu_pOZZDEKBrdf".to_string(), + ), + ), ("rpcEnvAlias", RpcEndpoint::Env("${RPC_ENV_ALIAS}".to_string())), ]) } diff --git a/crates/script/src/artifacts.rs b/crates/script/src/artifacts.rs index 0a2bd77dd90d..ebd149f4903c 100644 --- a/crates/script/src/artifacts.rs +++ b/crates/script/src/artifacts.rs @@ -3,7 +3,6 @@ use alloy_json_abi::JsonAbi; /// Bundles info of an artifact pub struct ArtifactInfo<'a> { pub contract_name: String, - pub contract_id: String, pub abi: &'a JsonAbi, pub code: &'a Vec, } diff --git a/crates/script/src/execute.rs b/crates/script/src/execute.rs index cdf4353d3860..4a3a3485208b 100644 --- a/crates/script/src/execute.rs +++ b/crates/script/src/execute.rs @@ -274,8 +274,6 @@ For more information, please see https://eips.ethereum.org/EIPS/eip-3855", /// Container for data being collected after execution. pub struct ExecutionArtifacts { - /// Mapping from contract to its runtime code. - pub known_contracts: ContractsByArtifact, /// Trace decoder used to decode traces. pub decoder: CallTraceDecoder, /// Return values from the execution result. @@ -327,7 +325,7 @@ impl ExecutedState { build_data: self.build_data, execution_data: self.execution_data, execution_result: self.execution_result, - execution_artifacts: ExecutionArtifacts { known_contracts, decoder, returns, rpc_data }, + execution_artifacts: ExecutionArtifacts { decoder, returns, rpc_data }, }) } diff --git a/crates/script/src/simulate.rs b/crates/script/src/simulate.rs index 07e962ddff32..e63c5efcefee 100644 --- a/crates/script/src/simulate.rs +++ b/crates/script/src/simulate.rs @@ -66,7 +66,6 @@ impl PreSimulationState { script_config: self.script_config, script_wallets: self.script_wallets, build_data: self.build_data, - execution_data: self.execution_data, execution_artifacts: self.execution_artifacts, transactions, }) @@ -199,12 +198,7 @@ impl PreSimulationState { if let Ok(Some((_, (abi, code)))) = contracts.find_by_name_or_identifier(contract_name) { - let info = ArtifactInfo { - contract_name: contract_name.to_string(), - contract_id: contract_id.to_string(), - abi, - code, - }; + let info = ArtifactInfo { contract_name: contract_name.to_string(), abi, code }; return Some((*addr, info)); } None @@ -259,7 +253,6 @@ pub struct FilledTransactionsState { pub script_config: ScriptConfig, pub script_wallets: ScriptWallets, pub build_data: LinkedBuildData, - pub execution_data: ExecutionData, pub execution_artifacts: ExecutionArtifacts, pub transactions: VecDeque, } diff --git a/testdata/default/cheats/RpcUrls.t.sol b/testdata/default/cheats/RpcUrls.t.sol index 3d7b298f4cf5..4e3ceba58115 100644 --- a/testdata/default/cheats/RpcUrls.t.sol +++ b/testdata/default/cheats/RpcUrls.t.sol @@ -33,12 +33,15 @@ contract RpcUrlTest is DSTest { assertEq(url, envUrl); string[2][] memory allUrls = vm.rpcUrls(); - assertEq(allUrls.length, 2); + assertEq(allUrls.length, 3); string[2] memory val = allUrls[0]; assertEq(val[0], "rpcAlias"); string[2] memory env = allUrls[1]; - assertEq(env[0], "rpcEnvAlias"); + assertEq(env[0], "rpcAliasSepolia"); + + string[2] memory env2 = allUrls[2]; + assertEq(env2[0], "rpcEnvAlias"); } } diff --git a/testdata/default/repros/Issue2956.t.sol b/testdata/default/repros/Issue2956.t.sol index f77340da4ae2..9d9e5f9ac586 100644 --- a/testdata/default/repros/Issue2956.t.sol +++ b/testdata/default/repros/Issue2956.t.sol @@ -11,7 +11,7 @@ contract Issue2956Test is DSTest { uint256 fork2; function setUp() public { - fork1 = vm.createFork("https://goerli.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001", 7475589); + fork1 = vm.createFork("rpcAliasSepolia", 5565573); fork2 = vm.createFork("https://api.avax-test.network/ext/bc/C/rpc", 12880747); } @@ -28,7 +28,7 @@ contract Issue2956Test is DSTest { new Counter(); vm.selectFork(fork1); - assertEq(vm.getNonce(user), 3); + assertEq(vm.getNonce(user), 1); vm.prank(user); new Counter(); } diff --git a/testdata/default/repros/Issue3221.t.sol b/testdata/default/repros/Issue3221.t.sol index 9fbc51f60f93..4a9dd7be4099 100644 --- a/testdata/default/repros/Issue3221.t.sol +++ b/testdata/default/repros/Issue3221.t.sol @@ -11,7 +11,7 @@ contract Issue3221Test is DSTest { uint256 fork2; function setUp() public { - fork1 = vm.createFork("https://goerli.infura.io/v3/b1d3925804e74152b316ca7da97060d3", 7475589); + fork1 = vm.createFork("rpcAliasSepolia", 5565573); fork2 = vm.createFork("https://api.avax-test.network/ext/bc/C/rpc", 12880747); } @@ -27,7 +27,7 @@ contract Issue3221Test is DSTest { new Counter(); vm.selectFork(fork1); - assertEq(vm.getNonce(user), 3); + assertEq(vm.getNonce(user), 1); vm.prank(user); new Counter(); } diff --git a/testdata/default/repros/Issue3223.t.sol b/testdata/default/repros/Issue3223.t.sol index 4408d24eee5d..d4c5da751f26 100644 --- a/testdata/default/repros/Issue3223.t.sol +++ b/testdata/default/repros/Issue3223.t.sol @@ -11,7 +11,7 @@ contract Issue3223Test is DSTest { uint256 fork2; function setUp() public { - fork1 = vm.createFork("https://goerli.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001", 7475589); + fork1 = vm.createFork("rpcAliasSepolia", 2362365); fork2 = vm.createFork("https://api.avax-test.network/ext/bc/C/rpc", 12880747); } @@ -25,9 +25,7 @@ contract Issue3223Test is DSTest { new Counter(); vm.selectFork(fork1); - assertEq(vm.getNonce(user), 3); - vm.prank(user); - new Counter(); + assertEq(vm.getNonce(user), 1); } } diff --git a/testdata/default/repros/Issue3674.t.sol b/testdata/default/repros/Issue3674.t.sol index f13f7f162b36..813f73b5d8f0 100644 --- a/testdata/default/repros/Issue3674.t.sol +++ b/testdata/default/repros/Issue3674.t.sol @@ -9,7 +9,7 @@ contract Issue3674Test is DSTest { Vm constant vm = Vm(HEVM_ADDRESS); function testNonceCreateSelect() public { - vm.createSelectFork("https://goerli.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001"); + vm.createSelectFork("rpcAliasSepolia"); vm.createSelectFork("https://api.avax-test.network/ext/bc/C/rpc"); assert(vm.getNonce(msg.sender) > 0x17);