Utilities for working with native solc and compiling projects.

Overview

foundry-compilers

Utilities for working with native solc and compiling projects.

To also compile contracts during cargo build (so that ethers abigen! can pull in updated abi automatically) you can configure a foundry_compilers::Project in your build.rs file

First add foundry-compilers to your cargo build-dependencies.

Once you compiled the project, you can configure cargo change detection with rerun_if_sources_changed, so that cargo will execute the build.rs file if a contract in the sources directory has changed

[build-dependencies]
foundry-compilers = { git = "https://github.com/foundry-rs/compilers" }
use foundry_compilers::{Project, ProjectPathsConfig};

fn main() {
    // 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();
}
You might also like...
Crib - Extensible, Minimal Template for Sway Projects

crib • Extensible, Minimal Template for Sway Projects. Developing First Time? New to rust? Install with: curl --proto '=https' --tlsv1.2 -sSf https://

Extensible, Minimal Template for Sway Projects

crib • Extensible, Minimal Template for Sway Projects. Developing First Time? New to rust? Install with: curl --proto '=https' --tlsv1.2 -sSf https://

Template for multi-contract CosmWasm projects

CosmWasm Template Template for multi-contract CosmWasm projects How to Use Install cargo-make: cargo install --force cargo-make Run formatter: cargo m

A template for developing Rust projects, with sensible defaults

Rust Template A template for developing Rust projects, with sensible defaults. Getting Started Click the Use this template button at the top of the pa

Designed for rapid iteration in IC Canister development projects.

IC_Utils Designed for rapid iteration in IC Canister development projects. IcContext IcContext provides the context for ic canister object invocation,

Rust-native building blocks for the Cardano blockchain ecosystem

Pallas Rust-native building blocks for the Cardano blockchain ecosystem. Introduction Pallas is an expanding collection of modules that re-implements

USN - the first NEAR-native stablecoin

USN USN is a NEAR-native USD stable coin. The contract implements fungible token API according to the following standards: NEP-141 (ERC-20 fashioned)

IBC modules and relayer - Formal specifications and Rust implementation

ibc-rs Rust implementation of the Inter-Blockchain Communication (IBC) protocol. This project comprises primarily four crates: The ibc crate defines t

Diem’s mission is to build a trusted and innovative financial network that empowers people and businesses around the world.
Diem’s mission is to build a trusted and innovative financial network that empowers people and businesses around the world.

Note to readers: On December 1, 2020, the Libra Association was renamed to Diem Association. The project repos are in the process of being migrated. A

Owner
Foundry
Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
Foundry
rust-native-tls — Bindings for native TLS libraries

rust-native-tls Documentation An abstraction over platform-specific TLS implementations. Specifically, this crate uses SChannel on Windows (via the sc

Steven Fackler 371 Jan 8, 2023
Complete Ethereum and Celo wallet implementation and utilities in Rust

ethers.rs Complete Ethereum and Celo wallet implementation and utilities in Rust Documentation Extensive documentation and examples are available here

Georgios Konstantopoulos 1.5k Jan 8, 2023
Pure-Rust traits and utilities for constant-time cryptographic implementations.

subtle Pure-Rust traits and utilities for constant-time cryptographic implementations. It consists of a Choice type, and a collection of traits using

dalek cryptography 196 Dec 13, 2022
Substreams development kit for Ethereum chains, contains Firehose Block model and helpers as well as utilities for Ethereum ABI encoding/decoding.

Substreams Ethereum Substreams development kit for Ethereum chains, contains Rust Firehose Block model and helpers as well as utilities for Ethereum A

StreamingFast 15 Oct 25, 2022
HD wallet BIP-32 related key derivation utilities.

HDWallet Docs HD wallet(BIP-32) key derivation utilities. This crate is build upon secp256k1 crate, this crate only provides BIP-32 related features,

jjy 23 Nov 27, 2022
Rust project for working with ETH - Ethereum transactions with Rust on Ganache and also deploy smart contracts :)

Just a test project to work with Ethereum but using Rust. I'm using plain Rust here, not Foundry. In future we will use Foundry. Hope you're already f

Akhil Sharma 2 Dec 20, 2022
A Rust library for working with Bitcoin SV

Rust-SV A library to build Bitcoin SV applications in Rust. Documentation Features P2P protocol messages (construction and serialization) Address enco

Brenton Gunning 51 Oct 13, 2022
A crate for working with Ethereum beacon chain light client protocol messages. `no_std` friendly!

eth-lightclient-rs A crate for working with Ethereum beacon chain light client protocol messages. no_std friendly! !! For hacking and experimentation

Willem Olding 12 Jan 6, 2023
egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native

?? egui: an easy-to-use GUI in pure Rust ?? Click to run the web demo ?? egui is a simple, fast, and highly portable immediate mode GUI library for Ru

Cronus Diamond 7 Aug 13, 2022
A template for AVR executable (non-library) projects

Rust AVR executable template A template for Rust based AVR executables. NOTE: This software template repository is offered in the public domain. It is

The AVR-Rust project 16 Sep 18, 2022