#solidity #solc #foundry #ethereum #ethers

foundry-compilers

Utilities for working with solidity compilers, namely solc

31 releases

new 0.3.19 Apr 22, 2024
0.3.13 Mar 18, 2024
0.1.2 Dec 29, 2023
0.1.1 Nov 23, 2023

#1176 in Magic Beans

Download history 648/week @ 2023-12-25 779/week @ 2024-01-01 1292/week @ 2024-01-08 1939/week @ 2024-01-15 1510/week @ 2024-01-22 2056/week @ 2024-01-29 2735/week @ 2024-02-05 2679/week @ 2024-02-12 2171/week @ 2024-02-19 2583/week @ 2024-02-26 3113/week @ 2024-03-04 4700/week @ 2024-03-11 3420/week @ 2024-03-18 2090/week @ 2024-03-25 3246/week @ 2024-04-01 1852/week @ 2024-04-08

10,916 downloads per month
Used in foundry-block-explorers

MIT/Apache

1MB
17K SLoC

Foundry Compilers

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 reflect 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.65.0.

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

Contributing

Thanks for your help 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 = { git = "https://github.com/foundry-rs/compilers" }

Example usage:

use foundry_compilers::{Project, ProjectPathsConfig};

// configure the project with all its paths, solc, cache etc.
let project = Project::builder()
    .paths(ProjectPathsConfig::hardhat(env!("CARGO_MANIFEST_DIR")).unwrap())
    .build()
    .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

~10–27MB
~408K SLoC