Expand description
§foundry-compilers
Compiler abstraction and Foundry project implementation.
Originally part of ethers-rs as ethers-solc, this is the compilation backend for Foundry.
§Features
full: Enablesasync+svm-solc.async: Adds async methods usingtokio.svm-solc: Enables svm to auto-detect and managesolcbuilds.project-util: Utilities for creating and testing project workspaces.rustls: Usesrustlsfor TLS (enabled by default).
Re-exports§
pub use resolver::Graph;pub use foundry_compilers_artifacts as artifacts;pub use compilers::*;
Modules§
- buildinfo
- Represents an entire build
- cache
- Support for compiling contracts.
- compilers
- contracts
- error
- flatten
- info
- Commonly used identifiers for contracts in the compiled output.
- many
- output
- The output of a compiled project
- project
- Manages compiling of a
Project - report
- Subscribe to events in the compiler pipeline
- resolver
- Resolution of the entire dependency graph for a project.
- sources
- utils
- Utility functions
Structs§
- Aggregated
Compiler Output - The aggregated output of (multiple) compile jobs
- Artifact
File - Represents an artifact file representing a
crate::compilers::CompilerContract - Artifact
Id - Represents unique artifact metadata for identifying artifacts on output
- Artifacts
- Represents a set of Artifacts
- Configurable
Artifacts - An
Artifactimplementation that can be configured to include additional content and emit additional files - Extra
Output Files - Determines what to emit as an additional file
- Extra
Output Values - Determines the additional values to include in the contract’s artifact file
- Hardhat
Artifacts - Hardhat style artifacts handler
- Minimal
Combined Artifacts - An
Artifactimplementation that uses a compact representation - Minimal
Combined Artifacts Hardhat Fallback - An Artifacts handler implementation that works the same as
MinimalCombinedArtifactsbut also supports reading hardhat artifacts if an initial attempt to deserialize an artifact failed - Output
Context - Additional context to use during
ArtifactOutput::on_output() - Project
- Represents a project workspace and handles
solccompiling of all contracts in that workspace. - Project
Builder - Project
Compile Output - Contains a mixture of already compiled/cached artifacts and the input set of sources that still need to be compiled.
- Project
Paths - This is a subset of ProjectPathsConfig that contains all relevant folders in the project
- Project
Paths Config - Where to find all files or where to write them
- Solc
Config - The config to use when compiling the contracts
- Test
File Filter - An FileFilter that matches all solidity files that end with
.t.sol
Enums§
- Path
Style - Sparse
Output Filter - A type that can apply a filter to a set of preprocessed Sources in order to set sparse output for specific files
Traits§
- Artifact
- A trait representation for a
crate::compilers::CompilerContractartifact - Artifact
Output - Handler invoked with the output of
solc - File
Filter - A predicate property that determines whether a file satisfies a certain condition
Functions§
- apply_
updates - Utility function to apply a set of updates to provided sources.
- replace_
source_ content - Utility function to change source content ranges with provided updates. Assumes that the updates are sorted.
Type Aliases§
- Updates
- Updates to be applied to the sources.