matter-labs / foundry-zksync

Fork of Foundry tailored for zkSync environment
Apache License 2.0
299 stars 130 forks source link

Got an error Unknown version provided if solc = "0.8.25" is defined in foundry.toml. #451

Closed wshino closed 4 months ago

wshino commented 4 months ago

Component

Forge

Have you ensured that all of these are up to date?

What version of Foundry are you on?

forge 0.0.2 (6e1c282 2024-07-01T00:26:02.947919000Z)

What command(s) is the bug in?

forge build --zksync

Operating System

macOS (Apple Silicon)

Describe the bug

Hi I have one question regarding solidity version. I saw that the current foundy-zksync now supports solc 0.8.25 via issues in the repo. I re-installed new foundry-zksync in my local, and then set the solc = "0.8.25" in foundry.toml, then ran forge build --zksync. I got an error Unknown version provided

Maybe I couldn't download zksolc 1.5.0. My ~/.zksync directory files are following:(macOS Apple Silicon)

solc-macosx-arm64-0.8.23-1.0.1
zksolc-macosx-arm64-v1.3.21
zksolc-macosx-arm64-v1.3.22
zksolc-macosx-arm64-v1.4.1

Also the foundry-zksync repo in my local has 0.8.25 I guess

% cat crates/forge/tests/cli/svm.rs | grep LATE
ST_SOLC
/// 5. upgrade the `LATEST_SOLC`
const LATEST_SOLC: Version = Version::new(0, 8, 25);
        releases.releases.contains_key(&LATEST_SOLC),
        "platform {platform:?} is missing solc info for v{LATEST_SOLC}"
pragma solidity ={LATEST_SOLC};

How can I resolve this issue? Thank you.

Karrq commented 4 months ago

Hello, thanks for the report!

We have added support for 0.8.25, but only as far as usage is concerned. Automatic installation is still not supported, but we are updating foundry and that will resolve the issue.

In the meantime, you should still able to download 0.8.25 manually (make sure to install it in the same directory as svm would normally), or thru svm-rs, and use it to compile for EVM.

We do support download of zksync-solc automatically, so you wouldn't need to do anything to get that to work.

With regards to zksolc, we do support any version, but the automatically downloaded one would be v1.4.1. You can specify a different version using the zksync.zksolc configuration option (please consult the docs for more information).

wshino commented 4 months ago

@Karrq Finally I could compile our contracts using solc = 0.8.25. Thank you so much.