diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cda2845ca..d0cecad90 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,8 @@ on: branches: - main pull_request: + branches: + - main concurrency: cancel-in-progress: true diff --git a/crates/zkforge/bin/cmd/zk_build.rs b/crates/zkforge/bin/cmd/zk_build.rs index 4ccc0df10..1711ec364 100644 --- a/crates/zkforge/bin/cmd/zk_build.rs +++ b/crates/zkforge/bin/cmd/zk_build.rs @@ -156,7 +156,6 @@ impl ZkBuildArgs { let zksolc_manager = self.setup_zksolc_manager()?; - println!("Compiling smart contracts..."); self.compile_smart_contracts(zksolc_manager, project) } /// Returns whether `ZkBuildArgs` was configured with `--watch` diff --git a/crates/zkforge/bin/cmd/zk_solc.rs b/crates/zkforge/bin/cmd/zk_solc.rs index 8ccdfd9d2..1fc0f3d9e 100644 --- a/crates/zkforge/bin/cmd/zk_solc.rs +++ b/crates/zkforge/bin/cmd/zk_solc.rs @@ -231,7 +231,6 @@ impl ZkSolc { for source in version.1 { // Contract path is an absolute path of the file. let contract_path = source.0.clone(); - // Check if the contract_path is in 'sources' directory or its subdirectories let is_in_sources_dir = contract_path .ancestors() @@ -254,7 +253,6 @@ impl ZkSolc { // Step 5: Run Compiler and Handle Output let mut cmd = Command::new(&self.compiler_path); let mut child = cmd - .arg(contract_path.clone()) .args(&comp_args) .stdin(Stdio::piped()) .stderr(Stdio::piped()) diff --git a/crates/zkforge/bin/cmd/zksolc_manager.rs b/crates/zkforge/bin/cmd/zksolc_manager.rs index ae9f63581..e12ea63f1 100644 --- a/crates/zkforge/bin/cmd/zksolc_manager.rs +++ b/crates/zkforge/bin/cmd/zksolc_manager.rs @@ -34,7 +34,8 @@ use serde::Serialize; use std::{fmt, fs, fs::File, io::copy, os::unix::prelude::PermissionsExt, path::PathBuf}; use url::Url; -const ZKSOLC_DOWNLOAD_BASE_URL: &str = "https://github.com/matter-labs/zksolc-bin/raw/main"; +const ZKSOLC_DOWNLOAD_BASE_URL: &str = + "https://github.com/matter-labs/zksolc-bin/releases/download/"; /// `ZkSolcVersion` is an enumeration of the supported versions of the `zksolc` compiler. /// @@ -56,9 +57,12 @@ pub enum ZkSolcVersion { V139, V1310, V1311, + V1313, + V1314, + V1315, } -pub const DEFAULT_ZKSOLC_VERSION: &str = "v1.3.11"; +pub const DEFAULT_ZKSOLC_VERSION: &str = "v1.3.15"; /// `parse_version` parses a string representation of a `zksolc` compiler version /// and returns the `ZkSolcVersion` enum variant if it matches a supported version. @@ -80,6 +84,9 @@ fn parse_version(version: &str) -> Result { "v1.3.9" => Ok(ZkSolcVersion::V139), "v1.3.10" => Ok(ZkSolcVersion::V1310), "v1.3.11" => Ok(ZkSolcVersion::V1311), + "v1.3.13" => Ok(ZkSolcVersion::V1313), + "v1.3.14" => Ok(ZkSolcVersion::V1314), + "v1.3.15" => Ok(ZkSolcVersion::V1315), _ => Err(Error::msg( "ZkSolc compiler version not supported. Proper version format: 'v1.3.x'", )), @@ -101,6 +108,9 @@ impl ZkSolcVersion { ZkSolcVersion::V139 => "v1.3.9", ZkSolcVersion::V1310 => "v1.3.10", ZkSolcVersion::V1311 => "v1.3.11", + ZkSolcVersion::V1313 => "v1.3.13", + ZkSolcVersion::V1314 => "v1.3.14", + ZkSolcVersion::V1315 => "v1.3.15", } } } @@ -206,8 +216,8 @@ impl ZkSolcManagerOpts { /// # Example /// /// ```ignore -/// use foundry_cli::cmd::forge::zksolc_manager::{ZkSolcManagerBuilder, ZkSolcManagerOpts}; -/// let opts = ZkSolcManagerOpts::new("v1.3.11") +/// use zkforge::zksolc_manager::{ZkSolcManagerBuilder, ZkSolcManagerOpts}; +/// let opts = ZkSolcManagerOpts::new("v1.3.15") /// let zk_solc_manager = ZkSolcManagerBuilder::new(opts) /// .build() /// .expect("Failed to build ZkSolcManager"); @@ -311,6 +321,7 @@ impl ZkSolcManagerBuilder { let compilers_path = home_path.to_owned(); let solc_version = parse_version(&version)?; + Ok(ZkSolcManager::new(compilers_path, solc_version, compiler, download_url)) } } @@ -458,14 +469,20 @@ impl ZkSolcManager { /// /// This function can return an `Err` if the full download URL cannot be parsed into a valid /// `Url`. + pub fn get_full_download_url(&self) -> Result { let zk_solc_os = get_operating_system() .map_err(|err| anyhow!("Failed to determine OS to select the binary: {}", err))?; let download_uri = zk_solc_os.get_download_uri(); - let full_download_url = - format!("{}/{}/{}", self.download_url, download_uri, self.get_full_compiler()); + // Using the GitHub releases URL pattern + let full_download_url = format!( + "https://github.com/matter-labs/zksolc-bin/releases/download/{}/zksolc-{}-{}", + self.version.get_version(), + download_uri, + self.version.get_version() + ); Url::parse(&full_download_url) .map_err(|err| anyhow!("Could not parse URL for binary download: {}", err))