Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Supported `polkadot-sdk` rev:`c29e72a8628835e34deb6aa7db9a78a2e4eabcee`

### Added
- Support for solc v0.8.29
- `--supported-solc-versions` for `resolc` binary to return a `semver` range of supported `solc` versions.

### Changed
- Runner `resolc` using webkit is no longer supported.
Expand Down
3 changes: 3 additions & 0 deletions crates/solidity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ pub use self::solc::standard_json::output::contract::Contract as SolcStandardJso
pub use self::solc::standard_json::output::Output as SolcStandardJsonOutput;
pub use self::solc::version::Version as SolcVersion;
pub use self::solc::Compiler;
pub use self::solc::FIRST_SUPPORTED_VERSION as SolcFirstSupportedVersion;
pub use self::solc::LAST_SUPPORTED_VERSION as SolcLastSupportedVersion;
pub use self::version::Version as ResolcVersion;
pub use self::warning::Warning;

#[cfg(not(target_os = "emscripten"))]
pub mod test_utils;
pub mod tests;
Expand Down
10 changes: 10 additions & 0 deletions crates/solidity/src/resolc/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ pub struct Arguments {
#[arg(long = "version")]
pub version: bool,

/// Print supported `solc` versions and exit.
#[arg(long = "supported-solc-versions")]
pub supported_solc_versions: bool,

/// Print the licence and exit.
#[arg(long = "license")]
pub license: bool,
Expand Down Expand Up @@ -171,6 +175,12 @@ impl Arguments {
anyhow::bail!("No other options are allowed while getting the compiler version.");
}

if self.supported_solc_versions && std::env::args().count() > 2 {
anyhow::bail!(
"No other options are allowed while getting the supported `solc` versions."
);
}

#[cfg(debug_assertions)]
if self.recursive_process_input.is_some() && !self.recursive_process {
anyhow::bail!("--process-input can be only used when --recursive-process is given");
Expand Down
10 changes: 10 additions & 0 deletions crates/solidity/src/resolc/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ fn main_inner() -> anyhow::Result<()> {
return Ok(());
}

if arguments.supported_solc_versions {
writeln!(
std::io::stdout(),
">={},<={}",
revive_solidity::SolcFirstSupportedVersion,
revive_solidity::SolcLastSupportedVersion,
)?;
return Ok(());
}

if arguments.license {
let license_mit = include_str!("../../../../LICENSE-MIT");
let license_apache = include_str!("../../../../LICENSE-APACHE");
Expand Down