mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-14 15:41:04 +00:00
bd4e108bb0
- Factor the YUL crate out of `revive-solidity`. - `revive-solidity` is in reality not a Solidity implementation but the revive solidity compiler driver (`resolc`). By renaming we not only get this straight but also a binary with the same name as the crate which should be less confusing. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
51 lines
1.6 KiB
Rust
51 lines
1.6 KiB
Rust
//! The Solidity compiler.
|
|
|
|
#[cfg(not(target_os = "emscripten"))]
|
|
pub mod solc_compiler;
|
|
#[cfg(target_os = "emscripten")]
|
|
pub mod soljson_compiler;
|
|
pub mod version;
|
|
|
|
use std::path::Path;
|
|
use std::path::PathBuf;
|
|
|
|
use revive_solc_json_interface::combined_json::CombinedJson;
|
|
use revive_solc_json_interface::SolcStandardJsonInput;
|
|
use revive_solc_json_interface::SolcStandardJsonOutput;
|
|
|
|
use self::version::Version;
|
|
|
|
/// The first version of `solc` with the support of standard JSON interface.
|
|
pub const FIRST_SUPPORTED_VERSION: semver::Version = semver::Version::new(0, 8, 0);
|
|
|
|
/// The last supported version of `solc`.
|
|
pub const LAST_SUPPORTED_VERSION: semver::Version = semver::Version::new(0, 8, 30);
|
|
|
|
/// `--include-path` was introduced in solc `0.8.8` <https://github.com/ethereum/solidity/releases/tag/v0.8.8>
|
|
pub const FIRST_INCLUDE_PATH_VERSION: semver::Version = semver::Version::new(0, 8, 8);
|
|
|
|
/// The Solidity compiler.
|
|
pub trait Compiler {
|
|
/// Compiles the Solidity `--standard-json` input into Yul IR.
|
|
fn standard_json(
|
|
&mut self,
|
|
input: SolcStandardJsonInput,
|
|
base_path: Option<String>,
|
|
include_paths: Vec<String>,
|
|
allow_paths: Option<String>,
|
|
) -> anyhow::Result<SolcStandardJsonOutput>;
|
|
|
|
/// The `solc --combined-json abi,hashes...` mirror.
|
|
fn combined_json(
|
|
&self,
|
|
paths: &[PathBuf],
|
|
combined_json_argument: &str,
|
|
) -> anyhow::Result<CombinedJson>;
|
|
|
|
/// The `solc` Yul validator.
|
|
fn validate_yul(&self, path: &Path) -> anyhow::Result<()>;
|
|
|
|
/// The `solc --version` mini-parser.
|
|
fn version(&mut self) -> anyhow::Result<Version>;
|
|
}
|