From faa38891028caa576fdf286edb0472bab3926e4d Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 14 Mar 2025 13:17:56 +0100 Subject: [PATCH 1/2] fix: update normalization --- crates/artifacts/solc/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/artifacts/solc/src/lib.rs b/crates/artifacts/solc/src/lib.rs index e643f91f2..709cee1a1 100644 --- a/crates/artifacts/solc/src/lib.rs +++ b/crates/artifacts/solc/src/lib.rs @@ -39,7 +39,8 @@ use foundry_compilers_core::{ error::SolcError, utils::{ strip_prefix_owned, BERLIN_SOLC, BYZANTIUM_SOLC, CANCUN_SOLC, CONSTANTINOPLE_SOLC, - ISTANBUL_SOLC, LONDON_SOLC, PARIS_SOLC, PETERSBURG_SOLC, PRAGUE_SOLC, SHANGHAI_SOLC, + ISTANBUL_SOLC, LONDON_SOLC, OSAKA_SOLC, PARIS_SOLC, PETERSBURG_SOLC, PRAGUE_SOLC, + SHANGHAI_SOLC, }, }; pub use serde_helpers::{deserialize_bytes, deserialize_opt_bytes}; @@ -856,8 +857,10 @@ impl EvmVersion { if *version >= BYZANTIUM_SOLC { // If the Solc version is the latest, it supports all EVM versions. // For all other cases, cap at the at-the-time highest possible fork. - let normalized = if *version >= PRAGUE_SOLC { + let normalized = if *version >= OSAKA_SOLC { self + } else if *version >= PRAGUE_SOLC { + Self::Cancun } else if self >= Self::Cancun && *version >= CANCUN_SOLC { Self::Cancun } else if self >= Self::Shanghai && *version >= SHANGHAI_SOLC { From 27e9f51a41380fda5bd00e3fb3f1f1e648762bc5 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 14 Mar 2025 13:22:43 +0100 Subject: [PATCH 2/2] fix --- crates/artifacts/solc/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/artifacts/solc/src/lib.rs b/crates/artifacts/solc/src/lib.rs index 709cee1a1..f9d122b6f 100644 --- a/crates/artifacts/solc/src/lib.rs +++ b/crates/artifacts/solc/src/lib.rs @@ -860,7 +860,7 @@ impl EvmVersion { let normalized = if *version >= OSAKA_SOLC { self } else if *version >= PRAGUE_SOLC { - Self::Cancun + Self::Prague } else if self >= Self::Cancun && *version >= CANCUN_SOLC { Self::Cancun } else if self >= Self::Shanghai && *version >= SHANGHAI_SOLC { @@ -2024,6 +2024,7 @@ mod tests { ("0.8.26", EvmVersion::Cancun, Some(EvmVersion::Cancun)), ("0.8.26", EvmVersion::Prague, Some(EvmVersion::Cancun)), ("0.8.27", EvmVersion::Prague, Some(EvmVersion::Prague)), + ("0.8.29", EvmVersion::Osaka, Some(EvmVersion::Osaka)), ] { let version = Version::from_str(solc_version).unwrap(); assert_eq!(