60 releases (11 breaking)

new 0.12.3 Nov 20, 2024
0.11.6 Oct 16, 2024
0.10.1 Jul 26, 2024
0.3.13 Mar 18, 2024
0.1.1 Nov 23, 2023

#202 in Magic Beans

Download history 4288/week @ 2024-07-31 4591/week @ 2024-08-07 3333/week @ 2024-08-14 3759/week @ 2024-08-21 4664/week @ 2024-08-28 5690/week @ 2024-09-04 3735/week @ 2024-09-11 3471/week @ 2024-09-18 3720/week @ 2024-09-25 3675/week @ 2024-10-02 3453/week @ 2024-10-09 4284/week @ 2024-10-16 2840/week @ 2024-10-23 2100/week @ 2024-10-30 2994/week @ 2024-11-06 3946/week @ 2024-11-13

12,509 downloads per month
Used in 7 crates (3 directly)

MIT/Apache

605KB
12K SLoC

Foundry Compilers

| Docs |

Originally part of ethers-rs as ethers-solc, Foundry Compilers is the compilation backend for Foundry.

ethers-rs's ethers-solc is considered to be in maintenance mode, and any fixes to it will also be reflected on Foundry Compilers. No action is currently needed from devs, although we heavily recommend using Foundry Compilers instead of ethers-solc.

Build Status Telegram chat

Supported Rust Versions

Foundry Compilers will keep a rolling MSRV (minimum supported rust version) policy of at least 6 months. When increasing the MSRV, the new Rust version must have been released at least six months ago. The current MSRV is 1.70.0.

Note that the MSRV is not increased automatically, and only as part of a minor release.

Contributing

Thanks for your help in improving the project! We are so happy to have you! We have a contributing guide to help you get involved in the Foundry Compilers project.

Pull requests will not be merged unless CI passes, so please ensure that your contribution follows the linting rules and passes clippy.

Overview

To install, simply add foundry-compilers to your cargo dependencies.

[dependencies]
foundry-compilers = "0.10.1"

Example usage:

use foundry_compilers::{Project, ProjectPathsConfig};
use std::path::Path;

// configure the project with all its paths, solc, cache etc.
let project = Project::builder()
    .paths(ProjectPathsConfig::hardhat(Path::new(env!("CARGO_MANIFEST_DIR"))).unwrap())
    .build(Default::default())
    .unwrap();
let output = project.compile().unwrap();

// Tell Cargo that if a source file changes, to rerun this build script.
project.rerun_if_sources_changed();

Dependencies

~17–32MB
~515K SLoC