diff --git a/crates/zksync/compilers/src/compilers/zksolc/mod.rs b/crates/zksync/compilers/src/compilers/zksolc/mod.rs index bfab9adc83..7a44cd733b 100644 --- a/crates/zksync/compilers/src/compilers/zksolc/mod.rs +++ b/crates/zksync/compilers/src/compilers/zksolc/mod.rs @@ -583,6 +583,18 @@ impl ZkSolc { /// Get path for installed zksolc version. Returns `Ok(None)` if not installed pub fn find_installed_version(version: &Version) -> Result> { + let min_supported_version = Self::zksolc_minimum_supported_version(); + let latest_supported_version = Self::zksolc_latest_supported_version(); + if *version < min_supported_version { + return Err(SolcError::msg(format!( + "Specifying zksolc v{version} not supported. Minimum version supported is v{min_supported_version}" + ))); + } + if *version > latest_supported_version { + return Err(SolcError::msg(format!( + "Specifying zksolc v{version} not supported. Latest version supported is v{latest_supported_version}" + ))); + } let zksolc = Self::compiler_path(version)?; if !zksolc.is_file() {