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/forge/src/cmd/tree.rs
crates/forge/src/cmd/tree.rs
use clap::Parser; use eyre::Result; use foundry_cli::{opts::ProjectPathOpts, utils::LoadConfig}; use foundry_compilers::{ Graph, resolver::{Charset, TreeOptions}, }; /// CLI arguments for `forge tree`. #[derive(Clone, Debug, Parser)] pub struct TreeArgs { /// Do not de-duplicate (repeats all shared depende...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/selectors.rs
crates/forge/src/cmd/selectors.rs
use alloy_primitives::hex; use clap::Parser; use comfy_table::{Table, modifiers::UTF8_ROUND_CORNERS, presets::ASCII_MARKDOWN}; use eyre::Result; use foundry_cli::{ opts::{BuildOpts, CompilerOpts, ProjectPathOpts}, utils::{FoundryPathExt, cache_local_signatures, cache_signatures_from_abis}, }; use foundry_common...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/install.rs
crates/forge/src/cmd/install.rs
use crate::{DepIdentifier, FOUNDRY_LOCK, Lockfile}; use clap::{Parser, ValueHint}; use eyre::{Context, Result}; use foundry_cli::{ opts::Dependency, utils::{CommandUtils, Git, LoadConfig}, }; use foundry_common::fs; use foundry_config::{Config, impl_figment_convert_basic}; use regex::Regex; use semver::Version;...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/build.rs
crates/forge/src/cmd/build.rs
use super::{install, watch::WatchArgs}; use clap::Parser; use eyre::{Context, Result}; use forge_lint::{linter::Linter, sol::SolidityLinter}; use foundry_cli::{ opts::{BuildOpts, configure_pcx_from_solc, get_solar_sources_from_compile_output}, utils::{LoadConfig, cache_local_signatures}, }; use foundry_common::...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/watch.rs
crates/forge/src/cmd/watch.rs
use super::{ build::BuildArgs, coverage::CoverageArgs, doc::DocArgs, fmt::FmtArgs, snapshot::GasSnapshotArgs, test::TestArgs, }; use alloy_primitives::map::HashSet; use clap::Parser; use eyre::Result; use foundry_cli::utils::{self, FoundryPathExt, LoadConfig}; use foundry_config::Config; use parking_lot::Mutex;...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/clone.rs
crates/forge/src/cmd/clone.rs
use super::{init::InitArgs, install::DependencyInstallOpts}; use alloy_primitives::{Address, Bytes, ChainId, TxHash}; use clap::{Parser, ValueHint}; use eyre::Result; use foundry_block_explorers::{ Client, contract::{ContractCreationData, ContractMetadata, Metadata}, errors::EtherscanError, }; use foundry_c...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/mod.rs
crates/forge/src/cmd/mod.rs
//! `forge` subcommands. //! //! All subcommands should respect the `foundry_config::Config`. //! If a subcommand accepts values that are supported by the `Config`, then the subcommand should //! implement `figment::Provider` which allows the subcommand to override the config's defaults, see //! [`foundry_config::Confi...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/init.rs
crates/forge/src/cmd/init.rs
use super::install::DependencyInstallOpts; use clap::{Parser, ValueHint}; use eyre::Result; use foundry_cli::utils::Git; use foundry_common::fs; use foundry_compilers::artifacts::remappings::Remapping; use foundry_config::Config; use std::path::{Path, PathBuf}; use yansi::Paint; /// Supported networks for `forge init ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/geiger.rs
crates/forge/src/cmd/geiger.rs
use clap::{Parser, ValueHint}; use eyre::Result; use foundry_cli::opts::BuildOpts; use foundry_config::{DenyLevel, impl_figment_convert}; use std::path::PathBuf; /// CLI arguments for `forge geiger`. /// /// This command is an alias for `forge lint --only-lint unsafe-cheatcode` /// and detects usage of unsafe cheat 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/forge/src/cmd/bind_json.rs
crates/forge/src/cmd/bind_json.rs
use super::eip712::Resolver; use clap::{Parser, ValueHint}; use eyre::Result; use foundry_cli::{ opts::{BuildOpts, configure_pcx_from_solc}, utils::LoadConfig, }; use foundry_common::{TYPE_BINDING_PREFIX, fs}; use foundry_compilers::{ CompilerInput, Graph, Project, artifacts::{Source, Sources}, mult...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/snapshot.rs
crates/forge/src/cmd/snapshot.rs
use super::test; use crate::result::{SuiteTestResult, TestKindReport, TestOutcome}; use alloy_primitives::{U256, map::HashMap}; use clap::{Parser, ValueHint, builder::RangedU64ValueParser}; use comfy_table::{ Cell, Color, Row, Table, modifiers::UTF8_ROUND_CORNERS, presets::ASCII_MARKDOWN, }; use eyre::{Context, Res...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/cache.rs
crates/forge/src/cmd/cache.rs
use cache::Cache; use clap::{ Arg, Command, Parser, Subcommand, builder::{PossibleValuesParser, TypedValueParser}, }; use eyre::Result; use foundry_config::{Chain, Config, NamedChain, cache}; use std::{ffi::OsStr, str::FromStr}; use strum::VariantNames; /// CLI arguments for `forge cache`. #[derive(Debug, Pars...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/eip712.rs
crates/forge/src/cmd/eip712.rs
use alloy_primitives::{B256, keccak256}; use clap::{Parser, ValueHint}; use eyre::Result; use foundry_cli::{opts::BuildOpts, utils::LoadConfig}; use foundry_common::{compile::ProjectCompiler, shell}; use serde::Serialize; use solar::sema::{ Gcx, Hir, hir::StructId, ty::{Ty, TyKind}, }; use std::{ 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/forge/src/cmd/remove.rs
crates/forge/src/cmd/remove.rs
use crate::Lockfile; use clap::{Parser, ValueHint}; use eyre::Result; use foundry_cli::{ opts::Dependency, utils::{Git, LoadConfig}, }; use foundry_config::impl_figment_convert_basic; use std::path::PathBuf; /// CLI arguments for `forge remove`. #[derive(Clone, Debug, Parser)] pub struct RemoveArgs { /// 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/forge/src/cmd/create.rs
crates/forge/src/cmd/create.rs
use crate::cmd::install; use alloy_chains::Chain; use alloy_dyn_abi::{DynSolValue, JsonAbiExt, Specifier}; use alloy_json_abi::{Constructor, JsonAbi}; use alloy_network::{AnyNetwork, AnyTransactionReceipt, EthereumWallet, TransactionBuilder}; use alloy_primitives::{Address, Bytes, hex}; use alloy_provider::{PendingTran...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/inspect.rs
crates/forge/src/cmd/inspect.rs
use alloy_json_abi::{EventParam, InternalType, JsonAbi, Param}; use alloy_primitives::{hex, keccak256}; use clap::Parser; use comfy_table::{Cell, Table, modifiers::UTF8_ROUND_CORNERS, presets::ASCII_MARKDOWN}; use eyre::{Result, eyre}; use foundry_cli::opts::{BuildOpts, CompilerOpts}; use foundry_common::{ compile:...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/fmt.rs
crates/forge/src/cmd/fmt.rs
use super::watch::WatchArgs; use clap::{Parser, ValueHint}; use eyre::Result; use foundry_cli::utils::{FoundryPathExt, LoadConfig}; use foundry_common::{errors::convert_solar_errors, fs}; use foundry_compilers::{compilers::solc::SolcLanguage, solc::SOLC_EXTENSIONS}; use foundry_config::{filter::expand_globs, impl_figme...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/remappings.rs
crates/forge/src/cmd/remappings.rs
use clap::{Parser, ValueHint}; use eyre::Result; use foundry_cli::utils::LoadConfig; use foundry_config::impl_figment_convert_basic; use std::{collections::BTreeMap, path::PathBuf}; /// CLI arguments for `forge remappings`. #[derive(Clone, Debug, Parser)] pub struct RemappingArgs { /// The project's root path. ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/compiler.rs
crates/forge/src/cmd/compiler.rs
use clap::{Parser, Subcommand, ValueHint}; use eyre::Result; use foundry_common::shell; use foundry_compilers::{Graph, artifacts::EvmVersion}; use foundry_config::Config; use semver::Version; use serde::Serialize; use std::{collections::BTreeMap, path::PathBuf}; /// CLI arguments for `forge compiler`. #[derive(Debug, ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/generate/mod.rs
crates/forge/src/cmd/generate/mod.rs
use clap::{Parser, Subcommand}; use eyre::Result; use foundry_common::fs; use std::path::Path; use yansi::Paint; /// CLI arguments for `forge generate`. #[derive(Debug, Parser)] pub struct GenerateArgs { #[command(subcommand)] pub sub: GenerateSubcommands, } #[derive(Debug, Subcommand)] pub enum GenerateSubco...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/test/filter.rs
crates/forge/src/cmd/test/filter.rs
use clap::Parser; use foundry_common::TestFilter; use foundry_compilers::{FileFilter, ProjectPathsConfig}; use foundry_config::{Config, filter::GlobMatcher}; use std::{fmt, path::Path}; /// The filter to use during testing. /// /// See also `FileFilter`. #[derive(Clone, Parser)] #[command(next_help_heading = "Test fil...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/test/summary.rs
crates/forge/src/cmd/test/summary.rs
use crate::cmd::test::TestOutcome; use comfy_table::{ Cell, Color, Row, Table, modifiers::UTF8_ROUND_CORNERS, presets::ASCII_MARKDOWN, }; use foundry_common::shell; use foundry_evm::executors::invariant::InvariantMetrics; use itertools::Itertools; use serde_json::json; use std::{collections::HashMap, fmt::Display};...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/test/mod.rs
crates/forge/src/cmd/test/mod.rs
use super::{install, test::filter::ProjectPathsAwareFilter, watch::WatchArgs}; use crate::{ MultiContractRunner, MultiContractRunnerBuilder, decode::decode_console_logs, gas_report::GasReport, multi_runner::matches_artifact, result::{SuiteResult, TestOutcome, TestStatus}, traces::{ CallT...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/doc/mod.rs
crates/forge/src/cmd/doc/mod.rs
use super::watch::WatchArgs; use clap::{Parser, ValueHint}; use eyre::Result; use forge_doc::{ ContractInheritance, Deployments, DocBuilder, GitSource, InferInlineHyperlinks, Inheritdoc, }; use foundry_cli::opts::GH_REPO_PREFIX_REGEX; use foundry_common::compile::ProjectCompiler; use foundry_config::{Config, load_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/forge/src/cmd/doc/server.rs
crates/forge/src/cmd/doc/server.rs
use axum::{Router, routing::get_service}; use forge_doc::mdbook::{MDBook, utils::fs::get_404_output_file}; use std::{ io, net::{SocketAddr, ToSocketAddrs}, path::PathBuf, }; use tower_http::services::{ServeDir, ServeFile}; /// The HTTP endpoint for the websocket used to trigger reloads when a file changes....
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/ui.rs
crates/forge/tests/ui.rs
use foundry_test_utils::ui_runner; use std::{env, path::Path}; const FORGE_CMD: &str = env!("CARGO_BIN_EXE_forge"); const FORGE_DIR: &str = env!("CARGO_MANIFEST_DIR"); fn main() -> impl std::process::Termination { let forge_cmd = Path::new(FORGE_CMD); let forge_dir = Path::new(FORGE_DIR); let lint_testdat...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/config.rs
crates/forge/tests/cli/config.rs
//! Contains various tests for checking forge commands related to config values use alloy_primitives::{Address, B256, U256}; use foundry_cli::utils as forge_utils; use foundry_compilers::{ artifacts::{BytecodeHash, OptimizerDetails, RevertStrings, YulDetails}, solc::Solc, }; use foundry_config::{ Compilati...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/bind.rs
crates/forge/tests/cli/bind.rs
// <https://github.com/foundry-rs/foundry/issues/9482> forgetest!(bind_unlinked_bytecode, |prj, cmd| { prj.add_source( "SomeLibContract.sol", r#" library SomeLib { function add(uint256 a, uint256 b) external pure returns (uint256) { return a + b; } } contract SomeLibContract { 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/forge/tests/cli/coverage.rs
crates/forge/tests/cli/coverage.rs
use foundry_common::fs::{self, files_with_ext}; use foundry_test_utils::{ TestCommand, TestProject, snapbox::{Data, IntoData}, }; use std::path::Path; #[track_caller] fn assert_lcov(cmd: &mut TestCommand, data: impl IntoData) { cmd.args(["--report=lcov", "--report-file"]).assert_file(data.into_data()); } ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/verify_bytecode.rs
crates/forge/tests/cli/verify_bytecode.rs
use foundry_compilers::artifacts::{BytecodeHash, EvmVersion}; use foundry_config::Config; use foundry_test_utils::{ TestCommand, TestProject, forgetest_async, rpc::{next_etherscan_api_key, next_http_archive_rpc_url}, util::OutputExt, }; #[expect(clippy::too_many_arguments)] fn test_verify_bytecode( prj...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/svm.rs
crates/forge/tests/cli/svm.rs
//! svm sanity checks use semver::Version; use svm::Platform; /// The latest Solc release. /// /// Solc to Foundry release process: /// 1. new solc release /// 2. svm updated with all build info /// 3. svm bumped in foundry-compilers /// 4. foundry-compilers update with any breaking changes /// 5. upgrade the `LATEST...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/version.rs
crates/forge/tests/cli/version.rs
use foundry_test_utils::{forgetest, str}; forgetest!(print_short_version, |_prj, cmd| { cmd.arg("-V").assert_success().stdout_eq(str![[r#" forge [..]-[..] ([..] [..]) "#]]); }); forgetest!(print_long_version, |_prj, cmd| { cmd.arg("--version").assert_success().stdout_eq(str![[r#" forge Version: [..] Commit S...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/soldeer.rs
crates/forge/tests/cli/soldeer.rs
//! Contains various tests related to `forge soldeer`. use std::{fs, path::Path}; use foundry_test_utils::forgesoldeer; forgesoldeer!(install_dependency, |prj, cmd| { let command = "install"; let dependency = "forge-std~1.8.1"; let mut foundry_contents = r#"[profile.default] src = "src" out = "out" libs...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/doc.rs
crates/forge/tests/cli/doc.rs
use foundry_test_utils::util::{RemoteProject, setup_forge_remote}; #[test] fn can_generate_solmate_docs() { let (prj, _) = setup_forge_remote(RemoteProject::new("transmissions11/solmate").set_build(false)); prj.forge_command().args(["doc", "--build"]).assert_success(); } // Test that overloaded functi...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/fmt_integration.rs
crates/forge/tests/cli/fmt_integration.rs
use foundry_test_utils::util::ExtTester; /// Test `forge fmt` immutability. /// TODO: make sure original fmt is not changed after projects format and rev available. macro_rules! fmt_test { ($name:ident, $org:expr, $repo:expr, $commit:expr) => { #[test] fn $name() { let (_, mut cmd) = Ex...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/lint.rs
crates/forge/tests/cli/lint.rs
use forge_lint::{linter::Lint, sol::med::REGISTERED_LINTS}; use foundry_config::{DenyLevel, LintSeverity, LinterConfig}; mod geiger; const CONTRACT: &str = r#" // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; struct _PascalCaseInfo { uint256 a; } uint256 constant screaming_snake_case_info = 0; contract Contr...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/json.rs
crates/forge/tests/cli/json.rs
// tests enhanced `vm.parseJson` and `vm.serializeJson` cheatcodes, which are not constrained to // alphabetical ordering of struct keys, but rather respect the Solidity struct definition. forgetest_init!(test_parse_json, |prj, cmd| { prj.add_test( "JsonCheats", r#" import {Test} from "forge-std/Tes...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/install.rs
crates/forge/tests/cli/install.rs
//! forge install and update tests use forge::{DepIdentifier, FOUNDRY_LOCK, Lockfile}; use foundry_cli::utils::{Git, Submodules}; use foundry_compilers::artifacts::Remapping; use foundry_config::Config; use foundry_test_utils::util::{ ExtTester, FORGE_STD_REVISION, TestCommand, pretty_err, read_string, }; use semv...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/build.rs
crates/forge/tests/cli/build.rs
use crate::utils::generate_large_init_contract; use foundry_test_utils::{forgetest, snapbox::IntoData, str}; use globset::Glob; forgetest_init!(can_parse_build_filters, |prj, cmd| { prj.initialize_default_contracts(); prj.clear(); cmd.args(["build", "--names", "--skip", "tests", "scripts"]).assert_success...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/debug.rs
crates/forge/tests/cli/debug.rs
use itertools::Itertools; use std::path::Path; // Sets up a debuggable test case. // Run with `cargo test-debugger`. forgetest!( #[ignore = "ran manually"] manual_debug_setup, |prj, cmd| { cmd.args(["init", "--force"]) .arg(prj.root()) .assert_success() .stdout_e...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/verify.rs
crates/forge/tests/cli/verify.rs
//! Contains various tests for checking forge commands related to verifying contracts on Etherscan //! and Sourcify. use crate::utils::{self, EnvExternalities}; use foundry_common::retry::Retry; use foundry_test_utils::{ forgetest, util::{OutputExt, TestCommand, TestProject}, }; use std::time::Duration; /// A...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/utils.rs
crates/forge/tests/cli/utils.rs
//! Various helper functions use alloy_chains::NamedChain; use alloy_primitives::Address; use alloy_signer_local::PrivateKeySigner; /// Returns the current millis since unix epoch. /// /// This way we generate unique contracts so, etherscan will always have to verify them pub fn millis_since_epoch() -> u128 { let...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/failure_assertions.rs
crates/forge/tests/cli/failure_assertions.rs
// Tests in which we want to assert failures. forgetest!(test_fail_deprecation, |prj, cmd| { prj.insert_ds_test(); prj.add_source( "DeprecationTestFail.t.sol", r#" import "./test.sol"; contract DeprecationTestFail is DSTest { function testFail_deprecated() public { ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/ext_integration.rs
crates/forge/tests/cli/ext_integration.rs
use foundry_test_utils::util::ExtTester; // Actively maintained tests // Last updated: June 19th 2025 // <https://github.com/foundry-rs/forge-std> #[test] fn forge_std() { ExtTester::new("foundry-rs", "forge-std", "b69e66b0ff79924d487d49bf7fb47c9ec326acba") // Skip fork tests. .args(["--nmc", "For...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/inline_config.rs
crates/forge/tests/cli/inline_config.rs
forgetest!(runs, |prj, cmd| { prj.add_test( "inline.sol", " contract Inline { /** forge-config: default.fuzz.runs = 2 */ function test1(bool) public {} \t///\t forge-config:\tdefault.fuzz.runs=\t3 \t function test2(bool) public {} ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/bind_json.rs
crates/forge/tests/cli/bind_json.rs
use foundry_test_utils::snapbox; // tests complete bind-json workflow // ensures that we can run forge-bind even if files are depending on yet non-existent bindings and // that generated bindings are correct forgetest_init!(test_bind_json, |prj, cmd| { prj.add_test( "JsonBindings", r#" import {Json...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_optimizer.rs
crates/forge/tests/cli/test_optimizer.rs
//! Tests for the `forge test` with preprocessed cache. // Test cache is invalidated when `forge build` if optimize test option toggled. forgetest_init!(toggle_invalidate_cache_on_build, |prj, cmd| { prj.initialize_default_contracts(); prj.update_config(|config| { config.dynamic_test_linking = true; ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/script.rs
crates/forge/tests/cli/script.rs
//! Contains various tests related to `forge script`. use crate::constants::TEMPLATE_CONTRACT; use alloy_hardforks::EthereumHardfork; use alloy_primitives::{Address, Bytes, address, hex}; use anvil::{NodeConfig, spawn}; use forge_script_sequence::ScriptSequence; use foundry_test_utils::{ ScriptOutcome, ScriptTeste...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/main.rs
crates/forge/tests/cli/main.rs
#[macro_use] extern crate foundry_test_utils; pub mod constants; pub mod utils; mod backtrace; mod bind; mod bind_json; mod build; mod cache; mod cmd; mod compiler; mod config; mod context; mod coverage; mod create; mod debug; mod doc; mod eip712; mod failure_assertions; mod inline_config; mod install; mod json; mod...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/backtrace.rs
crates/forge/tests/cli/backtrace.rs
//! Tests for backtrace functionality use foundry_test_utils::rpc::{next_etherscan_api_key, next_http_rpc_endpoint}; forgetest!(test_backtraces, |prj, cmd| { prj.insert_ds_test(); prj.insert_vm(); prj.add_source("SimpleRevert.sol", include_str!("../fixtures/backtraces/SimpleRevert.sol")); prj.add_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/forge/tests/cli/constants.rs
crates/forge/tests/cli/constants.rs
//! various constants pub const TEMPLATE_CONTRACT: &str = "Counter"; pub const TEMPLATE_TEST_CONTRACT: &str = "CounterTest"; pub const TEMPLATE_CONTRACT_ARTIFACT_BASE: &str = "Counter.sol/Counter"; pub const TEMPLATE_CONTRACT_ARTIFACT_JSON: &str = "Counter.sol/Counter.json"; pub const TEMPLATE_TEST_CONTRACT_ARTIFA...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/cache.rs
crates/forge/tests/cli/cache.rs
//! Tests for various cache command. forgetest!(can_list_cache, |_prj, cmd| { cmd.args(["cache", "ls"]); cmd.assert_success(); }); forgetest!(can_list_cache_all, |_prj, cmd| { cmd.args(["cache", "ls", "all"]); cmd.assert_success(); }); forgetest!(can_list_specific_chain, |_prj, cmd| { cmd.args(["...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/context.rs
crates/forge/tests/cli/context.rs
//! Contains tests for checking forge execution context cheatcodes const FORGE_TEST_CONTEXT_CONTRACT: &str = r#" import "./test.sol"; interface Vm { enum ForgeContext { TestGroup, Test, Coverage, Snapshot, ScriptGroup, ScriptDryRun, ScriptBroadcast, ScriptResume, Unknown } function isContext(ForgeContext contex...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/eip712.rs
crates/forge/tests/cli/eip712.rs
use foundry_config::fs_permissions::PathPermission; forgetest!(test_eip712, |prj, cmd| { let path = prj.add_test( "Structs.sol", r#" library Structs { struct Foo { Bar bar; } struct Bar { Art art; } struct Art { uint256 id; } struct Complex { ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/cmd.rs
crates/forge/tests/cli/cmd.rs
//! Contains various tests for checking forge's commands use crate::constants::*; use foundry_compilers::artifacts::{ConfigurableContractArtifact, Metadata, remappings::Remapping}; use foundry_config::{ BasicConfig, Chain, Config, DenyLevel, FuzzConfig, InvariantConfig, SolidityErrorCode, parse_with_profile, }...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/create.rs
crates/forge/tests/cli/create.rs
//! Contains various tests for checking the `forge create` subcommand use crate::{ constants::*, utils::{self, EnvExternalities}, }; use alloy_primitives::{Address, hex}; use anvil::{NodeConfig, spawn}; use foundry_compilers::artifacts::{BytecodeHash, remappings::Remapping}; use foundry_test_utils::{ forge...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/fmt.rs
crates/forge/tests/cli/fmt.rs
//! Integration tests for `forge fmt` command use foundry_test_utils::{forgetest, forgetest_init}; const UNFORMATTED: &str = r#"// SPDX-License-Identifier: MIT pragma solidity =0.8.30 ; contract Test { uint256 public value ; function setValue ( uint256 _value ) public { 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/forge/tests/cli/multi_script.rs
crates/forge/tests/cli/multi_script.rs
//! Contains various tests related to forge script use anvil::{NodeConfig, spawn}; use foundry_test_utils::{ScriptOutcome, ScriptTester}; forgetest_async!(can_deploy_multi_chain_script_without_lib, |prj, cmd| { let (api1, handle1) = spawn(NodeConfig::test()).await; let (api2, handle2) = spawn(NodeConfig::test...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/precompiles.rs
crates/forge/tests/cli/precompiles.rs
//! Contains various tests for `forge test` with precompiles. use foundry_evm_networks::NetworkConfigs; use foundry_test_utils::str; // tests transfer using celo precompile. // <https://github.com/foundry-rs/foundry/issues/11622> forgetest_init!(celo_transfer, |prj, cmd| { prj.update_config(|config| { con...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/compiler.rs
crates/forge/tests/cli/compiler.rs
//! Tests for the `forge compiler` command. use foundry_test_utils::snapbox::IntoData; const CONTRACT_A: &str = r#" // SPDX-license-identifier: MIT pragma solidity 0.8.4; contract ContractA {} "#; const CONTRACT_B: &str = r#" // SPDX-license-identifier: MIT pragma solidity 0.8.11; contract ContractB {} "#; const ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/lint/geiger.rs
crates/forge/tests/cli/lint/geiger.rs
forgetest_init!(call, |prj, cmd| { prj.add_test( "call.t.sol", r#" import {Test} from "forge-std/Test.sol"; contract A is Test { function do_ffi() public { string[] memory inputs = new string[](1); vm.ffi(inputs); } } ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/fuzz.rs
crates/forge/tests/cli/test_cmd/fuzz.rs
use alloy_primitives::U256; use foundry_test_utils::{TestCommand, forgetest_init, str}; use regex::Regex; forgetest_init!(test_can_scrape_bytecode, |prj, cmd| { prj.update_config(|config| config.optimizer = Some(true)); prj.add_source( "FuzzerDict.sol", r#" // https://github.com/foundry-rs/foun...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/trace.rs
crates/forge/tests/cli/test_cmd/trace.rs
//! Tests for tracing functionality use foundry_test_utils::str; forgetest_init!(conflicting_signatures, |prj, cmd| { prj.add_test( "ConflictingSignatures.t.sol", r#" pragma solidity ^0.8.18; import "forge-std/Test.sol"; contract ReturnsNothing { function func() public pure {} } contract Re...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/table.rs
crates/forge/tests/cli/test_cmd/table.rs
//! Table tests. use foundry_test_utils::{forgetest_init, str}; forgetest_init!(should_run_table_tests, |prj, cmd| { prj.initialize_default_contracts(); prj.add_test( "CounterTable.t.sol", r#" import "forge-std/Test.sol"; import {Counter} from "../src/Counter.sol"; contract CounterTableTest 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/forge/tests/cli/test_cmd/core.rs
crates/forge/tests/cli/test_cmd/core.rs
//! Core test functionality tests use foundry_test_utils::str; forgetest_init!(failing_test_after_failed_setup, |prj, cmd| { prj.add_test( "FailingTestAfterFailedSetup.t.sol", r#" import "forge-std/Test.sol"; contract FailingTestAfterFailedSetupTest is Test { function setUp() public { ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/repros.rs
crates/forge/tests/cli/test_cmd/repros.rs
//! Regression tests for specific GitHub issues use foundry_test_utils::str; // https://github.com/foundry-rs/foundry/issues/3055 forgetest_init!(issue_3055, |prj, cmd| { prj.add_test( "Issue3055.t.sol", r#" import "forge-std/Test.sol"; /// forge-config: default.assertions_revert = false contract...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/mod.rs
crates/forge/tests/cli/test_cmd/mod.rs
//! Contains various tests for `forge test`. use alloy_primitives::U256; use anvil::{NodeConfig, spawn}; use foundry_test_utils::{ TestCommand, rpc::{self, rpc_endpoints}, str, util::{OTHER_SOLC_VERSION, OutputExt, SOLC_VERSION}, }; use similar_asserts::assert_eq; use std::{io::Write, path::PathBuf, st...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/logs.rs
crates/forge/tests/cli/test_cmd/logs.rs
//! Tests for various logging functionality use foundry_test_utils::str; forgetest_init!(debug_logs, |prj, cmd| { prj.add_test( "DebugLogs.t.sol", r#" import "forge-std/Test.sol"; contract DebugLogsTest is Test { constructor() { emit log_uint(0); } function setUp() public { ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/spec.rs
crates/forge/tests/cli/test_cmd/spec.rs
use foundry_test_utils::rpc; // Test evm version switch during tests / scripts. // <https://github.com/foundry-rs/foundry/issues/9840> // <https://github.com/foundry-rs/foundry/issues/6228> forgetest_init!(test_set_evm_version, |prj, cmd| { let endpoint = rpc::next_http_archive_rpc_url(); prj.add_test( ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/invariant/target.rs
crates/forge/tests/cli/test_cmd/invariant/target.rs
use super::*; forgetest!(filters, |prj, cmd| { prj.insert_vm(); prj.insert_ds_test(); prj.update_config(|config| { config.invariant.runs = 50; config.invariant.depth = 10; }); prj.add_test( "ExcludeContracts.t.sol", r#" import { DSTest as Test } from "src/test.sol";...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/invariant/storage.rs
crates/forge/tests/cli/test_cmd/invariant/storage.rs
use super::*; forgetest_init!(storage, |prj, cmd| { prj.add_test( "name", r#" import "forge-std/Test.sol"; contract Contract { address public addr = address(0xbeef); string public str = "hello"; uint256 public num = 1337; uint256 public pushNum; function changeAddress(address ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/invariant/mod.rs
crates/forge/tests/cli/test_cmd/invariant/mod.rs
use alloy_primitives::U256; use foundry_test_utils::{TestCommand, forgetest_init, snapbox::cmd::OutputAssert, str}; mod common; mod storage; mod target; fn assert_invariant(cmd: &mut TestCommand) -> OutputAssert { cmd.assert_with(&[ ("[RUNS]", r"runs: \d+, calls: \d+, reverts: \d+"), ("[SEQUENCE]"...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/tests/cli/test_cmd/invariant/common.rs
crates/forge/tests/cli/test_cmd/invariant/common.rs
use super::*; forgetest!(invariant_after_invariant, |prj, cmd| { prj.insert_vm(); prj.insert_ds_test(); prj.add_test( "InvariantAfterInvariant.t.sol", r#" import { DSTest as Test } from "src/test.sol"; struct FuzzSelector { address addr; bytes4[] selectors; } contract AfterInvari...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/bin/main.rs
crates/forge/bin/main.rs
//! The `forge` CLI: build, test, fuzz, debug and deploy Solidity contracts, like Hardhat, Brownie, //! Ape. use forge::args::run; #[global_allocator] static ALLOC: foundry_cli::utils::Allocator = foundry_cli::utils::new_allocator(); fn main() { if let Err(err) = run() { let _ = foundry_common::sh_err!("...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/src/solidity_helper.rs
crates/chisel/src/solidity_helper.rs
//! This module contains the `SolidityHelper`, a [rustyline::Helper] implementation for //! usage in Chisel. It was originally ported from [soli](https://github.com/jpopesculian/soli/blob/master/src/main.rs). use crate::{ dispatcher::PROMPT_ARROW, prelude::{COMMAND_LEADER, ChiselCommand, PROMPT_ARROW_STR}, }; ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/src/source.rs
crates/chisel/src/source.rs
//! Session Source //! //! This module contains the `SessionSource` struct, which is a minimal wrapper around //! the REPL contract's source code. It provides simple compilation, parsing, and //! execution helpers. use eyre::Result; use forge_doc::solang_ext::{CodeLocationExt, SafeUnwrap}; use foundry_common::fs; use ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/src/lib.rs
crates/chisel/src/lib.rs
//! Chisel is a fast, utilitarian, and verbose Solidity REPL. #![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 args; pub mod cmd; pub mod dispatcher; pub mod executor; pub mod opts;...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/src/runner.rs
crates/chisel/src/runner.rs
//! ChiselRunner //! //! This module contains the `ChiselRunner` struct, which assists with deploying //! and calling the REPL contract on a in-memory REVM instance. use alloy_primitives::{Address, Bytes, Log, U256, map::AddressHashMap}; use eyre::Result; use foundry_evm::{ executors::{DeployResult, Executor, RawC...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/src/session.rs
crates/chisel/src/session.rs
//! ChiselSession //! //! This module contains the `ChiselSession` struct, which is the top-level //! wrapper for a serializable REPL session. use crate::prelude::{SessionSource, SessionSourceConfig}; use eyre::Result; use serde::{Deserialize, Serialize}; use std::path::Path; use time::{OffsetDateTime, format_descript...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/src/args.rs
crates/chisel/src/args.rs
use crate::{ opts::{Chisel, ChiselSubcommand}, prelude::{ChiselCommand, ChiselDispatcher, SolidityHelper}, }; use clap::Parser; use eyre::{Context, Result}; use foundry_cli::utils::{self, LoadConfig}; use foundry_common::fs; use rustyline::{Editor, config::Configurer, error::ReadlineError}; use std::{ops::Contr...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/src/dispatcher.rs
crates/chisel/src/dispatcher.rs
//! Dispatcher //! //! This module contains the `ChiselDispatcher` struct, which handles the dispatching //! of both builtin commands and Solidity snippets. use crate::{ prelude::{ChiselCommand, ChiselResult, ChiselSession, SessionSourceConfig, SolidityHelper}, source::SessionSource, }; use alloy_primitives::{...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/src/executor.rs
crates/chisel/src/executor.rs
//! Executor //! //! This module contains the execution logic for the [SessionSource]. use crate::{ prelude::{ChiselDispatcher, ChiselResult, ChiselRunner, SessionSource, SolidityHelper}, source::IntermediateOutput, }; use alloy_dyn_abi::{DynSolType, DynSolValue}; use alloy_json_abi::EventParam; use alloy_prim...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/src/opts.rs
crates/chisel/src/opts.rs
use clap::{Parser, Subcommand}; use foundry_cli::opts::{BuildOpts, EvmArgs, GlobalArgs}; use foundry_common::version::{LONG_VERSION, SHORT_VERSION}; use std::path::PathBuf; foundry_config::impl_figment_convert!(Chisel, build, evm); /// Fast, utilitarian, and verbose Solidity REPL. #[derive(Debug, Parser)] #[command(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/chisel/src/cmd.rs
crates/chisel/src/cmd.rs
use crate::prelude::CHISEL_CHAR; use alloy_primitives::Address; use clap::{CommandFactory, Parser}; use itertools::Itertools; use yansi::Paint; /// Chisel REPL commands. #[derive(Debug, Parser)] #[command(disable_help_flag = true, disable_help_subcommand = true)] pub enum ChiselCommand { /// Display all commands. ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/tests/it/main.rs
crates/chisel/tests/it/main.rs
#[cfg(unix)] mod repl;
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/tests/it/repl/session.rs
crates/chisel/tests/it/repl/session.rs
use foundry_compilers::PathStyle; use foundry_test_utils::TestProject; use rexpect::{reader::Options, session::PtySession, spawn_with_options}; const TIMEOUT_SECS: u64 = 3; const PROMPT: &str = "➜ "; /// Testing session for Chisel. pub struct ChiselSession { session: Box<PtySession>, project: Box<TestProject>...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/tests/it/repl/mod.rs
crates/chisel/tests/it/repl/mod.rs
mod session; use session::ChiselSession; macro_rules! repl_test { ($name:ident, | $cmd:ident | $test:expr) => { repl_test!($name, "", |$cmd| $test); }; ($name:ident, $flags:expr, | $cmd:ident | $test:expr) => { repl_test!($name, $flags, init = false, |$cmd| $test); }; ($name:ident, ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/chisel/bin/main.rs
crates/chisel/bin/main.rs
//! The `chisel` CLI: a fast, utilitarian, and verbose Solidity REPL. use chisel::args::run; #[global_allocator] static ALLOC: foundry_cli::utils::Allocator = foundry_cli::utils::new_allocator(); fn main() { if let Err(err) = run() { let _ = foundry_common::sh_err!("{err:?}"); std::process::exit(...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/config.rs
crates/cheatcodes/src/config.rs
use super::Result; use crate::Vm::Rpc; use alloy_primitives::{U256, map::AddressHashMap}; use foundry_common::{ContractsByArtifact, fs::normalize_path}; use foundry_compilers::{ArtifactId, ProjectPathsConfig, utils::canonicalize}; use foundry_config::{ Config, FsPermissions, ResolvedRpcEndpoint, ResolvedRpcEndpoint...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/test.rs
crates/cheatcodes/src/test.rs
//! Implementations of [`Testing`](spec::Group::Testing) cheatcodes. use crate::{Cheatcode, Cheatcodes, CheatsCtxt, Result, Vm::*}; use alloy_chains::Chain as AlloyChain; use alloy_primitives::{Address, U256}; use alloy_sol_types::SolValue; use foundry_common::version::SEMVER_VERSION; use foundry_evm_core::constants::...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/evm.rs
crates/cheatcodes/src/evm.rs
//! Implementations of [`Evm`](spec::Group::Evm) cheatcodes. use crate::{ BroadcastableTransaction, Cheatcode, Cheatcodes, CheatcodesExecutor, CheatsCtxt, Error, Result, Vm::*, inspector::{Ecx, RecordDebugStepInfo}, }; use alloy_consensus::TxEnvelope; use alloy_genesis::{Genesis, GenesisAccount}; use alloy...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/lib.rs
crates/cheatcodes/src/lib.rs
//! # foundry-cheatcodes //! //! Foundry cheatcodes implementations. #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(elided_lifetimes_in_paths)] // Cheats context uses 3 lifetimes #[macro_use] extern crate foundry_common; #[macro_use] pub extern crate 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/cheatcodes/src/version.rs
crates/cheatcodes/src/version.rs
use crate::{Cheatcode, Cheatcodes, Result, Vm::*}; use alloy_sol_types::SolValue; use foundry_common::version::SEMVER_VERSION; use semver::Version; use std::cmp::Ordering; impl Cheatcode for foundryVersionCmpCall { fn apply(&self, _state: &mut Cheatcodes) -> Result { let Self { version } = self; fo...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/string.rs
crates/cheatcodes/src/string.rs
//! Implementations of [`String`](spec::Group::String) cheatcodes. use crate::{Cheatcode, Cheatcodes, Result, Vm::*}; use alloy_dyn_abi::{DynSolType, DynSolValue}; use alloy_primitives::{U256, hex}; use alloy_sol_types::SolValue; // address impl Cheatcode for toString_0Call { fn apply(&self, _state: &mut Cheatcod...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/fs.rs
crates/cheatcodes/src/fs.rs
//! Implementations of [`Filesystem`](spec::Group::Filesystem) cheatcodes. use super::string::parse; use crate::{Cheatcode, Cheatcodes, CheatcodesExecutor, CheatsCtxt, Result, Vm::*}; use alloy_dyn_abi::DynSolType; use alloy_json_abi::ContractObject; use alloy_network::AnyTransactionReceipt; use alloy_primitives::{Byt...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/base64.rs
crates/cheatcodes/src/base64.rs
use crate::{Cheatcode, Cheatcodes, Result, Vm::*}; use alloy_sol_types::SolValue; use base64::prelude::*; impl Cheatcode for toBase64_0Call { fn apply(&self, _state: &mut Cheatcodes) -> Result { let Self { data } = self; Ok(BASE64_STANDARD.encode(data).abi_encode()) } } impl Cheatcode for toBa...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/env.rs
crates/cheatcodes/src/env.rs
//! Implementations of [`Environment`](spec::Group::Environment) cheatcodes. use crate::{Cheatcode, Cheatcodes, Error, Result, Vm::*, string}; use alloy_dyn_abi::DynSolType; use alloy_sol_types::SolValue; use std::{env, sync::OnceLock}; /// Stores the forge execution context for the duration of the program. pub stati...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/json.rs
crates/cheatcodes/src/json.rs
//! Implementations of [`Json`](spec::Group::Json) cheatcodes. use crate::{Cheatcode, Cheatcodes, Result, Vm::*, string}; use alloy_dyn_abi::{DynSolType, DynSolValue, Resolver, eip712_parser::EncodeType}; use alloy_primitives::{Address, B256, I256, U256, hex}; use alloy_sol_types::SolValue; use foundry_common::{fmt::S...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/error.rs
crates/cheatcodes/src/error.rs
use crate::Vm; use alloy_primitives::{Bytes, hex}; use alloy_signer::Error as SignerError; use alloy_signer_local::LocalSignerError; use alloy_sol_types::SolError; use foundry_common::errors::FsPathError; use foundry_config::UnresolvedEnvVarError; use foundry_evm_core::backend::{BackendError, DatabaseError}; use foundr...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cheatcodes/src/utils.rs
crates/cheatcodes/src/utils.rs
//! Implementations of [`Utilities`](spec::Group::Utilities) cheatcodes. use crate::{Cheatcode, Cheatcodes, CheatcodesExecutor, CheatsCtxt, Result, Vm::*}; use alloy_dyn_abi::{DynSolType, DynSolValue, Resolver, TypedData, eip712_parser::EncodeType}; use alloy_ens::namehash; use alloy_primitives::{B64, Bytes, I256, U25...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false