Solidity Compiler
Guide to managing Solidity compiler versions with svm-rs.
Solidity Compiler Management
Alloy's svm-rs is the easiest way to manage Solidity compiler versions on your machine. This is the version manager that Foundry uses, so if you already have Foundry installed, you can skip the installation steps.
Installation
Install Rust (if not already installed):
curl https://sh.rustup.rs -sSf | shInstall the svm-rs crate:
cargo install svm-rsUsage
List installed and available versions:
svm listInstall a version:
svm install <VERSION>Set global version from installed versions:
svm use <VERSION>Remove an installed version:
svm remove <VERSION>Compiler Version
Knowing the exact compiler version is important for verifying deployed contracts on block explorers, like Etherscan.
To list the exact solc commit, run the following in your terminal (replace x and y with your version numbers):
~/.svm/0.x.y/solc-0.x.y --versionAlternatively, you can view the exact solc commit used by your Foundry project by going to out/YourContract.sol/YourContract.json and looking at metadata.compiler.version, as shown below:

Last updated
Was this helpful?