diff --git a/README.md b/README.md index 9bc56ac88..9ede79209 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,9 @@ $ git clone https://github.com/sammyshakes/sample-fzksync-project.git # cd into foundry-zksync and build $ cd foundry-zksync $ cargo build -p foundry-cli +# cd into fzksync-project and update the submodules +$ cd ../sample-fzksync-project +$ git submodule update --init --recursive ``` --- @@ -654,3 +657,11 @@ There are 2 workarounds: - download the compiler manually - and then use `--offline` mode (you can download the compiler into ~/.svm/VERSION/solc-VERSION -- for example ~/.svm/0.8.20/solc-0.8.20 ) You can get the lastest compiler version for MacOs AARCH here: https://github.com/ethers-rs/solc-builds/tree/master/macosx/aarch64 + +### `solc` versions >0.8.19 are not supported, found 0.8.20 + +This means that our zksync compiler doesn't support that version of solidity yet. + +In such case, please remove the artifacts (by removing `zkout` directory) and re-run with the older version of solidity (`--use 0.8.19`) for example. + +You might also have to remove `~/.svm/0.8.20/solc-0.8.20` file too. \ No newline at end of file diff --git a/cli/src/cmd/forge/zksolc.rs b/cli/src/cmd/forge/zksolc.rs index 1e0ba5554..0e9cc38b0 100644 --- a/cli/src/cmd/forge/zksolc.rs +++ b/cli/src/cmd/forge/zksolc.rs @@ -247,6 +247,16 @@ impl ZkSolc { .wait_with_output() .map_err(|e| Error::msg(format!("Could not run compiler cmd: {}", e)))?; + if !output.status.success() { + return Err(Error::msg(format!( + "Compilation failed with {:?}. Using compiler: {:?}, with args {:?} {:?}", + String::from_utf8(output.stderr).unwrap_or_default(), + self.compiler_path, + contract_path, + &comp_args + ))); + } + let filename = contract_path .to_str() .expect("Unable to convert source to string") diff --git a/cli/src/cmd/forge/zksolc_manager.rs b/cli/src/cmd/forge/zksolc_manager.rs index b8070f5bb..a0162d5d8 100644 --- a/cli/src/cmd/forge/zksolc_manager.rs +++ b/cli/src/cmd/forge/zksolc_manager.rs @@ -48,6 +48,7 @@ pub enum ZkSolcVersion { V137, V138, V139, + V1310, } /// `parse_version` parses a string representation of a `zksolc` compiler version @@ -68,6 +69,7 @@ fn parse_version(version: &str) -> Result { "v1.3.7" => Ok(ZkSolcVersion::V137), "v1.3.8" => Ok(ZkSolcVersion::V138), "v1.3.9" => Ok(ZkSolcVersion::V139), + "v1.3.10" => Ok(ZkSolcVersion::V1310), _ => Err(Error::msg( "ZkSolc compiler version not supported. Proper version format: 'v1.3.x'", )), @@ -87,6 +89,7 @@ impl ZkSolcVersion { ZkSolcVersion::V137 => "v1.3.7", ZkSolcVersion::V138 => "v1.3.8", ZkSolcVersion::V139 => "v1.3.9", + ZkSolcVersion::V1310 => "v1.3.10", } } }