Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 32 additions & 25 deletions crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,50 +192,53 @@ pub struct Config {
#[serde(default, skip_serializing)]
pub extends: Option<Extends>,

/// path of the source contracts dir, like `src` or `contracts`
/// Path of the sources directory.
///
/// Defaults to `src`.
pub src: PathBuf,
/// path of the test dir
/// Path of the tests directory.
pub test: PathBuf,
/// path of the script dir
/// Path of the scripts directory.
pub script: PathBuf,
/// path to where artifacts shut be written to
/// Path to the artifacts directory.
pub out: PathBuf,
/// all library folders to include, `lib`, `node_modules`
/// Paths to all library folders, such as `lib`, or `node_modules`.
pub libs: Vec<PathBuf>,
/// `Remappings` to use for this repo
/// Remappings to use for this repo
pub remappings: Vec<RelativeRemapping>,
/// Whether to autodetect remappings by scanning the `libs` folders recursively
/// Whether to autodetect remappings.
pub auto_detect_remappings: bool,
/// library addresses to link
/// Library addresses to link.
pub libraries: Vec<String>,
/// whether to enable cache
/// Whether to enable the build cache.
pub cache: bool,
/// whether to dynamically link tests
pub dynamic_test_linking: bool,
/// where the cache is stored if enabled
/// The path to the cache store.
pub cache_path: PathBuf,
/// where the gas snapshots are stored
/// Whether to dynamically link tests.
pub dynamic_test_linking: bool,
/// Where the gas snapshots are stored.
pub snapshots: PathBuf,
/// whether to check for differences against previously stored gas snapshots
/// Whether to check for differences against previously stored gas snapshots.
pub gas_snapshot_check: bool,
/// whether to emit gas snapshots to disk
/// Whether to emit gas snapshots to disk.
pub gas_snapshot_emit: bool,
/// where the broadcast logs are stored
/// The path to store broadcast logs at.
pub broadcast: PathBuf,
/// additional solc allow paths for `--allow-paths`
/// Additional paths passed to `solc --allow-paths`.
pub allow_paths: Vec<PathBuf>,
/// additional solc include paths for `--include-path`
/// Additional paths passed to `solc --include-path`.
pub include_paths: Vec<PathBuf>,
/// glob patterns to skip
/// Glob patterns for file paths to skip when building and executing contracts.
pub skip: Vec<GlobMatcher>,
/// whether to force a `project.clean()`
/// Whether to forcefully clean all project artifacts before running commands.
// todo(onbjerg): is this useful anymore?
pub force: bool,
/// evm version to use
/// The EVM version to use when building contracts.
#[serde(with = "from_str_lowercase")]
pub evm_version: EvmVersion,
/// list of contracts to report gas of
/// List of contracts to generate gas reports for.
pub gas_reports: Vec<String>,
/// list of contracts to ignore for gas reports
/// List of contracts to ignore for gas reports.
pub gas_reports_ignore: Vec<String>,
/// Whether to include gas reports for tests.
pub gas_reports_include_tests: bool,
Expand Down Expand Up @@ -302,9 +305,10 @@ pub struct Config {
/// Multiple etherscan api configs and their aliases
#[serde(default, skip_serializing_if = "EtherscanConfigs::is_empty")]
pub etherscan: EtherscanConfigs,
/// list of solidity error codes to always silence in the compiler output
/// List of solidity error codes to always silence in the compiler output.
pub ignored_error_codes: Vec<SolidityErrorCode>,
/// list of file paths to ignore
/// List of file paths to ignore.
// todo(onbjerg): how is this different from `skip`?
#[serde(rename = "ignored_warnings_from")]
pub ignored_file_paths: Vec<PathBuf>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// Diagnostic level (minimum) at which the process should finish with a non-zero exit.
Expand Down Expand Up @@ -397,6 +401,7 @@ pub struct Config {
/// If this limit is exceeded, a `MemoryLimitOOG` result is thrown.
///
/// The default is 128MiB.
// todo(onbjerg): this seems unused.
pub memory_limit: u64,
Comment on lines +404 to 405
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revm does allow configuring this and we are passing the value into it; must not be wired correctly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is, it goes through the serialize config->deserialize into evmopts dance

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually it's broken but for a different reason, we set it correctly in cfg env #12299

/// Additional output selection for all contracts, such as "ir", "devdoc", "storageLayout",
/// etc.
Expand Down Expand Up @@ -429,8 +434,10 @@ pub struct Config {
#[serde(default)]
pub extra_output_files: Vec<ContractOutputSelection>,
/// Whether to print the names of the compiled contracts.
// todo(onbjerg): this seems unused.
pub names: bool,
/// Whether to print the sizes of the compiled contracts.
// todo(onbjerg): this seems unused.
pub sizes: bool,
Comment on lines 436 to 441
Copy link
Member

@zerosnacks zerosnacks Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should not be unused; should correspond with the forge build --sizes / forge build --names / forge build --names --sizes flags

I am not sure if this ever worked

https://github.com/morpho-org/morpho-optimizers/blob/04143d929372e53d3f6822f62ee90df1609fc784/foundry.toml#L9-L10

/// If set to true, changes compilation pipeline to go through the Yul intermediate
/// representation.
Expand Down
Loading