repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/fmt/src/state/yul.rs
crates/fmt/src/state/yul.rs
#![allow(clippy::too_many_arguments)] use super::{ CommentConfig, State, common::{BlockFormat, ListFormat}, }; use solar::parse::ast::{self, Span, yul}; #[rustfmt::skip] macro_rules! get_span { () => { |value| value.span }; (()) => { |value| value.span() }; } /// Language-specific pretty printing: Yu...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/fmt/tests/formatter.rs
crates/fmt/tests/formatter.rs
use forge_fmt::FormatterConfig; use foundry_test_utils::init_tracing; use snapbox::{Data, assert_data_eq}; use solar::sema::Compiler; use std::{ fs, path::{Path, PathBuf}, sync::Arc, }; #[track_caller] fn format(source: &str, path: &Path, fmt_config: Arc<FormatterConfig>) -> String { let mut compiler =...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/vyper.rs
crates/config/src/vyper.rs
//! Vyper specific configuration types. use foundry_compilers::artifacts::vyper::VyperOptimizationMode; use serde::{Deserialize, Serialize}; use std::path::PathBuf; #[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct VyperConfig { /// Vyper optimization mode. "gas", "none" or "codes...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/lib.rs
crates/config/src/lib.rs
//! # foundry-config //! //! Foundry configuration. #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] #[macro_use] extern crate tracing; use crate::cache::StorageCachingConfig; use alloy_primitives::{Address, B256, FixedBytes, U256, address, map::AddressHashMap}; use eyr...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/endpoints.rs
crates/config/src/endpoints.rs
//! Support for multiple RPC-endpoints use crate::resolve::{RE_PLACEHOLDER, UnresolvedEnvVarError, interpolate}; use serde::{Deserialize, Deserializer, Serialize, Serializer, ser::SerializeMap}; use std::{ collections::BTreeMap, fmt, ops::{Deref, DerefMut}, }; /// Container type for API endpoints, like va...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/soldeer.rs
crates/config/src/soldeer.rs
//! Configuration specific to the `forge soldeer` command and the `forge_soldeer` package use serde::{Deserialize, Serialize}; pub use soldeer_core::config::SoldeerConfig; use std::collections::BTreeMap; /// Soldeer dependencies config structure when it's defined as a map #[derive(Clone, Debug, PartialEq, Eq, Serializ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/fix.rs
crates/config/src/fix.rs
//! Helpers to automatically fix configuration warnings. use crate::{Config, Warning}; use figment::providers::Env; use std::{ fs, io, ops::{Deref, DerefMut}, path::{Path, PathBuf}, }; /// A convenience wrapper around a TOML document and the path it was read from struct TomlFile { doc: toml_edit::Docu...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/filter.rs
crates/config/src/filter.rs
//! Helpers for constructing and using [FileFilter]s. use core::fmt; use foundry_compilers::FileFilter; use serde::{Deserialize, Serialize}; use std::{ convert::Infallible, path::{Path, PathBuf}, str::FromStr, }; /// Expand globs with a root path. pub fn expand_globs( root: &Path, patterns: impl I...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/doc.rs
crates/config/src/doc.rs
//! Configuration specific to the `forge doc` command and the `forge_doc` package use serde::{Deserialize, Serialize}; use std::path::PathBuf; /// Contains the config for parsing and rendering docs #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct DocConfig { /// Doc output path. pub o...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/fuzz.rs
crates/config/src/fuzz.rs
//! Configuration for fuzz testing. use alloy_primitives::U256; use foundry_compilers::utils::canonicalized; use serde::{Deserialize, Serialize}; use std::path::PathBuf; /// Contains for fuzz testing #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct FuzzConfig { /// The number of test case...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/warning.rs
crates/config/src/warning.rs
use figment::Profile; use serde::{Deserialize, Serialize}; use std::{fmt, path::PathBuf}; /// Warnings emitted during loading or managing Configuration #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "type")] pub enum Warning { /// An unknown section was encountered in a TOML file ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/lint.rs
crates/config/src/lint.rs
//! Configuration specific to the `forge lint` command and the `forge_lint` package use clap::ValueEnum; use core::fmt; use serde::{Deserialize, Deserializer, Serialize}; use solar::interface::diagnostics::Level; use std::str::FromStr; use yansi::Paint; /// Contains the config and rule set. #[derive(Clone, Debug, Par...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/etherscan.rs
crates/config/src/etherscan.rs
//! Support for multiple Etherscan keys. use crate::{ Chain, Config, NamedChain, resolve::{RE_PLACEHOLDER, UnresolvedEnvVarError, interpolate}, }; use figment::{ Error, Metadata, Profile, Provider, providers::Env, value::{Dict, Map}, }; use heck::ToKebabCase; use serde::{Deserialize, Deserializer, ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/error.rs
crates/config/src/error.rs
//! error handling and solc error codes use alloy_primitives::map::HashSet; use figment::providers::{Format, Toml}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::{error::Error, fmt, str::FromStr}; /// Represents a failed attempt to extract `Config` from a `Figment` #[derive(Clone, PartialEq)]...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/extend.rs
crates/config/src/extend.rs
use std::collections::HashMap; use serde::{Deserialize, Serialize}; /// Strategy for extending configuration from a base file. #[derive(Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] pub enum ExtendStrategy { /// Uses `admerge` figment strategy. /// Arrays...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/utils.rs
crates/config/src/utils.rs
//! Utility functions use crate::Config; use alloy_primitives::U256; use figment::value::Value; use foundry_compilers::artifacts::{ EvmVersion, remappings::{Remapping, RemappingError}, }; use revm::primitives::hardfork::SpecId; use serde::{Deserialize, Deserializer, Serializer, de::Error}; use std::{ io, ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/macros.rs
crates/config/src/macros.rs
/// A macro to implement converters from a type to [`Config`](crate::Config) and /// [`figment::Figment`]. /// /// This can be used to remove some boilerplate code that's necessary to add additional layer(s) to /// the `Config`'s default `Figment`. /// /// `impl_figment` takes the default `Config` and merges additional...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/compilation.rs
crates/config/src/compilation.rs
use crate::{filter::GlobMatcher, serde_helpers}; use foundry_compilers::{ RestrictionsWithVersion, artifacts::{BytecodeHash, EvmVersion}, multi::{MultiCompilerRestrictions, MultiCompilerSettings}, settings::VyperRestrictions, solc::{Restriction, SolcRestrictions}, }; use semver::VersionReq; use serd...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/resolve.rs
crates/config/src/resolve.rs
//! Helper for resolving env vars use regex::Regex; use std::{env, env::VarError, fmt, sync::LazyLock}; /// A regex that matches `${val}` placeholders pub static RE_PLACEHOLDER: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(?m)(?P<outer>\$\{\s*(?P<inner>.*?)\s*})").unwrap()); /// Error when we failed to resol...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/fs_permissions.rs
crates/config/src/fs_permissions.rs
//! Support for controlling fs access use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::{ fmt, path::{Path, PathBuf}, str::FromStr, }; /// Configures file system access /// /// E.g. for cheat codes (`vm.writeFile`) #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/bind_json.rs
crates/config/src/bind_json.rs
use crate::filter::GlobMatcher; use serde::{Deserialize, Serialize}; use std::path::PathBuf; /// Contains the config for `forge bind-json` #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct BindJsonConfig { /// Path for the generated bindings file. pub out: PathBuf, /// Globs to incl...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/cache.rs
crates/config/src/cache.rs
//! Support types for configuring storage caching use crate::Chain; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use std::{fmt, fmt::Formatter, str::FromStr}; use unit_prefix::NumberPrefix; /// Settings to configure caching of remote. #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deseria...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/invariant.rs
crates/config/src/invariant.rs
//! Configuration for invariant testing use crate::fuzz::{FuzzCorpusConfig, FuzzDictionaryConfig}; use serde::{Deserialize, Serialize}; use std::path::PathBuf; /// Contains for invariant testing #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct InvariantConfig { /// The number of runs that...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/fmt.rs
crates/config/src/fmt.rs
//! Configuration specific to the `forge fmt` command and the `forge_fmt` package use serde::{Deserialize, Serialize}; /// Contains the config and rule set #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct FormatterConfig { /// Maximum line length where formatter will try to wrap the line ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/inline/natspec.rs
crates/config/src/inline/natspec.rs
use super::{INLINE_CONFIG_PREFIX, InlineConfigError, InlineConfigErrorKind}; use figment::Profile; use foundry_compilers::{ ProjectCompileOutput, artifacts::{Node, ast::NodeType}, }; use itertools::Itertools; use serde_json::Value; use solar::{ ast::{self, Span}, interface::Session, }; use std::{collect...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/inline/mod.rs
crates/config/src/inline/mod.rs
use crate::Config; use alloy_primitives::map::HashMap; use figment::{ Figment, Profile, Provider, value::{Dict, Map, Value}, }; use foundry_compilers::ProjectCompileOutput; use itertools::Itertools; mod natspec; pub use natspec::*; const INLINE_CONFIG_PREFIX: &str = "forge-config:"; type DataMap = Map<Profil...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/providers/ext.rs
crates/config/src/providers/ext.rs
use crate::{Config, extend, utils}; use figment::{ Error, Figment, Metadata, Profile, Provider, providers::{Env, Format, Toml}, value::{Dict, Map, Value}, }; use foundry_compilers::ProjectPathsConfig; use heck::ToSnakeCase; use std::{ cell::OnceCell, path::{Path, PathBuf}, }; pub(crate) trait Provi...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/providers/mod.rs
crates/config/src/providers/mod.rs
//! Config providers. mod ext; pub use ext::*; mod remappings; pub use remappings::*; mod warnings; pub use warnings::*;
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/providers/remappings.rs
crates/config/src/providers/remappings.rs
use crate::{Config, foundry_toml_dirs, remappings_from_env_var, remappings_from_newline}; use figment::{ Error, Figment, Metadata, Profile, Provider, value::{Dict, Map}, }; use foundry_compilers::artifacts::remappings::{RelativeRemapping, Remapping}; use rayon::prelude::*; use std::{ borrow::Cow, collec...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/config/src/providers/warnings.rs
crates/config/src/providers/warnings.rs
use crate::{Config, DEPRECATIONS, Warning}; use figment::{ Error, Figment, Metadata, Profile, Provider, value::{Dict, Map, Value}, }; use heck::ToSnakeCase; use std::collections::BTreeMap; /// Generate warnings for unknown sections and deprecated keys pub struct WarningsProvider<P> { provider: P, profi...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/clap.rs
crates/cli/src/clap.rs
use clap_complete::{Shell as ClapCompleteShell, aot::Generator}; use clap_complete_nushell::Nushell; #[derive(Clone, Copy)] pub enum Shell { ClapCompleteShell(ClapCompleteShell), Nushell, } impl clap::ValueEnum for Shell { fn value_variants<'a>() -> &'a [Self] { &[ Self::ClapCompleteSh...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/lib.rs
crates/cli/src/lib.rs
//! # foundry-cli //! //! Common CLI utilities. #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] #[macro_use] extern crate foundry_common; #[macro_use] extern crate tracing; pub mod clap; pub mod handler; pub mod opts; pub mod utils; #[cfg(feature = "tracy")] tracing_...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/handler.rs
crates/cli/src/handler.rs
use eyre::EyreHandler; use itertools::Itertools; use std::{error::Error, fmt}; /// A custom context type for Foundry specific error reporting via `eyre`. #[derive(Default)] pub struct Handler { debug_handler: Option<Box<dyn EyreHandler>>, } impl Handler { /// Create a new instance of the `Handler`. pub fn...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/utils/abi.rs
crates/cli/src/utils/abi.rs
use alloy_chains::Chain; use alloy_ens::NameOrAddress; use alloy_json_abi::Function; use alloy_primitives::{Address, hex}; use alloy_provider::{Provider, network::AnyNetwork}; use eyre::{OptionExt, Result}; use foundry_common::abi::{ encode_function_args, encode_function_args_raw, get_func, get_func_etherscan, }; u...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/utils/suggestions.rs
crates/cli/src/utils/suggestions.rs
//! Helper functions for suggesting alternative values for a possibly erroneous user input. /// Filters multiple strings from a given list of possible values which are similar /// to the passed in value `v` within a certain confidence by least confidence. /// /// The jaro winkler similarity boosts candidates that have...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/utils/allocator.rs
crates/cli/src/utils/allocator.rs
//! Abstract global allocator implementation. #[cfg(feature = "mimalloc")] use mimalloc as _; #[cfg(all(feature = "jemalloc", unix))] use tikv_jemallocator as _; // If neither jemalloc nor mimalloc are enabled, use explicitly the system allocator. // By default jemalloc is enabled on Unix systems. cfg_if::cfg_if! { ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/utils/mod.rs
crates/cli/src/utils/mod.rs
use alloy_json_abi::JsonAbi; use alloy_primitives::{Address, U256, map::HashMap}; use alloy_provider::{Provider, network::AnyNetwork}; use eyre::{ContextCompat, Result}; use foundry_common::{ provider::{ProviderBuilder, RetryProvider}, shell, }; use foundry_config::{Chain, Config}; use itertools::Itertools; use...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/utils/cmd.rs
crates/cli/src/utils/cmd.rs
use alloy_json_abi::JsonAbi; use eyre::{Result, WrapErr}; use foundry_common::{TestFunctionExt, fs, fs::json_files, selectors::SelectorKind, shell}; use foundry_compilers::{ Artifact, ArtifactId, ProjectCompileOutput, artifacts::{CompactBytecode, Settings}, cache::{CacheEntry, CompilerCache}, utils::rea...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/evm.rs
crates/cli/src/opts/evm.rs
//! CLI arguments for configuring the EVM settings. use alloy_primitives::{Address, B256, U256}; use clap::Parser; use eyre::ContextCompat; use foundry_config::{ Chain, Config, figment::{ self, Metadata, Profile, Provider, error::Kind::InvalidType, value::{Dict, Map, Value}, }, }; u...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/global.rs
crates/cli/src/opts/global.rs
use clap::{ArgAction, Parser}; use foundry_common::{ shell::{ColorChoice, OutputFormat, OutputMode, Shell, Verbosity}, version::{IS_NIGHTLY_VERSION, NIGHTLY_VERSION_WARNING_MESSAGE}, }; use serde::{Deserialize, Serialize}; /// Global arguments for the CLI. #[derive(Clone, Debug, Default, Serialize, Deserialize...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/dependency.rs
crates/cli/src/opts/dependency.rs
//! CLI dependency parsing use eyre::Result; use regex::Regex; use std::{str::FromStr, sync::LazyLock}; static GH_REPO_REGEX: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"[\w-]+/[\w.-]+").unwrap()); /// Git repo prefix regex pub static GH_REPO_PREFIX_REGEX: LazyLock<Regex> = LazyLock::new(|| { Regex::new(r"((...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/chain.rs
crates/cli/src/opts/chain.rs
use clap::builder::{PossibleValuesParser, TypedValueParser}; use eyre::Result; use foundry_config::{Chain, NamedChain}; use std::ffi::OsStr; use strum::VariantNames; /// Custom Clap value parser for [`Chain`]s. /// /// Displays all possible chains when an invalid chain is provided. #[derive(Clone, Debug)] pub struct C...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/mod.rs
crates/cli/src/opts/mod.rs
mod build; mod chain; mod dependency; mod evm; mod global; mod rpc; mod tempo; mod transaction; pub use build::*; pub use chain::*; pub use dependency::*; pub use evm::*; pub use global::*; pub use rpc::*; pub use tempo::*; pub use transaction::*;
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/rpc.rs
crates/cli/src/opts/rpc.rs
use crate::opts::ChainValueParser; use alloy_chains::ChainKind; use clap::Parser; use eyre::Result; use foundry_config::{ Chain, Config, FigmentProviders, figment::{ self, Figment, Metadata, Profile, value::{Dict, Map}, }, find_project_root, impl_figment_convert_cast, }; use foundry_wall...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/transaction.rs
crates/cli/src/opts/transaction.rs
use std::str::FromStr; use super::TempoOpts; use crate::utils::{parse_ether_value, parse_json}; use alloy_eips::{eip2930::AccessList, eip7702::SignedAuthorization}; use alloy_primitives::{Address, U64, U256, hex}; use alloy_rlp::Decodable; use clap::Parser; /// CLI helper to parse a EIP-7702 authorization list. /// C...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/tempo.rs
crates/cli/src/opts/tempo.rs
use alloy_primitives::{Address, ruint::aliases::U256}; use clap::Parser; /// CLI options for Tempo transactions. #[derive(Clone, Debug, Default, Parser)] #[command(next_help_heading = "Tempo")] pub struct TempoOpts { /// Fee token address for Tempo transactions. /// /// When set, builds a Tempo (type 0x76)...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/build/core.rs
crates/cli/src/opts/build/core.rs
use super::ProjectPathOpts; use crate::{opts::CompilerOpts, utils::LoadConfig}; use clap::{Parser, ValueHint}; use eyre::Result; use foundry_compilers::{ Project, artifacts::{RevertStrings, remappings::Remapping}, compilers::multi::MultiCompiler, utils::canonicalized, }; use foundry_config::{ Config...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/build/paths.rs
crates/cli/src/opts/build/paths.rs
use clap::{Parser, ValueHint}; use eyre::Result; use foundry_compilers::artifacts::remappings::Remapping; use foundry_config::{ Config, figment, figment::{ Metadata, Profile, Provider, error::Kind::InvalidType, value::{Dict, Map, Value}, }, find_project_root, remappings_from_env_...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/build/utils.rs
crates/cli/src/opts/build/utils.rs
use eyre::Result; use foundry_compilers::{ CompilerInput, Graph, Project, ProjectCompileOutput, ProjectPathsConfig, artifacts::{Source, Sources}, multi::{MultiCompilerLanguage, MultiCompilerParser}, solc::{SOLC_EXTENSIONS, SolcLanguage, SolcVersionedInput}, }; use foundry_config::Config; use rayon::prel...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cli/src/opts/build/mod.rs
crates/cli/src/opts/build/mod.rs
use clap::Parser; use foundry_compilers::artifacts::{EvmVersion, output_selection::ContractOutputSelection}; use serde::Serialize; mod core; pub use self::core::BuildOpts; mod paths; pub use self::paths::ProjectPathOpts; mod utils; pub use self::utils::*; // A set of solc compiler settings that can be set via comma...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/builder.rs
crates/doc/src/builder.rs
use crate::{ AsDoc, BufWriter, Document, ParseItem, ParseSource, Parser, Preprocessor, document::DocumentContent, helpers::merge_toml_table, solang_ext::Visitable, }; use alloy_primitives::map::HashMap; use eyre::{Context, Result}; use foundry_compilers::{compilers::solc::SOLC_EXTENSIONS, utils::source_files_it...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/lib.rs
crates/doc/src/lib.rs
//! The module for generating Solidity documentation. //! //! See [`DocBuilder`]. #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] #[macro_use] extern crate foundry_common; #[macro_use] extern crate tracing; mod builder; pub use builder::DocBuilder; mod document; pub ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/document.rs
crates/doc/src/document.rs
use crate::{DocBuilder, ParseItem, PreprocessorId, PreprocessorOutput}; use alloy_primitives::map::HashMap; use std::{ path::{Path, PathBuf}, slice::IterMut, sync::Mutex, }; /// The wrapper around the [ParseItem] containing additional /// information the original item and extra context for outputting it. #...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/helpers.rs
crates/doc/src/helpers.rs
use itertools::Itertools; use solang_parser::pt::FunctionDefinition; use toml::{Value, value::Table}; /// Generates a function signature with parameter types (e.g., "functionName(type1,type2)"). /// Returns the function name without parameters if the function has no parameters. pub fn function_signature(func: &Functio...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/writer/as_doc.rs
crates/doc/src/writer/as_doc.rs
use crate::{ CONTRACT_INHERITANCE_ID, CommentTag, Comments, CommentsRef, DEPLOYMENTS_ID, Document, GIT_SOURCE_ID, INHERITDOC_ID, Markdown, PreprocessorOutput, document::{DocumentContent, read_context}, helpers::function_signature, parser::ParseSource, solang_ext::SafeUnwrap, writer::BufWrite...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/writer/buf_writer.rs
crates/doc/src/writer/buf_writer.rs
use crate::{AsDoc, CommentTag, Comments, Deployment, Markdown, writer::traits::ParamLike}; use itertools::Itertools; use solang_parser::pt::{ EnumDefinition, ErrorParameter, EventParameter, Parameter, VariableDeclaration, }; use std::{ fmt::{self, Display, Write}, sync::LazyLock, }; /// Solidity language n...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/writer/markdown.rs
crates/doc/src/writer/markdown.rs
use crate::{AsDoc, AsDocResult}; /// The markdown format. #[derive(Debug)] pub enum Markdown<'a> { /// H1 heading item. H1(&'a str), /// H2 heading item. H2(&'a str), /// H3 heading item. H3(&'a str), /// Italic item. Italic(&'a str), /// Bold item. Bold(&'a str), /// Link i...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/writer/mod.rs
crates/doc/src/writer/mod.rs
//! The module for writing and formatting various parse tree items. mod as_doc; mod buf_writer; mod markdown; pub use as_doc::{AsDoc, AsDocResult}; pub use buf_writer::BufWriter; pub use markdown::Markdown; mod traits;
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/writer/traits.rs
crates/doc/src/writer/traits.rs
//! Helper traits for writing documentation. use solang_parser::pt::Expression; /// Helper trait to abstract over a solang type that can be documented as parameter pub(crate) trait ParamLike { /// Returns the type of the parameter. fn ty(&self) -> &Expression; /// Returns the type as a string. fn typ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/preprocessor/contract_inheritance.rs
crates/doc/src/preprocessor/contract_inheritance.rs
use super::{Preprocessor, PreprocessorId}; use crate::{ Document, ParseSource, PreprocessorOutput, document::DocumentContent, solang_ext::SafeUnwrap, }; use alloy_primitives::map::HashMap; use std::path::PathBuf; /// [ContractInheritance] preprocessor id. pub const CONTRACT_INHERITANCE_ID: PreprocessorId = Preproc...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/preprocessor/infer_hyperlinks.rs
crates/doc/src/preprocessor/infer_hyperlinks.rs
use super::{Preprocessor, PreprocessorId}; use crate::{Comments, Document, ParseItem, ParseSource, solang_ext::SafeUnwrap}; use regex::{Captures, Match, Regex}; use std::{ borrow::Cow, path::{Path, PathBuf}, sync::LazyLock, }; /// A regex that matches `{identifier-part}` placeholders /// /// Overloaded fun...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/preprocessor/deployments.rs
crates/doc/src/preprocessor/deployments.rs
use super::{Preprocessor, PreprocessorId}; use crate::{Document, PreprocessorOutput}; use alloy_primitives::Address; use std::{ fs, path::{Path, PathBuf}, }; /// [Deployments] preprocessor id. pub const DEPLOYMENTS_ID: PreprocessorId = PreprocessorId("deployments"); /// The deployments preprocessor. /// /// T...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/preprocessor/inheritdoc.rs
crates/doc/src/preprocessor/inheritdoc.rs
use super::{Preprocessor, PreprocessorId}; use crate::{ Comments, Document, ParseItem, ParseSource, PreprocessorOutput, document::DocumentContent, solang_ext::SafeUnwrap, }; use alloy_primitives::map::HashMap; /// [`Inheritdoc`] preprocessor ID. pub const INHERITDOC_ID: PreprocessorId = PreprocessorId("inherit...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/preprocessor/git_source.rs
crates/doc/src/preprocessor/git_source.rs
use super::{Preprocessor, PreprocessorId}; use crate::{Document, PreprocessorOutput}; use std::path::PathBuf; /// [GitSource] preprocessor id. pub const GIT_SOURCE_ID: PreprocessorId = PreprocessorId("git_source"); /// The git source preprocessor. /// /// This preprocessor writes to [Document]'s context. #[derive(Deb...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/preprocessor/mod.rs
crates/doc/src/preprocessor/mod.rs
//! Module containing documentation preprocessors. use crate::{Comments, Document}; use alloy_primitives::map::HashMap; use std::{fmt::Debug, path::PathBuf}; mod contract_inheritance; pub use contract_inheritance::{CONTRACT_INHERITANCE_ID, ContractInheritance}; mod inheritdoc; pub use inheritdoc::{INHERITDOC_ID, Inh...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/solang_ext/loc.rs
crates/doc/src/solang_ext/loc.rs
use solang_parser::pt; use std::{borrow::Cow, rc::Rc, sync::Arc}; /// Returns the code location. /// /// Patched version of [`pt::CodeLocation`]: includes the block of a [`pt::FunctionDefinition`] in /// its `loc`. pub trait CodeLocationExt { /// Returns the code location of `self`. fn loc(&self) -> pt::Loc; }...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/solang_ext/visit.rs
crates/doc/src/solang_ext/visit.rs
//! Visitor helpers to traverse the [solang Solidity Parse Tree](solang_parser::pt). use crate::solang_ext::{CodeLocationExt, pt::*}; /// A trait that is invoked while traversing the Solidity Parse Tree. /// Each method of the [Visitor] trait is a hook that can be potentially overridden. /// /// Currently the main im...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/solang_ext/mod.rs
crates/doc/src/solang_ext/mod.rs
//! Extension traits and modules to the [`solang_parser`] crate. /// Same as [`solang_parser::pt`], but with the patched `CodeLocation`. pub mod pt { #[doc(no_inline)] pub use super::loc::CodeLocationExt as CodeLocation; #[doc(no_inline)] pub use solang_parser::pt::{ Annotation, Base, CatchCla...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/solang_ext/safe_unwrap.rs
crates/doc/src/solang_ext/safe_unwrap.rs
use solang_parser::pt; /// Trait implemented to unwrap optional parse tree items initially introduced in /// [hyperledger/solang#1068]. /// /// Note that the methods of this trait should only be used on parse tree items' fields, like /// [pt::VariableDefinition] or [pt::EventDefinition], where the `name` field is `Non...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/solang_ext/ast_eq.rs
crates/doc/src/solang_ext/ast_eq.rs
use alloy_primitives::{Address, I256, U256}; use solang_parser::pt::*; use std::str::FromStr; /// Helper to convert a string number into a comparable one fn to_num(string: &str) -> I256 { if string.is_empty() { return I256::ZERO; } string.replace('_', "").trim().parse().unwrap() } /// Helper to co...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/parser/error.rs
crates/doc/src/parser/error.rs
use solar::interface::diagnostics::EmittedDiagnostics; use thiserror::Error; /// The parser error. #[derive(Debug, Error)] #[error(transparent)] pub enum ParserError { /// Formatter error. #[error(transparent)] Formatter(EmittedDiagnostics), /// Internal parser error. #[error(transparent)] Inte...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/parser/mod.rs
crates/doc/src/parser/mod.rs
//! The parser module. use crate::solang_ext::{Visitable, Visitor}; use itertools::Itertools; use solang_parser::{ doccomment::{DocComment, parse_doccomments}, pt::{ Comment as SolangComment, EnumDefinition, ErrorDefinition, EventDefinition, FunctionDefinition, Identifier, Loc, SourceUnit, Sour...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/parser/item.rs
crates/doc/src/parser/item.rs
use crate::{Comments, helpers::function_signature, solang_ext::SafeUnwrap}; use solang_parser::pt::{ ContractDefinition, ContractTy, EnumDefinition, ErrorDefinition, EventDefinition, FunctionDefinition, StructDefinition, TypeDefinition, VariableDefinition, }; use std::ops::Range; /// The parsed item. #[derive(...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/doc/src/parser/comment.rs
crates/doc/src/parser/comment.rs
use alloy_primitives::map::HashMap; use derive_more::{Deref, DerefMut, derive::Display}; use solang_parser::doccomment::DocCommentTag; /// The natspec comment tag explaining the purpose of the comment. /// See: <https://docs.soliditylang.org/en/v0.8.17/natspec-format.html#tags>. #[derive(Clone, Debug, Display, Partial...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/config.rs
crates/anvil/src/config.rs
use crate::{ EthereumHardfork, FeeManager, PrecompileFactory, eth::{ backend::{ db::{Db, SerializableState}, env::Env, fork::{ClientFork, ClientForkConfig}, genesis::GenesisConfig, mem::fork_db::ForkedDatabase, time::duration_since_...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/evm.rs
crates/anvil/src/evm.rs
use alloy_evm::precompiles::DynPrecompile; use alloy_primitives::Address; use std::fmt::Debug; /// Object-safe trait that enables injecting extra precompiles when using /// `anvil` as a library. pub trait PrecompileFactory: Send + Sync + Unpin + Debug { /// Returns a set of precompiles to extend the EVM with. ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/lib.rs
crates/anvil/src/lib.rs
//! Anvil is a fast local Ethereum development node. #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] use crate::{ error::{NodeError, NodeResult}, eth::{ EthApi, backend::{info::StorageInfo, mem}, fees::{FeeHistoryService, FeeManager}, ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/shutdown.rs
crates/anvil/src/shutdown.rs
//! Helper for shutdown signals use futures::{ FutureExt, channel::oneshot, future::{FusedFuture, Shared}, }; use std::{ pin::Pin, task::{Context, Poll}, }; /// Future that resolves when the shutdown event has fired #[derive(Clone)] pub struct Shutdown(Shared<oneshot::Receiver<()>>); impl Future ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/filter.rs
crates/anvil/src/filter.rs
//! Support for polling based filters use crate::{ StorageInfo, eth::{backend::notifications::NewBlockNotifications, error::ToRpcResponseResult}, pubsub::filter_logs, }; use alloy_primitives::{TxHash, map::HashMap}; use alloy_rpc_types::{Filter, FilteredParams, Log}; use anvil_core::eth::subscription::Subsc...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/args.rs
crates/anvil/src/args.rs
use crate::opts::{Anvil, AnvilSubcommand}; use clap::{CommandFactory, Parser}; use eyre::Result; use foundry_cli::utils; /// Run the `anvil` command line interface. pub fn run() -> Result<()> { setup()?; let mut args = Anvil::parse(); args.global.init()?; args.node.evm.resolve_rpc_alias(); run_co...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/pubsub.rs
crates/anvil/src/pubsub.rs
use crate::{ StorageInfo, eth::{backend::notifications::NewBlockNotifications, error::to_rpc_result}, }; use alloy_network::AnyRpcTransaction; use alloy_primitives::{B256, TxHash}; use alloy_rpc_types::{FilteredParams, Log, Transaction, pubsub::SubscriptionResult}; use anvil_core::eth::{block::Block, subscripti...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/error.rs
crates/anvil/src/error.rs
/// Result alias pub type NodeResult<T> = Result<T, NodeError>; /// An error that can occur when launching a anvil instance #[derive(Debug, thiserror::Error)] pub enum NodeError { #[error(transparent)] Hyper(#[from] hyper::Error), #[error(transparent)] Io(#[from] std::io::Error), }
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/service.rs
crates/anvil/src/service.rs
//! background service use crate::{ NodeResult, eth::{ fees::FeeHistoryService, miner::Miner, pool::{Pool, transactions::PoolTransaction}, }, filter::Filters, mem::{Backend, storage::MinedBlockOutcome}, }; use futures::{FutureExt, Stream, StreamExt}; use std::{ collectio...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/logging.rs
crates/anvil/src/logging.rs
//! User facing Logger use parking_lot::RwLock; use std::sync::Arc; use tracing::{Metadata, subscriber::Interest}; use tracing_subscriber::{Layer, layer::Context}; /// The target that identifies the events intended to be logged to stdout pub(crate) const NODE_USER_LOG_TARGET: &str = "node::user"; /// The target that...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/opts.rs
crates/anvil/src/opts.rs
use crate::cmd::NodeArgs; use clap::{Parser, Subcommand}; use foundry_cli::opts::GlobalArgs; use foundry_common::version::{LONG_VERSION, SHORT_VERSION}; /// A fast local Ethereum development node. #[derive(Parser)] #[command(name = "anvil", version = SHORT_VERSION, long_version = LONG_VERSION, next_display_order = Non...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/cmd.rs
crates/anvil/src/cmd.rs
use crate::{ AccountGenerator, CHAIN_ID, NodeConfig, config::{DEFAULT_MNEMONIC, ForkChoice}, eth::{EthApi, backend::db::SerializableState, pool::transactions::TransactionOrder}, }; use alloy_genesis::Genesis; use alloy_primitives::{B256, U256, utils::Unit}; use alloy_signer_local::coins_bip39::{English, Mne...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/tasks/mod.rs
crates/anvil/src/tasks/mod.rs
//! Task management support #![allow(rustdoc::private_doc_tests)] use crate::{EthApi, shutdown::Shutdown, tasks::block_listener::BlockListener}; use alloy_network::{AnyHeader, AnyNetwork}; use alloy_primitives::B256; use alloy_provider::Provider; use alloy_rpc_types::anvil::Forking; use futures::StreamExt; use std::f...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/tasks/block_listener.rs
crates/anvil/src/tasks/block_listener.rs
//! A task that listens for new blocks use crate::shutdown::Shutdown; use futures::{FutureExt, Stream, StreamExt}; use std::{ pin::Pin, task::{Context, Poll}, }; /// A Future that will execute a given `task` for each new block that arrives on the stream. pub struct BlockListener<St, F, Fut> { stream: St, ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/miner.rs
crates/anvil/src/eth/miner.rs
//! Mines transactions use crate::eth::pool::{Pool, transactions::PoolTransaction}; use alloy_primitives::TxHash; use futures::{ channel::mpsc::Receiver, stream::{Fuse, StreamExt}, task::AtomicWaker, }; use parking_lot::{RawRwLock, RwLock, lock_api::RwLockWriteGuard}; use std::{ fmt, sync::Arc, ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/sign.rs
crates/anvil/src/eth/sign.rs
use crate::eth::error::BlockchainError; use alloy_consensus::{Sealed, SignableTransaction}; use alloy_dyn_abi::TypedData; use alloy_network::TxSignerSync; use alloy_primitives::{Address, B256, Signature, map::AddressHashMap}; use alloy_signer::Signer as AlloySigner; use alloy_signer_local::PrivateKeySigner; use foundry...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/error.rs
crates/anvil/src/eth/error.rs
//! Aggregated error type for this module use crate::eth::pool::transactions::PoolTransaction; use alloy_consensus::crypto::RecoveryError; use alloy_evm::overrides::StateOverrideError; use alloy_primitives::{B256, Bytes, SignatureError}; use alloy_rpc_types::BlockNumberOrTag; use alloy_signer::Error as SignerError; us...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/api.rs
crates/anvil/src/eth/api.rs
use super::{ backend::mem::{BlockRequest, DatabaseRef, State}, sign::build_typed_transaction, }; use crate::{ ClientFork, LoggingManager, Miner, MiningMode, StorageInfo, eth::{ backend::{ self, db::SerializableState, mem::{MIN_CREATE_GAS, MIN_TRANSACTION_GAS},...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/util.rs
crates/anvil/src/eth/util.rs
use alloy_primitives::hex; use itertools::Itertools; /// Formats values as hex strings, separated by commas. pub fn hex_fmt_many<I, T>(i: I) -> String where I: IntoIterator<Item = T>, T: AsRef<[u8]>, { let items = i.into_iter().map(|item| hex::encode(item.as_ref())).format(", "); format!("{items}") }
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/macros.rs
crates/anvil/src/eth/macros.rs
/// A `info!` helper macro that emits to the target, the node logger listens for macro_rules! node_info { ($($arg:tt)*) => { tracing::info!(target: $crate::logging::NODE_USER_LOG_TARGET, $($arg)*); }; } pub(crate) use node_info;
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/mod.rs
crates/anvil/src/eth/mod.rs
pub mod api; pub mod otterscan; pub mod sign; pub use api::EthApi; pub mod backend; pub mod error; pub mod fees; pub(crate) mod macros; pub mod miner; pub mod pool; pub mod util;
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/fees.rs
crates/anvil/src/eth/fees.rs
use std::{ collections::BTreeMap, fmt, pin::Pin, sync::Arc, task::{Context, Poll}, }; use alloy_consensus::{Header, Transaction}; use alloy_eips::{ calc_next_block_base_fee, eip1559::BaseFeeParams, eip7691::MAX_BLOBS_PER_BLOCK_ELECTRA, eip7840::BlobParams, }; use alloy_primitives::B256; use...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/otterscan/api.rs
crates/anvil/src/eth/otterscan/api.rs
use crate::eth::{ EthApi, error::{BlockchainError, Result}, macros::node_info, }; use alloy_consensus::Transaction as TransactionTrait; use alloy_network::{ AnyHeader, AnyRpcBlock, AnyRpcHeader, AnyRpcTransaction, AnyTxEnvelope, BlockResponse, ReceiptResponse, TransactionResponse, }; use alloy_primi...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/otterscan/mod.rs
crates/anvil/src/eth/otterscan/mod.rs
pub mod api;
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/pool/transactions.rs
crates/anvil/src/eth/pool/transactions.rs
use crate::eth::{error::PoolError, util::hex_fmt_many}; use alloy_consensus::{Transaction, Typed2718}; use alloy_network::AnyRpcTransaction; use alloy_primitives::{ Address, TxHash, map::{HashMap, HashSet}, }; use anvil_core::eth::transaction::PendingTransaction; use foundry_primitives::FoundryTxEnvelope; use p...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/anvil/src/eth/pool/mod.rs
crates/anvil/src/eth/pool/mod.rs
//! # Transaction Pool implementation //! //! The transaction pool is responsible for managing a set of transactions that can be included in //! upcoming blocks. //! //! The main task of the pool is to prepare an ordered list of transactions that are ready to be //! included in a new block. //! //! Each imported block ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false