diff --git a/Cargo.lock b/Cargo.lock index 23874b52cd5f3..098f4361be145 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,6 +81,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + [[package]] name = "ammonia" version = "3.3.0" @@ -1693,9 +1702,9 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" [[package]] name = "enr" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb4d5fbf6f56acecd38f5988eb2e4ae412008a2a30268c748c701ec6322f39d4" +checksum = "cf56acd72bb22d2824e66ae8e9e5ada4d0de17a69c7fd35569dde2ada8ec9116" dependencies = [ "base64 0.13.1", "bytes", @@ -1849,9 +1858,9 @@ dependencies = [ [[package]] name = "ethers" -version = "2.0.2" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697aba1bec98cb86e7bebd69f9bb365218871464137af9e93e7a72bd6dc421d0" +checksum = "8d5486fdc149826f38c388f26a7df72534ee3f20d3a3f72539376fa7b3bbc43d" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -1865,9 +1874,9 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56f1c92cb7c406794c8324158da4caf9e54018e28b776df8155085e1d06db75" +checksum = "1c66a426b824a0f6d1361ad74b6b01adfd26c44ee1e14c3662dcf28406763ec5" dependencies = [ "ethers-core", "once_cell", @@ -1877,9 +1886,9 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.2" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4e8ed7c2b2a22e07b65ae0eb426c948a7448f1be15c66e4813e02c423751fc9" +checksum = "dfa43e2e69632492d7b38e59465d125a0066cf4c477390ece00d3acbd11b338b" dependencies = [ "ethers-contract-abigen", "ethers-contract-derive", @@ -1896,9 +1905,9 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "2.0.2" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0984f4ec4e267fd27b7c9fa2f73e72c5c98491a73f777290654154d104f723" +checksum = "2edb8fdbf77459819a443234b461171a024476bfc12f1853b889a62c6e1185ff" dependencies = [ "Inflector", "dunce", @@ -1914,7 +1923,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 1.0.109", + "syn 2.0.15", "tokio", "toml 0.7.3", "url", @@ -1923,23 +1932,25 @@ dependencies = [ [[package]] name = "ethers-contract-derive" -version = "2.0.2" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914e9211077a1b590af1ee6b8dfbd54515c808119546c95da69479908dc3d4de" +checksum = "939b0c37746929f869285ee37d270b7c998d80cc7404c2e20dda8efe93e3b295" dependencies = [ + "Inflector", "ethers-contract-abigen", "ethers-core", "hex", "proc-macro2", "quote", - "syn 1.0.109", + "serde_json", + "syn 2.0.15", ] [[package]] name = "ethers-core" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a5f8f85ba96698eab9a4782ed2215d0979b1981b99f1be0726c200ffdac22f5" +checksum = "198ea9efa8480fa69f73d31d41b1601dace13d053c6fe4be6f5878d9dfcf0108" dependencies = [ "arrayvec", "bytes", @@ -1968,9 +1979,9 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "2.0.2" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8920b59cf81e357df2c8102d6a9dc81c2d68f7409543ff3b6868851ecf007807" +checksum = "196a21d6939ab78b7a1e4c45c2b33b0c2dd821a2e1af7c896f06721e1ba2a0c7" dependencies = [ "ethers-core", "ethers-solc", @@ -1985,9 +1996,9 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.2" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b30f67c1883ed68bd38aedbdd321831382c12e1b95089c8261c79bb85e4da" +checksum = "75594cc450992fc7de701c9145de612325fd8a18be765b8ae78767ba2b74876f" dependencies = [ "async-trait", "auto_impl", @@ -2012,9 +2023,9 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c9d2cbed43cf618004dbe339e389e10dae46ea8e55872ab63a25fad25a6082a" +checksum = "1009041f40476b972b5d79346cc512e97c662b1a0a2f78285eabe9a122909783" dependencies = [ "async-trait", "auto_impl", @@ -2051,9 +2062,9 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56871f70b97cc5cced5c39c88a0196c206d8f7fb8e1e0952fbf1fb73c033219" +checksum = "c3bd11ad6929f01f01be74bb00d02bbd6552f22de030865c898b340a3a592db1" dependencies = [ "async-trait", "coins-bip32", @@ -2079,9 +2090,9 @@ dependencies = [ [[package]] name = "ethers-solc" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e967e60bca8fc83d640a7aebd1492d625c43e86b88a5a5bb08b1019472d5d6b" +checksum = "2284784306de73d8ad1bc792ecc1b87da0268185683698d60fd096d23d168c99" dependencies = [ "cfg-if", "dunce", @@ -2404,6 +2415,7 @@ dependencies = [ "foundry-cli-test-utils", "foundry-common", "foundry-config", + "foundry-evm", "foundry-utils", "futures", "globset", @@ -3016,7 +3028,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" dependencies = [ - "aho-corasick", + "aho-corasick 0.7.20", "bstr", "fnv", "log", @@ -3231,11 +3243,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -3682,7 +3694,7 @@ dependencies = [ "petgraph", "pico-args", "regex", - "regex-syntax", + "regex-syntax 0.6.29", "string_cache", "term", "tiny-keccak", @@ -4784,12 +4796,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.1.25" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "1ceca8aaf45b5c46ec7ed39fff75f57290368c1846d33d24a122ca81416ab058" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] @@ -4888,7 +4900,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax", + "regex-syntax 0.6.29", "rusty-fork", "tempfile", "unarray", @@ -5101,13 +5113,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.3" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" dependencies = [ - "aho-corasick", + "aho-corasick 1.0.1", "memchr", - "regex-syntax", + "regex-syntax 0.7.1", ] [[package]] @@ -5116,7 +5128,7 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", ] [[package]] @@ -5125,11 +5137,17 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" + [[package]] name = "reqwest" -version = "0.11.16" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" +checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" dependencies = [ "base64 0.21.0", "bytes", @@ -6348,9 +6366,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" dependencies = [ "autocfg", "bytes", @@ -6362,14 +6380,14 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index e48959400834a..790e794e94e70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,7 +59,7 @@ panic = "abort" codegen-units = 1 [workspace.dependencies] -ethers = { version = "2", default-features = false } +ethers = { version = "2.0.4", default-features = false } ethers-addressbook = { version = "2", default-features = false } ethers-core = { version = "2", default-features = false } ethers-contract = { version = "2", default-features = false } diff --git a/anvil/src/eth/backend/mem/mod.rs b/anvil/src/eth/backend/mem/mod.rs index 5bbe5419fd71c..fd823be1d0c9a 100644 --- a/anvil/src/eth/backend/mem/mod.rs +++ b/anvil/src/eth/backend/mem/mod.rs @@ -1442,6 +1442,7 @@ impl Backend { nonce: Some(nonce), base_fee_per_gas, other: Default::default(), + ..Default::default() } } diff --git a/chisel/src/executor.rs b/chisel/src/executor.rs index 78fc0a91e0753..5a0c33355b97b 100644 --- a/chisel/src/executor.rs +++ b/chisel/src/executor.rs @@ -252,7 +252,7 @@ impl SessionSource { .with_config(env) .with_chisel_state(final_pc) .set_tracing(true) - .with_spec(foundry_cli::utils::evm_spec(&self.config.foundry_config.evm_version)) + .with_spec(foundry_evm::utils::evm_spec(&self.config.foundry_config.evm_version)) .with_gas_limit(self.config.evm_opts.gas_limit()) .with_cheatcodes(CheatsConfig::new(&self.config.foundry_config, &self.config.evm_opts)) .build(backend); diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 9f0c79d2f8664..69cfd34009ef9 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -18,6 +18,7 @@ foundry-utils = { path = "../utils" } forge = { path = "../forge" } foundry-config = { path = "../config" } foundry-common = { path = "../common" } +foundry-evm = { path = "../evm" } cast = { path = "../cast" } ui = { path = "../ui" } diff --git a/cli/src/cmd/cast/run.rs b/cli/src/cmd/cast/run.rs index 7139ed5e95e46..ab854536d7509 100644 --- a/cli/src/cmd/cast/run.rs +++ b/cli/src/cmd/cast/run.rs @@ -20,6 +20,7 @@ use forge::{ utils::h256_to_b256, }; use foundry_config::{find_project_root_path, Config}; +use foundry_evm::utils::evm_spec; use std::{collections::BTreeMap, str::FromStr}; use tracing::trace; use ui::{TUIExitReason, Tui, Ui}; @@ -92,9 +93,8 @@ impl RunArgs { // configures a bare version of the evm executor: no cheatcode inspector is enabled, // tracing will be enabled only for the targeted transaction - let builder = ExecutorBuilder::default() - .with_config(env) - .with_spec(crate::utils::evm_spec(&config.evm_version)); + let builder = + ExecutorBuilder::default().with_config(env).with_spec(evm_spec(&config.evm_version)); let mut executor = builder.build(db); diff --git a/cli/src/cmd/forge/coverage.rs b/cli/src/cmd/forge/coverage.rs index e7b89803dd023..fd68a0fece5a0 100644 --- a/cli/src/cmd/forge/coverage.rs +++ b/cli/src/cmd/forge/coverage.rs @@ -4,7 +4,7 @@ use crate::{ forge::{build::CoreBuildArgs, install, test::FilterArgs}, Cmd, LoadConfig, }, - utils::{self, p_println, STATIC_FUZZ_SEED}, + utils::{p_println, STATIC_FUZZ_SEED}, }; use clap::{Parser, ValueEnum}; use ethers::{ @@ -29,6 +29,7 @@ use forge::{ }; use foundry_common::{compile::ProjectCompiler, evm::EvmArgs, fs}; use foundry_config::Config; +use foundry_evm::utils::evm_spec; use semver::Version; use std::{collections::HashMap, sync::mpsc::channel, thread}; use tracing::trace; @@ -266,7 +267,7 @@ impl CoverageArgs { let root = project.paths.root; // Build the contract runner - let evm_spec = utils::evm_spec(&config.evm_version); + let evm_spec = evm_spec(&config.evm_version); let env = evm_opts.evm_env_blocking()?; let mut runner = MultiContractRunnerBuilder::default() .initial_balance(evm_opts.initial_balance) diff --git a/cli/src/cmd/forge/script/broadcast.rs b/cli/src/cmd/forge/script/broadcast.rs index 4dcf5ab36d39c..320eeb308ec94 100644 --- a/cli/src/cmd/forge/script/broadcast.rs +++ b/cli/src/cmd/forge/script/broadcast.rs @@ -270,6 +270,7 @@ impl ScriptArgs { if let Some(txs) = result.transactions.take() { script_config.collect_rpcs(&txs); script_config.check_multi_chain_constraints(&libraries)?; + script_config.check_shanghai_support().await?; if !script_config.missing_rpc { trace!(target: "script", "creating deployments"); diff --git a/cli/src/cmd/forge/script/executor.rs b/cli/src/cmd/forge/script/executor.rs index b29b49b4ff284..f87d42e534ffe 100644 --- a/cli/src/cmd/forge/script/executor.rs +++ b/cli/src/cmd/forge/script/executor.rs @@ -1,15 +1,12 @@ use super::*; -use crate::{ - cmd::{ - ensure_clean_constructor, - forge::script::{ - artifacts::ArtifactInfo, - runner::SimulationStage, - transaction::{AdditionalContract, TransactionWithMetadata}, - }, - needs_setup, +use crate::cmd::{ + ensure_clean_constructor, + forge::script::{ + artifacts::ArtifactInfo, + runner::SimulationStage, + transaction::{AdditionalContract, TransactionWithMetadata}, }, - utils, + needs_setup, }; use cast::executor::inspector::cheatcodes::util::BroadcastableTransactions; use ethers::{ @@ -23,6 +20,7 @@ use forge::{ CallKind, }; use foundry_common::{shell, RpcUrl}; +use foundry_evm::utils::evm_spec; use futures::future::join_all; use parking_lot::RwLock; use std::{collections::VecDeque, sync::Arc}; @@ -306,7 +304,7 @@ impl ScriptArgs { let mut builder = ExecutorBuilder::default() .with_config(env) - .with_spec(utils::evm_spec(&script_config.config.evm_version)) + .with_spec(evm_spec(&script_config.config.evm_version)) .with_gas_limit(script_config.evm_opts.gas_limit()) // We need it enabled to decode contract names: local or external. .set_tracing(true); diff --git a/cli/src/cmd/forge/script/mod.rs b/cli/src/cmd/forge/script/mod.rs index d945e9d893228..db921b00f2a02 100644 --- a/cli/src/cmd/forge/script/mod.rs +++ b/cli/src/cmd/forge/script/mod.rs @@ -15,11 +15,12 @@ use ethers::{ artifacts::{ContractBytecodeSome, Libraries}, ArtifactId, Bytes, Project, }, + providers::{Http, Middleware}, signers::LocalWallet, solc::contracts::ArtifactContracts, types::{ - transaction::eip2718::TypedTransaction, Address, Log, NameOrAddress, TransactionRequest, - U256, + transaction::eip2718::TypedTransaction, Address, Chain, Log, NameOrAddress, + TransactionRequest, U256, }, }; use eyre::{ContextCompat, WrapErr}; @@ -40,6 +41,7 @@ use foundry_common::{ shell, ContractsByArtifact, RpcUrl, CONTRACT_MAX_SIZE, SELECTOR_LEN, }; use foundry_config::{figment, Config}; +use futures::future; use serde::{Deserialize, Serialize}; use std::{ collections::{BTreeMap, HashMap, HashSet, VecDeque}, @@ -75,6 +77,16 @@ mod verify; use crate::cmd::retry::RetryArgs; pub use transaction::TransactionWithMetadata; +/// List of Chains that support Shanghai. +static SHANGHAI_ENABLED_CHAINS: &[Chain] = &[ + // Ethereum Mainnet + Chain::Mainnet, + // Goerli + Chain::Goerli, + // Sepolia + Chain::Sepolia, +]; + // Loads project's figment and merges the build cli arguments into it foundry_config::merge_impl_figment_convert!(ScriptArgs, opts, evm_opts); @@ -699,6 +711,46 @@ impl ScriptConfig { fn target_contract(&self) -> &ArtifactId { self.target_contract.as_ref().expect("should exist after building") } + + /// Checks if the RPCs used point to chains that support EIP-3855. + /// If not, warns the user. + async fn check_shanghai_support(&self) -> eyre::Result<()> { + let chain_ids = self.total_rpcs.iter().map(|rpc| async move { + if let Ok(provider) = ethers::providers::Provider::::try_from(rpc) { + match provider.get_chainid().await { + Ok(chain_id) => match TryInto::::try_into(chain_id) { + Ok(chain) => return Some((SHANGHAI_ENABLED_CHAINS.contains(&chain), chain)), + Err(_) => return None, + }, + Err(_) => return None, + } + } + None + }); + + let chain_ids: Vec<_> = future::join_all(chain_ids).await.into_iter().flatten().collect(); + + let chain_id_unsupported = chain_ids.iter().any(|(supported, _)| !supported); + + // At least one chain ID is unsupported, therefore we print the message. + if chain_id_unsupported { + let msg = format!( + r#" +EIP-3855 is not supported in one or more of the RPCs used. +Unsupported Chain IDs: {}. +Contracts deployed with a Solidity version equal or higher than 0.8.20 might not work properly. +For more information, please see https://eips.ethereum.org/EIPS/eip-3855"#, + chain_ids + .iter() + .filter(|(supported, _)| !supported) + .map(|(_, chain)| format!("{}", *chain as u64)) + .collect::>() + .join(", ") + ); + shell::println(Paint::yellow(msg))?; + } + Ok(()) + } } #[cfg(test)] diff --git a/cli/src/cmd/forge/test/mod.rs b/cli/src/cmd/forge/test/mod.rs index 32a281ae7539d..03dbfcf57f698 100644 --- a/cli/src/cmd/forge/test/mod.rs +++ b/cli/src/cmd/forge/test/mod.rs @@ -39,6 +39,7 @@ use foundry_config::figment::{ value::{Dict, Map}, Metadata, Profile, Provider, }; +use foundry_evm::utils::evm_spec; // Loads project's figment and merges the build cli arguments into it foundry_config::merge_impl_figment_convert!(TestArgs, opts, evm_opts); @@ -158,7 +159,7 @@ impl TestArgs { let env = evm_opts.evm_env_blocking()?; // Prepare the test builder - let evm_spec = utils::evm_spec(&config.evm_version); + let evm_spec = evm_spec(&config.evm_version); let mut runner = MultiContractRunnerBuilder::default() .initial_balance(evm_opts.initial_balance) diff --git a/cli/src/utils.rs b/cli/src/utils.rs index d8f4dc2ff1ebd..ec3404097607d 100644 --- a/cli/src/utils.rs +++ b/cli/src/utils.rs @@ -3,12 +3,10 @@ use ethers::{ abi::token::{LenientTokenizer, Tokenizer}, prelude::TransactionReceipt, providers::Middleware, - solc::EvmVersion, types::U256, utils::format_units, }; use eyre::Result; -use forge::revm::primitives::SpecId; use foundry_config::{Chain, Config}; use std::{ future::Future, @@ -85,15 +83,6 @@ pub fn subscriber() { .init() } -pub fn evm_spec(evm: &EvmVersion) -> SpecId { - match evm { - EvmVersion::Istanbul => SpecId::ISTANBUL, - EvmVersion::Berlin => SpecId::BERLIN, - EvmVersion::London => SpecId::LONDON, - _ => panic!("Unsupported EVM version"), - } -} - /// parse a hex str or decimal str as U256 pub fn parse_u256(s: &str) -> Result { Ok(if s.starts_with("0x") { U256::from_str(s)? } else { U256::from_dec_str(s)? }) diff --git a/cli/tests/fixtures/can_build_skip_contracts.stdout b/cli/tests/fixtures/can_build_skip_contracts.stdout index 5b031a27a4b25..74ddb6b4e49f3 100644 --- a/cli/tests/fixtures/can_build_skip_contracts.stdout +++ b/cli/tests/fixtures/can_build_skip_contracts.stdout @@ -1,3 +1,3 @@ Compiling 1 files with 0.8.17 Solc 0.8.17 finished in 34.45ms -Compiler run successful +Compiler run successful! diff --git a/cli/tests/fixtures/can_check_snapshot.stdout b/cli/tests/fixtures/can_check_snapshot.stdout index 72878e65a922b..feba216a69527 100644 --- a/cli/tests/fixtures/can_check_snapshot.stdout +++ b/cli/tests/fixtures/can_check_snapshot.stdout @@ -1,6 +1,6 @@ Compiling 2 files with 0.8.10 Solc 0.8.10 finished in 424.55ms -Compiler run successful +Compiler run successful! Running 1 test for src/ATest.t.sol:ATest [PASS] testExample() (gas: 168) diff --git a/cli/tests/fixtures/can_create_template_contract.stdout b/cli/tests/fixtures/can_create_template_contract.stdout index 5013abaffd4be..c38ef8e401020 100644 --- a/cli/tests/fixtures/can_create_template_contract.stdout +++ b/cli/tests/fixtures/can_create_template_contract.stdout @@ -1,6 +1,6 @@ Compiling 21 files with 0.8.15 Solc 0.8.15 finished in 2.27s -Compiler run successful +Compiler run successful! Deployer: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 Deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3 Transaction hash: 0xd6e14926926a3bf1f51ccd13ccb190887a82d0ba7d5f3f0af7928faa22c4d3ec diff --git a/cli/tests/fixtures/can_create_using_unlocked.stdout b/cli/tests/fixtures/can_create_using_unlocked.stdout index 80cb0492d2f3e..ac02d82470c1e 100644 --- a/cli/tests/fixtures/can_create_using_unlocked.stdout +++ b/cli/tests/fixtures/can_create_using_unlocked.stdout @@ -1,6 +1,6 @@ Compiling 21 files with 0.8.15 Solc 0.8.15 finished in 1.95s -Compiler run successful +Compiler run successful! Deployer: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 Deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3 Transaction hash: 0xd6e14926926a3bf1f51ccd13ccb190887a82d0ba7d5f3f0af7928faa22c4d3ec diff --git a/cli/tests/fixtures/can_execute_script_and_skip_contracts.stdout b/cli/tests/fixtures/can_execute_script_and_skip_contracts.stdout index 649102b19a2dd..46f580d03a5b4 100644 --- a/cli/tests/fixtures/can_execute_script_and_skip_contracts.stdout +++ b/cli/tests/fixtures/can_execute_script_and_skip_contracts.stdout @@ -1,6 +1,6 @@ Compiling 1 files with 0.8.17 Solc 0.8.17 -Compiler run successful +Compiler run successful! Script ran successfully. Gas used: 22900 diff --git a/cli/tests/fixtures/can_execute_script_command.stdout b/cli/tests/fixtures/can_execute_script_command.stdout index effbd2bacc807..459bf7369bf9a 100644 --- a/cli/tests/fixtures/can_execute_script_command.stdout +++ b/cli/tests/fixtures/can_execute_script_command.stdout @@ -1,6 +1,6 @@ Compiling 1 files with 0.8.10 Solc 0.8.10 finished in 23.34ms -Compiler run successful +Compiler run successful! Script ran successfully. Gas used: 22815 diff --git a/cli/tests/fixtures/can_execute_script_command_fqn.stdout b/cli/tests/fixtures/can_execute_script_command_fqn.stdout index 5444f74d42bab..6b2a06b307488 100644 --- a/cli/tests/fixtures/can_execute_script_command_fqn.stdout +++ b/cli/tests/fixtures/can_execute_script_command_fqn.stdout @@ -1,6 +1,6 @@ Compiling 1 files with 0.8.10 Solc 0.8.10 finished in 23.70ms -Compiler run successful +Compiler run successful! Script ran successfully. Gas used: 22815 diff --git a/cli/tests/fixtures/can_execute_script_command_with_args.stdout b/cli/tests/fixtures/can_execute_script_command_with_args.stdout index 1ed6717888f50..882fe3a47c515 100644 --- a/cli/tests/fixtures/can_execute_script_command_with_args.stdout +++ b/cli/tests/fixtures/can_execute_script_command_with_args.stdout @@ -1,6 +1,6 @@ Compiling 1 files with 0.8.10 Solc 0.8.10 finished in 35.28ms -Compiler run successful +Compiler run successful! Script ran successfully. Gas used: 25301 diff --git a/cli/tests/fixtures/can_execute_script_command_with_returned.stdout b/cli/tests/fixtures/can_execute_script_command_with_returned.stdout index b70eeb7228108..0cc0e7f97b1c2 100644 --- a/cli/tests/fixtures/can_execute_script_command_with_returned.stdout +++ b/cli/tests/fixtures/can_execute_script_command_with_returned.stdout @@ -1,6 +1,6 @@ Compiling 1 files with 0.8.10 Solc 0.8.10 finished in 1.27s -Compiler run successful +Compiler run successful! Script ran successfully. Gas used: 22900 diff --git a/cli/tests/fixtures/can_execute_script_command_with_sig.stdout b/cli/tests/fixtures/can_execute_script_command_with_sig.stdout index becf6dc640d54..54f954f36daaf 100644 --- a/cli/tests/fixtures/can_execute_script_command_with_sig.stdout +++ b/cli/tests/fixtures/can_execute_script_command_with_sig.stdout @@ -1,6 +1,6 @@ Compiling 1 files with 0.8.10 Solc 0.8.10 finished in 24.49ms -Compiler run successful +Compiler run successful! Script ran successfully. Gas used: 22815 diff --git a/cli/tests/fixtures/can_run_test_in_custom_test_folder.stdout b/cli/tests/fixtures/can_run_test_in_custom_test_folder.stdout index e23307ed255ee..049b5827c5fd2 100644 --- a/cli/tests/fixtures/can_run_test_in_custom_test_folder.stdout +++ b/cli/tests/fixtures/can_run_test_in_custom_test_folder.stdout @@ -1,6 +1,6 @@ Compiling 2 files with 0.8.10 Solc 0.8.10 finished in 185.25ms -Compiler run successful +Compiler run successful! Running 1 test for src/nested/forge-tests/MyTest.t.sol:MyTest [PASS] testTrue() (gas: 168) diff --git a/cli/tests/fixtures/can_set_yul_optimizer.stderr b/cli/tests/fixtures/can_set_yul_optimizer.stderr index 495a07c51947a..c7c847bf96e18 100644 --- a/cli/tests/fixtures/can_set_yul_optimizer.stderr +++ b/cli/tests/fixtures/can_set_yul_optimizer.stderr @@ -1,10 +1,9 @@ Error: -Compiler run failed -error[6553]: SyntaxError: The msize instruction cannot be used when the Yul optimizer is activated because it can change its semantics. Either disable the Yul optimizer or do not use the instruction. +Compiler run failed: +Error (6553): SyntaxError: The msize instruction cannot be used when the Yul optimizer is activated because it can change its semantics. Either disable the Yul optimizer or do not use the instruction. --> src/Foo.sol:6:8: | 6 | assembly { | ^ (Relevant source part starts here and spans across multiple lines). - diff --git a/cli/tests/fixtures/can_use_libs_in_multi_fork.stdout b/cli/tests/fixtures/can_use_libs_in_multi_fork.stdout index 66a5eddd627aa..7be9472c3f71d 100644 --- a/cli/tests/fixtures/can_use_libs_in_multi_fork.stdout +++ b/cli/tests/fixtures/can_use_libs_in_multi_fork.stdout @@ -1,6 +1,6 @@ Compiling 19 files with 0.8.13 Solc 0.8.13 finished in 1.95s -Compiler run successful +Compiler run successful! Running 1 test for test/Contract.t.sol:ContractTest [PASS] test() (gas: 70373) diff --git a/cli/tests/fixtures/runs_tests_exactly_once_with_changed_versions.0.8.10.stdout b/cli/tests/fixtures/runs_tests_exactly_once_with_changed_versions.0.8.10.stdout index ade43191492a4..df4f80d682219 100644 --- a/cli/tests/fixtures/runs_tests_exactly_once_with_changed_versions.0.8.10.stdout +++ b/cli/tests/fixtures/runs_tests_exactly_once_with_changed_versions.0.8.10.stdout @@ -1,6 +1,6 @@ Compiling 2 files with 0.8.10 Solc 0.8.10 finished in 185.25ms -Compiler run successful +Compiler run successful! Running 1 test for src/Contract.t.sol:ContractTest [PASS] testExample() (gas: 190) diff --git a/cli/tests/fixtures/runs_tests_exactly_once_with_changed_versions.0.8.13.stdout b/cli/tests/fixtures/runs_tests_exactly_once_with_changed_versions.0.8.13.stdout index 77cdb61b709d4..2c349e66e5fb3 100644 --- a/cli/tests/fixtures/runs_tests_exactly_once_with_changed_versions.0.8.13.stdout +++ b/cli/tests/fixtures/runs_tests_exactly_once_with_changed_versions.0.8.13.stdout @@ -1,6 +1,6 @@ Compiling 2 files with 0.8.13 Solc 0.8.13 finished in 185.25ms -Compiler run successful +Compiler run successful! Running 1 test for src/Contract.t.sol:ContractTest [PASS] testExample() (gas: 190) diff --git a/cli/tests/fixtures/suggest_when_no_tests_match.stdout b/cli/tests/fixtures/suggest_when_no_tests_match.stdout index 64f01b77f3503..3c58603b91bc8 100644 --- a/cli/tests/fixtures/suggest_when_no_tests_match.stdout +++ b/cli/tests/fixtures/suggest_when_no_tests_match.stdout @@ -1,6 +1,6 @@ Compiling 1 files with 0.8.10 Solc 0.8.10 finished in 185.25ms -Compiler run successful +Compiler run successful! No tests match the provided pattern: match-test: `testA.*` diff --git a/cli/tests/fixtures/warn_no_tests.stdout b/cli/tests/fixtures/warn_no_tests.stdout index e6556d65e5e80..3af59c7af14e7 100644 --- a/cli/tests/fixtures/warn_no_tests.stdout +++ b/cli/tests/fixtures/warn_no_tests.stdout @@ -1,5 +1,5 @@ Compiling 1 files with 0.8.13 Solc 0.8.13 -Compiler run successful +Compiler run successful! No tests found in project! Forge looks for functions that starts with `test`. diff --git a/cli/tests/fixtures/warn_no_tests_match.stdout b/cli/tests/fixtures/warn_no_tests_match.stdout index 557650900b90a..6eede42748583 100644 --- a/cli/tests/fixtures/warn_no_tests_match.stdout +++ b/cli/tests/fixtures/warn_no_tests_match.stdout @@ -1,6 +1,6 @@ Compiling 1 files with 0.8.13 Solc 0.8.13 -Compiler run successful +Compiler run successful! No tests match the provided pattern: match-test: `testA.*` diff --git a/cli/tests/it/cmd.rs b/cli/tests/it/cmd.rs index c8f14bfaab343..86fd19ac28f11 100644 --- a/cli/tests/it/cmd.rs +++ b/cli/tests/it/cmd.rs @@ -520,8 +520,8 @@ contract Greeter { let output = cmd.stdout_lossy(); assert!(output.contains( " -Compiler run successful (with warnings) -warning[5667]: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning. +Compiler run successful with warnings: +Warning (5667): Warning: Unused function parameter. Remove or comment out the variable name to silence this warning. ", )); }); @@ -587,7 +587,7 @@ library FooLib { assert!(cmd.stdout_lossy().ends_with( " -Compiler run successful +Compiler run successful! " )); }); @@ -691,15 +691,15 @@ contract A { cmd.args(["build", "--force"]); let out = cmd.stdout(); // no warnings - assert!(out.trim().contains("Compiler run successful")); - assert!(!out.trim().contains("Compiler run successful (with warnings)")); + assert!(out.trim().contains("Compiler run successful!")); + assert!(!out.trim().contains("Compiler run successful with warnings:")); // don't ignore errors let config = Config { ignored_error_codes: vec![], ..Default::default() }; prj.write_config(config); let out = cmd.stdout(); - assert!(out.trim().contains("Compiler run successful (with warnings)")); + assert!(out.trim().contains("Compiler run successful with warnings:")); assert!( out.contains( r#"Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: " to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information."# @@ -728,7 +728,7 @@ contract A { let out = cmd.stdout(); // there are no errors assert!(out.trim().contains("Compiler run successful")); - assert!(out.trim().contains("Compiler run successful (with warnings)")); + assert!(out.trim().contains("Compiler run successful with warnings:")); // warning fails to compile let config = Config { ignored_error_codes: vec![], deny_warnings: true, ..Default::default() }; @@ -744,8 +744,8 @@ contract A { prj.write_config(config); let out = cmd.stdout(); - assert!(out.trim().contains("Compiler run successful")); - assert!(!out.trim().contains("Compiler run successful (with warnings)")); + assert!(out.trim().contains("Compiler run successful!")); + assert!(!out.trim().contains("Compiler run successful with warnings:")); }); // test against a local checkout, useful to debug with local ethers-rs patch @@ -1591,7 +1591,7 @@ forgetest_init!(can_build_sizes_repeatedly, |_prj: TestProject, mut cmd: TestCom assert!(out.contains(TEMPLATE_CONTRACT)); // get the entire table - let table = out.split("Compiler run successful").nth(1).unwrap().trim(); + let table = out.split("Compiler run successful!").nth(1).unwrap().trim(); let unchanged = cmd.stdout(); assert!(unchanged.contains(table), "{}", table); @@ -1605,7 +1605,7 @@ forgetest_init!(can_build_names_repeatedly, |_prj: TestProject, mut cmd: TestCom assert!(out.contains(TEMPLATE_CONTRACT)); // get the entire list - let list = out.split("Compiler run successful").nth(1).unwrap().trim(); + let list = out.split("Compiler run successful!").nth(1).unwrap().trim(); let unchanged = cmd.stdout(); assert!(unchanged.contains(list), "{}", list); diff --git a/cli/tests/it/config.rs b/cli/tests/it/config.rs index 880f993af4d31..451abb34738e7 100644 --- a/cli/tests/it/config.rs +++ b/cli/tests/it/config.rs @@ -275,7 +275,7 @@ contract Greeter {} assert!(cmd.stdout_lossy().ends_with( " -Compiler run successful +Compiler run successful! ", )); }); @@ -348,7 +348,7 @@ contract Foo { assert!(cmd.stdout_lossy().ends_with( " -Compiler run successful +Compiler run successful! ", )); }); diff --git a/config/README.md b/config/README.md index fb8885cd11c5d..4d68412755a01 100644 --- a/config/README.md +++ b/config/README.md @@ -78,7 +78,7 @@ allow_paths = [] # additional solc include paths include_paths = [] force = false -evm_version = 'london' +evm_version = 'shanghai' gas_reports = ['*'] gas_reports_ignore = [] ## Sets the concrete solc version to use, this overrides the `auto_detect_solc` value diff --git a/evm/src/executor/abi/mod.rs b/evm/src/executor/abi/mod.rs index 918e6fb6a3db1..f5c1f64c66077 100644 --- a/evm/src/executor/abi/mod.rs +++ b/evm/src/executor/abi/mod.rs @@ -33,6 +33,7 @@ abigen!( roll(uint256) warp(uint256) difficulty(uint256) + prevrandao(bytes32) fee(uint256) coinbase(address) store(address,bytes32,bytes32) diff --git a/evm/src/executor/inspector/cheatcodes/env.rs b/evm/src/executor/inspector/cheatcodes/env.rs index 0211b7ec474b2..90a6809ae1acf 100644 --- a/evm/src/executor/inspector/cheatcodes/env.rs +++ b/evm/src/executor/inspector/cheatcodes/env.rs @@ -13,7 +13,10 @@ use ethers::{ types::{Address, Bytes, U256}, }; use foundry_config::Config; -use revm::{primitives::Bytecode, Database, EVMData}; +use revm::{ + primitives::{Bytecode, B256}, + Database, EVMData, +}; use std::collections::BTreeMap; use tracing::trace; @@ -204,6 +207,10 @@ pub fn apply( data.env.block.difficulty = inner.0.into(); Bytes::new() } + HEVMCalls::Prevrandao(inner) => { + data.env.block.prevrandao = Some(B256::from(inner.0)); + Bytes::new() + } HEVMCalls::Roll(inner) => { data.env.block.number = inner.0.into(); Bytes::new() diff --git a/evm/src/utils.rs b/evm/src/utils.rs index e9afba7806a4b..5481f2ace0fab 100644 --- a/evm/src/utils.rs +++ b/evm/src/utils.rs @@ -1,6 +1,7 @@ use ethers::{ abi::{Abi, FixedBytes, Function}, prelude::{H256, U256}, + solc::EvmVersion, types::{Block, Chain}, }; use eyre::ContextCompat; @@ -136,6 +137,18 @@ pub fn halt_to_instruction_result( } } +/// Converts an `EvmVersion` into a `SpecId` +pub fn evm_spec(evm: &EvmVersion) -> SpecId { + match evm { + EvmVersion::Istanbul => SpecId::ISTANBUL, + EvmVersion::Berlin => SpecId::BERLIN, + EvmVersion::London => SpecId::LONDON, + EvmVersion::Paris => SpecId::MERGE, + EvmVersion::Shanghai => SpecId::SHANGHAI, + _ => panic!("Unsupported EVM version"), + } +} + /// Depending on the configured chain id and block number this should apply any specific changes /// /// This checks for: diff --git a/forge/src/multi_runner.rs b/forge/src/multi_runner.rs index 3952f97a226b8..a4402033d233f 100644 --- a/forge/src/multi_runner.rs +++ b/forge/src/multi_runner.rs @@ -309,7 +309,7 @@ impl MultiContractRunnerBuilder { known_contracts, evm_opts, env, - evm_spec: self.evm_spec.unwrap_or(SpecId::LONDON), + evm_spec: self.evm_spec.unwrap_or(SpecId::MERGE), sender: self.sender, errors: Some(execution_info.2), source_paths, diff --git a/forge/tests/it/config.rs b/forge/tests/it/config.rs index 5748221658bbf..53deca42e0e46 100644 --- a/forge/tests/it/config.rs +++ b/forge/tests/it/config.rs @@ -8,7 +8,9 @@ use foundry_config::{ fs_permissions::PathPermission, Config, FsPermissions, FuzzConfig, FuzzDictionaryConfig, InvariantConfig, RpcEndpoint, RpcEndpoints, }; -use foundry_evm::{decode::decode_console_logs, executor::inspector::CheatsConfig}; +use foundry_evm::{ + decode::decode_console_logs, executor::inspector::CheatsConfig, revm::primitives::SpecId, +}; use std::{ collections::BTreeMap, path::{Path, PathBuf}, @@ -37,6 +39,11 @@ impl TestConfig { Self { filter, ..Default::default() } } + pub fn evm_spec(mut self, spec: SpecId) -> Self { + self.runner.evm_spec = spec; + self + } + pub fn should_fail(self) -> Self { self.set_should_fail(true) } diff --git a/forge/tests/it/main.rs b/forge/tests/it/main.rs index aca6b9d5b365a..31c0cf748672e 100644 --- a/forge/tests/it/main.rs +++ b/forge/tests/it/main.rs @@ -6,6 +6,7 @@ mod fs; mod fuzz; mod invariant; mod repros; +mod spec; pub mod test_helpers; fn main() {} diff --git a/forge/tests/it/spec.rs b/forge/tests/it/spec.rs new file mode 100644 index 0000000000000..feb6b74e89dbc --- /dev/null +++ b/forge/tests/it/spec.rs @@ -0,0 +1,8 @@ +use crate::{config::*, test_helpers::filter::Filter}; +use forge::revm::primitives::SpecId; + +#[test] +fn test_shanghai_compat() { + let filter = Filter::new("", "ShanghaiCompat", ".*spec"); + TestConfig::filter(filter).evm_spec(SpecId::SHANGHAI).run(); +} diff --git a/testdata/cheats/Addr.t.sol b/testdata/cheats/Addr.t.sol index 08db01331bc7b..552a22814c412 100644 --- a/testdata/cheats/Addr.t.sol +++ b/testdata/cheats/Addr.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Assume.t.sol b/testdata/cheats/Assume.t.sol index 5375c11a0cfd7..d21711169b271 100644 --- a/testdata/cheats/Assume.t.sol +++ b/testdata/cheats/Assume.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Bank.t.sol b/testdata/cheats/Bank.t.sol index c5e9dfd7d8709..5cb85091e02a9 100644 --- a/testdata/cheats/Bank.t.sol +++ b/testdata/cheats/Bank.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Broadcast.t.sol b/testdata/cheats/Broadcast.t.sol index b344e6360e66a..7c221ce2aefd2 100644 --- a/testdata/cheats/Broadcast.t.sol +++ b/testdata/cheats/Broadcast.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/ChainId.t.sol b/testdata/cheats/ChainId.t.sol index cdc93ea2ad4d0..af1d816ea46e2 100644 --- a/testdata/cheats/ChainId.t.sol +++ b/testdata/cheats/ChainId.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Cheats.sol b/testdata/cheats/Cheats.sol index 770b6618bb4f0..f23666304ad94 100644 --- a/testdata/cheats/Cheats.sol +++ b/testdata/cheats/Cheats.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; interface Cheats { // This allows us to getRecordedLogs() @@ -39,8 +39,12 @@ interface Cheats { function warp(uint256) external; // Set block.difficulty (newDifficulty) + // No longer works from Paris onwards. function difficulty(uint256) external; + // Set block.prevrandao (newPrevrandao) + function prevrandao(bytes32) external; + // Set block.height (newHeight) function roll(uint256) external; diff --git a/testdata/cheats/Deal.t.sol b/testdata/cheats/Deal.t.sol index 5c7288514c7e3..eabe5c72d7373 100644 --- a/testdata/cheats/Deal.t.sol +++ b/testdata/cheats/Deal.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Derive.t.sol b/testdata/cheats/Derive.t.sol index 00fc2fd9969c1..952274635a51b 100644 --- a/testdata/cheats/Derive.t.sol +++ b/testdata/cheats/Derive.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Difficulty.t.sol b/testdata/cheats/Difficulty.t.sol deleted file mode 100644 index 075e38f1fcf0a..0000000000000 --- a/testdata/cheats/Difficulty.t.sol +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; - -import "ds-test/test.sol"; -import "./Cheats.sol"; - -contract DifficultyTest is DSTest { - Cheats constant cheats = Cheats(HEVM_ADDRESS); - - function testDifficulty() public { - assertEq(block.difficulty, 0); - cheats.difficulty(10); - assertEq(block.difficulty, 10, "difficulty cheatcode failed"); - } - - function testDifficultyFuzzed(uint256 newDifficulty) public { - cheats.assume(newDifficulty != block.difficulty); - assertEq(block.difficulty, 0); - cheats.difficulty(newDifficulty); - assertEq(block.difficulty, newDifficulty); - } - - function testDifficultySnapshotFuzzed(uint256 newDifficulty) public { - cheats.assume(newDifficulty != block.difficulty); - uint256 oldDifficulty = block.difficulty; - uint256 snapshot = cheats.snapshot(); - - cheats.difficulty(newDifficulty); - assertEq(block.difficulty, newDifficulty); - - assert(cheats.revertTo(snapshot)); - assertEq(block.difficulty, oldDifficulty); - } -} diff --git a/testdata/cheats/Env.t.sol b/testdata/cheats/Env.t.sol index 3f36e2eabd45c..9d83255d4cadd 100644 --- a/testdata/cheats/Env.t.sol +++ b/testdata/cheats/Env.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Etch.t.sol b/testdata/cheats/Etch.t.sol index eae197e289e63..1c1caf771de98 100644 --- a/testdata/cheats/Etch.t.sol +++ b/testdata/cheats/Etch.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/ExpectCall.t.sol b/testdata/cheats/ExpectCall.t.sol index d961437948701..6d088155a7e17 100644 --- a/testdata/cheats/ExpectCall.t.sol +++ b/testdata/cheats/ExpectCall.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/ExpectEmit.t.sol b/testdata/cheats/ExpectEmit.t.sol index 41be611325823..a5e22576a9149 100644 --- a/testdata/cheats/ExpectEmit.t.sol +++ b/testdata/cheats/ExpectEmit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/ExpectRevert.t.sol b/testdata/cheats/ExpectRevert.t.sol index aab4e9b3f3054..3bc946fc99e9a 100644 --- a/testdata/cheats/ExpectRevert.t.sol +++ b/testdata/cheats/ExpectRevert.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Fee.t.sol b/testdata/cheats/Fee.t.sol index e0365603db457..1d75b1ebff826 100644 --- a/testdata/cheats/Fee.t.sol +++ b/testdata/cheats/Fee.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Ffi.t.sol b/testdata/cheats/Ffi.t.sol index ce44149bf1079..3059e19913ccb 100644 --- a/testdata/cheats/Ffi.t.sol +++ b/testdata/cheats/Ffi.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Fork.t.sol b/testdata/cheats/Fork.t.sol index 3b652f44ebe80..669495f05bba6 100644 --- a/testdata/cheats/Fork.t.sol +++ b/testdata/cheats/Fork.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Fork2.t.sol b/testdata/cheats/Fork2.t.sol index dcc55d59e7f06..79ff075aff1b4 100644 --- a/testdata/cheats/Fork2.t.sol +++ b/testdata/cheats/Fork2.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Fs.t.sol b/testdata/cheats/Fs.t.sol index 4fbc66dd2ed65..edd7cc345adc6 100644 --- a/testdata/cheats/Fs.t.sol +++ b/testdata/cheats/Fs.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/GasMetering.t.sol b/testdata/cheats/GasMetering.t.sol index 94e61dc33731e..f362431712fe6 100644 --- a/testdata/cheats/GasMetering.t.sol +++ b/testdata/cheats/GasMetering.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/GetCode.t.sol b/testdata/cheats/GetCode.t.sol index 5ed29426b100f..e04b0835d7df7 100644 --- a/testdata/cheats/GetCode.t.sol +++ b/testdata/cheats/GetCode.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/GetDeployedCode.t.sol b/testdata/cheats/GetDeployedCode.t.sol index eebd75cd5e84a..4e9753cd992dc 100644 --- a/testdata/cheats/GetDeployedCode.t.sol +++ b/testdata/cheats/GetDeployedCode.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/GetNonce.t.sol b/testdata/cheats/GetNonce.t.sol index 7550a42a25b0e..e13f4ee35b006 100644 --- a/testdata/cheats/GetNonce.t.sol +++ b/testdata/cheats/GetNonce.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Json.t.sol b/testdata/cheats/Json.t.sol index 373b532e3b760..1cd0558a388ce 100644 --- a/testdata/cheats/Json.t.sol +++ b/testdata/cheats/Json.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Label.t.sol b/testdata/cheats/Label.t.sol index d0a8786c05217..e5b0347a403ec 100644 --- a/testdata/cheats/Label.t.sol +++ b/testdata/cheats/Label.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Load.t.sol b/testdata/cheats/Load.t.sol index 9e778e71bccd9..2fc2e12de576c 100644 --- a/testdata/cheats/Load.t.sol +++ b/testdata/cheats/Load.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/MemSafety.t.sol b/testdata/cheats/MemSafety.t.sol index 777b8edcf165d..a00f561773871 100644 --- a/testdata/cheats/MemSafety.t.sol +++ b/testdata/cheats/MemSafety.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/MockCall.t.sol b/testdata/cheats/MockCall.t.sol index f8b446eb9be53..d3e70423ad2f2 100644 --- a/testdata/cheats/MockCall.t.sol +++ b/testdata/cheats/MockCall.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Parse.t.sol b/testdata/cheats/Parse.t.sol index c55d430375ed1..ff8ce1d9fad2c 100644 --- a/testdata/cheats/Parse.t.sol +++ b/testdata/cheats/Parse.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Prank.t.sol b/testdata/cheats/Prank.t.sol index 81e24ed5c944f..fccccff7c9697 100644 --- a/testdata/cheats/Prank.t.sol +++ b/testdata/cheats/Prank.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Prevrandao.t.sol b/testdata/cheats/Prevrandao.t.sol new file mode 100644 index 0000000000000..aec944a4ff508 --- /dev/null +++ b/testdata/cheats/Prevrandao.t.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity >=0.8.18; + +import "ds-test/test.sol"; +import "./Cheats.sol"; + +contract PrevrandaoTest is DSTest { + Cheats constant cheats = Cheats(HEVM_ADDRESS); + + function testPrevrandao() public { + assertEq(block.prevrandao, 0); + cheats.prevrandao(bytes32(uint256(10))); + assertEq(block.prevrandao, 10, "prevrandao cheatcode failed"); + } + + function testPrevrandaoFuzzed(uint256 newPrevrandao) public { + cheats.assume(newPrevrandao != block.prevrandao); + assertEq(block.prevrandao, 0); + cheats.prevrandao(bytes32(newPrevrandao)); + assertEq(block.prevrandao, newPrevrandao); + } + + function testPrevrandaoSnapshotFuzzed(uint256 newPrevrandao) public { + cheats.assume(newPrevrandao != block.prevrandao); + uint256 oldPrevrandao = block.prevrandao; + uint256 snapshot = cheats.snapshot(); + + cheats.prevrandao(bytes32(newPrevrandao)); + assertEq(block.prevrandao, newPrevrandao); + + assert(cheats.revertTo(snapshot)); + assertEq(block.prevrandao, oldPrevrandao); + } +} diff --git a/testdata/cheats/ProjectRoot.t.sol b/testdata/cheats/ProjectRoot.t.sol index dfa6b6510907c..efa4194a1cff3 100644 --- a/testdata/cheats/ProjectRoot.t.sol +++ b/testdata/cheats/ProjectRoot.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Record.t.sol b/testdata/cheats/Record.t.sol index ea201a20593ab..94c53f365747d 100644 --- a/testdata/cheats/Record.t.sol +++ b/testdata/cheats/Record.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/RecordLogs.t.sol b/testdata/cheats/RecordLogs.t.sol index c9003ce97c6de..6b8b34e22cc8a 100644 --- a/testdata/cheats/RecordLogs.t.sol +++ b/testdata/cheats/RecordLogs.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Remember.t.sol b/testdata/cheats/Remember.t.sol index db096f9a3bdf0..a2da62f2414e2 100644 --- a/testdata/cheats/Remember.t.sol +++ b/testdata/cheats/Remember.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Roll.t.sol b/testdata/cheats/Roll.t.sol index 17ad9dc168629..3bc58be6720c3 100644 --- a/testdata/cheats/Roll.t.sol +++ b/testdata/cheats/Roll.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/RpcUrls.t.sol b/testdata/cheats/RpcUrls.t.sol index 0b629de769055..b4d5a6d530537 100644 --- a/testdata/cheats/RpcUrls.t.sol +++ b/testdata/cheats/RpcUrls.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/SetNonce.t.sol b/testdata/cheats/SetNonce.t.sol index 75476806b9daf..4c73788370c92 100644 --- a/testdata/cheats/SetNonce.t.sol +++ b/testdata/cheats/SetNonce.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Setup.t.sol b/testdata/cheats/Setup.t.sol index c661074348191..2f77db16ec300 100644 --- a/testdata/cheats/Setup.t.sol +++ b/testdata/cheats/Setup.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; @@ -21,7 +21,7 @@ contract CheatsSetupTest is DSTest { cheats.chainId(99); cheats.roll(100); cheats.fee(1000); - cheats.difficulty(10000); + cheats.prevrandao(bytes32(uint256(10000))); cheats.startPrank(address(1337)); } @@ -29,7 +29,7 @@ contract CheatsSetupTest is DSTest { assertEq(block.timestamp, 10, "block timestamp was not persisted from setup"); assertEq(block.number, 100, "block number was not persisted from setup"); assertEq(block.basefee, 1000, "basefee was not persisted from setup"); - assertEq(block.difficulty, 10000, "difficulty was not persisted from setup"); + assertEq(block.prevrandao, 10000, "prevrandao was not persisted from setup"); assertEq(block.chainid, 99, "chainid was not persisted from setup"); victim.assertSender(address(1337)); } diff --git a/testdata/cheats/Sign.t.sol b/testdata/cheats/Sign.t.sol index 4dc195409ad8e..1f4913f378fe7 100644 --- a/testdata/cheats/Sign.t.sol +++ b/testdata/cheats/Sign.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Snapshots.t.sol b/testdata/cheats/Snapshots.t.sol index dfc67ca274c12..0d1bc0df3df7f 100644 --- a/testdata/cheats/Snapshots.t.sol +++ b/testdata/cheats/Snapshots.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; @@ -36,7 +36,7 @@ contract SnapshotTest is DSTest { function testBlockValues() public { uint256 num = block.number; uint256 time = block.timestamp; - uint256 difficulty = block.difficulty; + uint256 prevrandao = block.prevrandao; uint256 snapshot = cheats.snapshot(); @@ -46,13 +46,13 @@ contract SnapshotTest is DSTest { cheats.roll(99); assertEq(block.number, 99); - cheats.difficulty(123); - assertEq(block.difficulty, 123); + cheats.prevrandao(bytes32(uint256(123))); + assertEq(block.prevrandao, 123); assert(cheats.revertTo(snapshot)); assertEq(block.number, num, "snapshot revert for block.number unsuccessful"); assertEq(block.timestamp, time, "snapshot revert for block.timestamp unsuccessful"); - assertEq(block.difficulty, difficulty, "snapshot revert for block.difficulty unsuccessful"); + assertEq(block.prevrandao, prevrandao, "snapshot revert for block.prevrandao unsuccessful"); } } diff --git a/testdata/cheats/Store.t.sol b/testdata/cheats/Store.t.sol index 24bf4d8c65a89..c5ef0c9261dc0 100644 --- a/testdata/cheats/Store.t.sol +++ b/testdata/cheats/Store.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/ToString.t.sol b/testdata/cheats/ToString.t.sol index 16f8784099f35..1b272dbacfb26 100644 --- a/testdata/cheats/ToString.t.sol +++ b/testdata/cheats/ToString.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Travel.t.sol b/testdata/cheats/Travel.t.sol index dc276ea753ead..442bdc7211c27 100644 --- a/testdata/cheats/Travel.t.sol +++ b/testdata/cheats/Travel.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/cheats/Warp.t.sol b/testdata/cheats/Warp.t.sol index 825280ccada77..a6e58a7c7bc4f 100644 --- a/testdata/cheats/Warp.t.sol +++ b/testdata/cheats/Warp.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "./Cheats.sol"; diff --git a/testdata/core/Abstract.t.sol b/testdata/core/Abstract.t.sol index 0ac0411e30f71..5ceebf2377f29 100644 --- a/testdata/core/Abstract.t.sol +++ b/testdata/core/Abstract.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; contract TestFixture { function something() public pure returns (string memory) { diff --git a/testdata/core/ContractEnvironment.t.sol b/testdata/core/ContractEnvironment.t.sol index 0f6f955d43f59..6fb9b0a0fd585 100644 --- a/testdata/core/ContractEnvironment.t.sol +++ b/testdata/core/ContractEnvironment.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; @@ -22,6 +22,6 @@ contract ContractEnvironmentTest is DSTest { assertEq(blockhash(block.number), 0x0, "blockhash is incorrect"); assertEq(block.coinbase, 0x0000000000000000000000000000000000000000, "coinbase is incorrect"); assertEq(block.timestamp, 1, "timestamp is incorrect"); - assertEq(block.difficulty, 0, "difficulty is incorrect"); + assertEq(block.prevrandao, 0, "prevrandao is incorrect"); } } diff --git a/testdata/core/DSStyle.t.sol b/testdata/core/DSStyle.t.sol index f59b6a96cf410..fcfe43afaf8cf 100644 --- a/testdata/core/DSStyle.t.sol +++ b/testdata/core/DSStyle.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/core/FailingSetup.t.sol b/testdata/core/FailingSetup.t.sol index 80bc9bfb5ede6..bf5281093263c 100644 --- a/testdata/core/FailingSetup.t.sol +++ b/testdata/core/FailingSetup.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/core/FailingTestAfterFailedSetup.t.sol b/testdata/core/FailingTestAfterFailedSetup.t.sol index 1b26874b59cc8..6b1755ecab58e 100644 --- a/testdata/core/FailingTestAfterFailedSetup.t.sol +++ b/testdata/core/FailingTestAfterFailedSetup.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/core/LibraryLinking.t.sol b/testdata/core/LibraryLinking.t.sol index ec1b423fd9492..9aa2e1d6332c3 100644 --- a/testdata/core/LibraryLinking.t.sol +++ b/testdata/core/LibraryLinking.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/core/MultipleSetup.t.sol b/testdata/core/MultipleSetup.t.sol index 020b1e1fa5c2a..db057392e94fd 100644 --- a/testdata/core/MultipleSetup.t.sol +++ b/testdata/core/MultipleSetup.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/core/PaymentFailure.t.sol b/testdata/core/PaymentFailure.t.sol index bcc979a4aa618..3957e4a0276a8 100644 --- a/testdata/core/PaymentFailure.t.sol +++ b/testdata/core/PaymentFailure.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/core/Reverting.t.sol b/testdata/core/Reverting.t.sol index 5d826ba643fcc..aa22f67370484 100644 --- a/testdata/core/Reverting.t.sol +++ b/testdata/core/Reverting.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; contract RevertingTest { function testFailRevert() public pure { diff --git a/testdata/core/SetupConsistency.t.sol b/testdata/core/SetupConsistency.t.sol index 1fda35377e95f..204435053f127 100644 --- a/testdata/core/SetupConsistency.t.sol +++ b/testdata/core/SetupConsistency.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fixtures/GetCode/UnlinkedContract.sol b/testdata/fixtures/GetCode/UnlinkedContract.sol index d6b673c34ca5c..606b348bb85b5 100644 --- a/testdata/fixtures/GetCode/UnlinkedContract.sol +++ b/testdata/fixtures/GetCode/UnlinkedContract.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; library SmolLibrary { function add(uint256 a, uint256 b) public pure returns (uint256 c) { diff --git a/testdata/fixtures/GetCode/WorkingContract.sol b/testdata/fixtures/GetCode/WorkingContract.sol index 63913035c8b5b..892361f33451f 100644 --- a/testdata/fixtures/GetCode/WorkingContract.sol +++ b/testdata/fixtures/GetCode/WorkingContract.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; contract WorkingContract { uint256 public constant secret = 42; diff --git a/testdata/fork/ForkSame_1.t.sol b/testdata/fork/ForkSame_1.t.sol index 3571728a49ed5..41ba1e721338d 100644 --- a/testdata/fork/ForkSame_1.t.sol +++ b/testdata/fork/ForkSame_1.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/fork/ForkSame_2.t.sol b/testdata/fork/ForkSame_2.t.sol index 3571728a49ed5..41ba1e721338d 100644 --- a/testdata/fork/ForkSame_2.t.sol +++ b/testdata/fork/ForkSame_2.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/fork/Transact.t.sol b/testdata/fork/Transact.t.sol index 1a79751cdeacf..58d040e8881f1 100644 --- a/testdata/fork/Transact.t.sol +++ b/testdata/fork/Transact.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/foundry.toml b/testdata/foundry.toml index 396b34314cf34..29dc2bf427822 100644 --- a/testdata/foundry.toml +++ b/testdata/foundry.toml @@ -1,5 +1,5 @@ [profile.default] -auto_detect_solc = true +solc = '0.8.19' block_base_fee_per_gas = 0 block_coinbase = '0x0000000000000000000000000000000000000000' block_difficulty = 0 @@ -9,7 +9,7 @@ block_timestamp = 0 bytecode_hash = 'ipfs' cache = true cache_path = 'cache' -evm_version = 'london' +evm_version = 'paris' extra_output = [] extra_output_files = [] ffi = false diff --git a/testdata/fs/Default.t.sol b/testdata/fs/Default.t.sol index da5e31ba33153..074b051234f41 100644 --- a/testdata/fs/Default.t.sol +++ b/testdata/fs/Default.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/fs/Disabled.t.sol b/testdata/fs/Disabled.t.sol index 6e40a7e479a55..04b80e09c3a96 100644 --- a/testdata/fs/Disabled.t.sol +++ b/testdata/fs/Disabled.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/fuzz/Fuzz.t.sol b/testdata/fuzz/Fuzz.t.sol index f9e27b2918a12..bfb4080feaee8 100644 --- a/testdata/fuzz/Fuzz.t.sol +++ b/testdata/fuzz/Fuzz.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/FuzzInt.t.sol b/testdata/fuzz/FuzzInt.t.sol index 67583e05a2118..32a009a4582f8 100644 --- a/testdata/fuzz/FuzzInt.t.sol +++ b/testdata/fuzz/FuzzInt.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/FuzzUint.t.sol b/testdata/fuzz/FuzzUint.t.sol index eeea732e174b3..34717ea321950 100644 --- a/testdata/fuzz/FuzzUint.t.sol +++ b/testdata/fuzz/FuzzUint.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/common/InvariantInnerContract.t.sol b/testdata/fuzz/invariant/common/InvariantInnerContract.t.sol index 8fd012297b2bf..7503527e6a2cb 100644 --- a/testdata/fuzz/invariant/common/InvariantInnerContract.t.sol +++ b/testdata/fuzz/invariant/common/InvariantInnerContract.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/common/InvariantReentrancy.t.sol b/testdata/fuzz/invariant/common/InvariantReentrancy.t.sol index 9d1fda02f8dec..7b10a759ab801 100644 --- a/testdata/fuzz/invariant/common/InvariantReentrancy.t.sol +++ b/testdata/fuzz/invariant/common/InvariantReentrancy.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/common/InvariantTest1.t.sol b/testdata/fuzz/invariant/common/InvariantTest1.t.sol index 362af676d719c..0668a46ba03ae 100644 --- a/testdata/fuzz/invariant/common/InvariantTest1.t.sol +++ b/testdata/fuzz/invariant/common/InvariantTest1.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/target/ExcludeContracts.t.sol b/testdata/fuzz/invariant/target/ExcludeContracts.t.sol index 0ce8e16d3a618..de8f6a3bb56a2 100644 --- a/testdata/fuzz/invariant/target/ExcludeContracts.t.sol +++ b/testdata/fuzz/invariant/target/ExcludeContracts.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/target/ExcludeSenders.t.sol b/testdata/fuzz/invariant/target/ExcludeSenders.t.sol index 86b5630143cde..7021d2b1b5a6e 100644 --- a/testdata/fuzz/invariant/target/ExcludeSenders.t.sol +++ b/testdata/fuzz/invariant/target/ExcludeSenders.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/target/TargetContracts.t.sol b/testdata/fuzz/invariant/target/TargetContracts.t.sol index b7aca0de0105c..896b93a68e181 100644 --- a/testdata/fuzz/invariant/target/TargetContracts.t.sol +++ b/testdata/fuzz/invariant/target/TargetContracts.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/target/TargetSelectors.t.sol b/testdata/fuzz/invariant/target/TargetSelectors.t.sol index 0e7ddc1afdc09..570fd8cb04cfb 100644 --- a/testdata/fuzz/invariant/target/TargetSelectors.t.sol +++ b/testdata/fuzz/invariant/target/TargetSelectors.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/target/TargetSenders.t.sol b/testdata/fuzz/invariant/target/TargetSenders.t.sol index f8d38ae1c02ec..63149cd6acca8 100644 --- a/testdata/fuzz/invariant/target/TargetSenders.t.sol +++ b/testdata/fuzz/invariant/target/TargetSenders.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/targetAbi/ExcludeArtifacts.t.sol b/testdata/fuzz/invariant/targetAbi/ExcludeArtifacts.t.sol index 4ed69cc2ccab0..d8cc28db16143 100644 --- a/testdata/fuzz/invariant/targetAbi/ExcludeArtifacts.t.sol +++ b/testdata/fuzz/invariant/targetAbi/ExcludeArtifacts.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/targetAbi/TargetArtifactSelectors.t.sol b/testdata/fuzz/invariant/targetAbi/TargetArtifactSelectors.t.sol index c9780623265d8..5655714e2639b 100644 --- a/testdata/fuzz/invariant/targetAbi/TargetArtifactSelectors.t.sol +++ b/testdata/fuzz/invariant/targetAbi/TargetArtifactSelectors.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/targetAbi/TargetArtifactSelectors2.t.sol b/testdata/fuzz/invariant/targetAbi/TargetArtifactSelectors2.t.sol index b335863690925..0275adcbc1224 100644 --- a/testdata/fuzz/invariant/targetAbi/TargetArtifactSelectors2.t.sol +++ b/testdata/fuzz/invariant/targetAbi/TargetArtifactSelectors2.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/fuzz/invariant/targetAbi/TargetArtifacts.t.sol b/testdata/fuzz/invariant/targetAbi/TargetArtifacts.t.sol index eb9f09d931295..9be570f7f268f 100644 --- a/testdata/fuzz/invariant/targetAbi/TargetArtifacts.t.sol +++ b/testdata/fuzz/invariant/targetAbi/TargetArtifacts.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/logs/DebugLogs.t.sol b/testdata/logs/DebugLogs.t.sol index 5b6386e54c377..aa827aee646cc 100644 --- a/testdata/logs/DebugLogs.t.sol +++ b/testdata/logs/DebugLogs.t.sol @@ -1,4 +1,4 @@ -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/logs/HardhatLogs.t.sol b/testdata/logs/HardhatLogs.t.sol index e8a7cd419ca20..0230c818a1a33 100644 --- a/testdata/logs/HardhatLogs.t.sol +++ b/testdata/logs/HardhatLogs.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "./console.sol"; diff --git a/testdata/logs/console.sol b/testdata/logs/console.sol index 8a04c7aba75cd..f75897ddf518e 100644 --- a/testdata/logs/console.sol +++ b/testdata/logs/console.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; library console { address constant CONSOLE_ADDRESS = address(0x000000000000000000636F6e736F6c652e6c6f67); diff --git a/testdata/repros/Issue2623.t.sol b/testdata/repros/Issue2623.t.sol index 28dc166e87845..c9e7a5fcd28c8 100644 --- a/testdata/repros/Issue2623.t.sol +++ b/testdata/repros/Issue2623.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue2629.t.sol b/testdata/repros/Issue2629.t.sol index d4773b55501b2..af504e3090ab9 100644 --- a/testdata/repros/Issue2629.t.sol +++ b/testdata/repros/Issue2629.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue2723.t.sol b/testdata/repros/Issue2723.t.sol index b88cd26d7336c..03358502c8dd8 100644 --- a/testdata/repros/Issue2723.t.sol +++ b/testdata/repros/Issue2723.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue2898.t.sol b/testdata/repros/Issue2898.t.sol index 49126b264b669..3facd5ea7d969 100644 --- a/testdata/repros/Issue2898.t.sol +++ b/testdata/repros/Issue2898.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue2956.t.sol b/testdata/repros/Issue2956.t.sol index 820873d42de6d..721cf94ee0e6f 100644 --- a/testdata/repros/Issue2956.t.sol +++ b/testdata/repros/Issue2956.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue2984.t.sol b/testdata/repros/Issue2984.t.sol index 61c73733fa7cb..2b0edaed8ee66 100644 --- a/testdata/repros/Issue2984.t.sol +++ b/testdata/repros/Issue2984.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3055.t.sol b/testdata/repros/Issue3055.t.sol index 088b14b18b672..598a1380575f5 100644 --- a/testdata/repros/Issue3055.t.sol +++ b/testdata/repros/Issue3055.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3077.t.sol b/testdata/repros/Issue3077.t.sol index 66bedaf42b450..16e6c255667e7 100644 --- a/testdata/repros/Issue3077.t.sol +++ b/testdata/repros/Issue3077.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3110.t.sol b/testdata/repros/Issue3110.t.sol index 98ed0b5b2b24d..d3fb5cbd7a6d4 100644 --- a/testdata/repros/Issue3110.t.sol +++ b/testdata/repros/Issue3110.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3119.t.sol b/testdata/repros/Issue3119.t.sol index 610a2aebcb0d9..90ef84c56a18e 100644 --- a/testdata/repros/Issue3119.t.sol +++ b/testdata/repros/Issue3119.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3189.t.sol b/testdata/repros/Issue3189.t.sol index 0e4b475ee56f0..3315c7e41ae47 100644 --- a/testdata/repros/Issue3189.t.sol +++ b/testdata/repros/Issue3189.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3190.t.sol b/testdata/repros/Issue3190.t.sol index daf78c70b4f6c..1f67e732318cd 100644 --- a/testdata/repros/Issue3190.t.sol +++ b/testdata/repros/Issue3190.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3192.t.sol b/testdata/repros/Issue3192.t.sol index ec75b73158293..f82f8c73d4ca9 100644 --- a/testdata/repros/Issue3192.t.sol +++ b/testdata/repros/Issue3192.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3220.t.sol b/testdata/repros/Issue3220.t.sol index 21508f97fe1aa..d3478c17b8fcc 100644 --- a/testdata/repros/Issue3220.t.sol +++ b/testdata/repros/Issue3220.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3221.sol b/testdata/repros/Issue3221.sol index ac9e303a0555e..b53c02655e74d 100644 --- a/testdata/repros/Issue3221.sol +++ b/testdata/repros/Issue3221.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3223.sol b/testdata/repros/Issue3223.sol index a256abfd506a0..412b766b7c014 100644 --- a/testdata/repros/Issue3223.sol +++ b/testdata/repros/Issue3223.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3347.sol b/testdata/repros/Issue3347.sol index 7dd2b5881831a..6744688ea5254 100644 --- a/testdata/repros/Issue3347.sol +++ b/testdata/repros/Issue3347.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3596.t.sol b/testdata/repros/Issue3596.t.sol index 58f33396a1b7b..4917d056cbb01 100644 --- a/testdata/repros/Issue3596.t.sol +++ b/testdata/repros/Issue3596.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3653.t.sol b/testdata/repros/Issue3653.t.sol index a7d6bd492ba05..5e230eadd4f12 100644 --- a/testdata/repros/Issue3653.t.sol +++ b/testdata/repros/Issue3653.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3661.sol b/testdata/repros/Issue3661.sol index 56a9e3e2d23d9..0eab0914e32e0 100644 --- a/testdata/repros/Issue3661.sol +++ b/testdata/repros/Issue3661.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; diff --git a/testdata/repros/Issue3674.t.sol b/testdata/repros/Issue3674.t.sol index 947ce97745052..f1bd5c379aa3e 100644 --- a/testdata/repros/Issue3674.t.sol +++ b/testdata/repros/Issue3674.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3685.t.sol b/testdata/repros/Issue3685.t.sol index 99c4bb1414021..100cc4688b06d 100644 --- a/testdata/repros/Issue3685.t.sol +++ b/testdata/repros/Issue3685.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3703.t.sol b/testdata/repros/Issue3703.t.sol index db0113737c7f3..2857147ea88b3 100644 --- a/testdata/repros/Issue3703.t.sol +++ b/testdata/repros/Issue3703.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3708.sol b/testdata/repros/Issue3708.sol index d3a3c2ba8314c..27d1374aa9c5d 100644 --- a/testdata/repros/Issue3708.sol +++ b/testdata/repros/Issue3708.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue3753.t.sol b/testdata/repros/Issue3753.t.sol index f88ef0e4e339f..32babc9490308 100644 --- a/testdata/repros/Issue3753.t.sol +++ b/testdata/repros/Issue3753.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue4586.t.sol b/testdata/repros/Issue4586.t.sol index 0c11e7072f6e8..e7dbbb1079a36 100644 --- a/testdata/repros/Issue4586.t.sol +++ b/testdata/repros/Issue4586.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue4630.t.sol b/testdata/repros/Issue4630.t.sol index 8ec0674fcec78..14ebaadc494db 100644 --- a/testdata/repros/Issue4630.t.sol +++ b/testdata/repros/Issue4630.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/repros/Issue4640.t.sol b/testdata/repros/Issue4640.t.sol index 2265c969c3c69..aa95f32287e4e 100644 --- a/testdata/repros/Issue4640.t.sol +++ b/testdata/repros/Issue4640.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/script/deploy.sol b/testdata/script/deploy.sol index 77e775d8e763c..13cc9959714cb 100644 --- a/testdata/script/deploy.sol +++ b/testdata/script/deploy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Unlicense -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import {DSTest} from "../lib/ds-test/src/test.sol"; import {Cheats} from "../cheats/Cheats.sol"; diff --git a/testdata/spec/ShanghaiCompat.t.sol b/testdata/spec/ShanghaiCompat.t.sol new file mode 100644 index 0000000000000..f6f0c4e3f483d --- /dev/null +++ b/testdata/spec/ShanghaiCompat.t.sol @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity >=0.8.18; + +import "ds-test/test.sol"; +import "../cheats/Cheats.sol"; + +contract ShanghaiCompat is DSTest { + Cheats constant cheats = Cheats(HEVM_ADDRESS); + + function testPush0() public { + address target = address(uint160(uint256(0xc4f3))); + + bytes memory bytecode = hex"365f5f37365ff3"; + // 36 CALLDATASIZE + // 5F PUSH0 + // 5F PUSH0 + // 37 CALLDATACOPY -> copies calldata at mem[0..calldatasize] + + // 36 CALLDATASIZE + // 5F PUSH0 + // F3 RETURN -> returns mem[0..calldatasize] + + cheats.etch(target, bytecode); + + (bool success, bytes memory result) = target.call(bytes("hello PUSH0")); + assertTrue(success); + assertEq(string(result), "hello PUSH0"); + } +} diff --git a/testdata/trace/ConflictingSignatures.t.sol b/testdata/trace/ConflictingSignatures.t.sol index 10faa73f085fb..41d019cb00051 100644 --- a/testdata/trace/ConflictingSignatures.t.sol +++ b/testdata/trace/ConflictingSignatures.t.sol @@ -1,4 +1,4 @@ -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol"; diff --git a/testdata/trace/Trace.t.sol b/testdata/trace/Trace.t.sol index 4b991934d1fd1..04ed20861371a 100644 --- a/testdata/trace/Trace.t.sol +++ b/testdata/trace/Trace.t.sol @@ -1,4 +1,4 @@ -pragma solidity >=0.8.0; +pragma solidity >=0.8.18; import "ds-test/test.sol"; import "../cheats/Cheats.sol";