pub async fn resolve_solc_binary(
config: &FoundryConfig,
file_source: Option<&str>,
client: Option<&Client>,
) -> PathBufExpand description
Resolve the path to the solc binary.
Resolution order:
- Parse
pragma solidityfrom the source file.- Exact pragma (
=0.7.6): always use the file’s version — foundry.toml cannot override an exact pragma without breaking compilation. - Wildcard pragma (
^0.8.0,>=0.8.0,>=0.6.2 <0.9.0): iffoundry.tomlspecifies a solc version that satisfies the constraint, use it. Otherwise pick the latest matching installed version.
- Exact pragma (
- If no pragma, use the
foundry.tomlsolc version if set. - If no match is installed, auto-install via
svm install. - Fall back to whatever
solcis on$PATH.