Skip to main content Module utils Copy item path Source use alloy_json_abi::JsonAbi; π use alloy_primitives::Address; π use alloy_primitives::U256; π use alloy_primitives::map::HashMap; π use alloy_provider::Network; π use alloy_provider::Provider; π use alloy_provider::RootProvider; π use alloy_provider::network::AnyNetwork; π use eyre::ContextCompat ; π use eyre::Result ; π use foundry_common::provider::ProviderBuilder ; π use foundry_common::shell ; π use foundry_config::Chain; π use foundry_config::Config ; π use itertools::Itertools; π use path_slash::PathExt; π use regex::Regex; π use serde::de::DeserializeOwned ; π use std::collections::BTreeMap ; π use std::collections::BTreeSet ; π use std::ffi::OsStr ; π use std::ffi::OsString ; π use std::path::Path ; π use std::path::PathBuf ; π use std::process::Command ; π use std::process::Output ; π use std::process::Stdio ; π use std::str::FromStr ; π use std::sync::LazyLock ; π use std::sync::OnceLock ; π use std::time::Duration ; π use std::time::SystemTime ; π use std::time::UNIX_EPOCH ; π use tracing_subscriber::EnvFilter; π use tracing_subscriber::reload; π use tracing_subscriber::prelude::*; π abi π allocator π Abstract global allocator implementation. cmd π suggestions π Helper functions for suggesting alternative values for a possibly erroneous user input. tempo π Tempo utilities: fee token parsing and named nonce lanes (2D nonces). Git ResolvedLane Result of resolving a --tempo.lane <name> argument against a lanes file. Submodule Deserialized git submodule status lib/dep output. SubmoduleCheckout A submodule checkout inspected without changing its worktree or index. Submodules Deserialized git submodule status output. TraceResult A slimmed down return from the executor used for returning minimal trace + gas metering info SubmoduleCheckoutStatus State of an inspected submodule checkout. DEFAULT_LANES_FILE Default name of the lanes file at the project root. STATIC_FUZZ_SEED Deterministic fuzzer seed used for gas snapshots and coverage reports. FILTER_RELOAD_HANDLE π Handle to reload the tracing EnvFilter at runtime. SUBMODULE_STATUS_REGEX Regex used to parse git submodule status output. CommandUtils Useful extensions to std::process::Command . FoundryPathExt Useful extensions to std::path::Path . LoadConfig Helpers for loading configuration. apply_gas_estimate_multiplier Applies an optional percentage multiplier to a gas estimate. cache_local_signatures Traverse the artifacts in the project to generate local signatures and merge them into the cache
file. cache_signatures_from_abis Traverses all files at folder_path, parses any JSON ABI files found,
and caches their function/event/error signatures to the local signatures cache. common_setup Common setup for all CLI tools. Does not include tracing subscriber . did_you_mean 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. emit_warnings enable_paint Sets the default [yansi] color output condition. ensure_clean_constructor Returns error if constructor has arguments. env_filter π eta_key fetch_abi_from_etherscan Fetches the ABI of a contract from Etherscan. find_contract_artifacts Given a Projectβs output, finds the contract by path and name and returns its
ABI, creation bytecode, and ArtifactId. get_chain get_provider Returns a [RootProvider] instantiated using Config βs RPC settings. get_provider_builder Returns a ProviderBuilder instantiated using Config values. has_batch_support True if it supports broadcasting in batches. has_different_gas_calc True if the network calculates gas costs differently. init_progress install_crypto_provider This force installs the default crypto provider. load_config_from_provider Loads and sanitizes Config from a provider and emits generated warnings. load_dotenv Loads dotenv files from the cwd and project root, deferring diagnostics until shell setup. load_lanes Loads a TOML lanes file from path. maybe_print_resolved_lane Prints lane: <name> (nonce_key=<key>, nonce=<n>) to stderr (so it doesnβt pollute
stdout for commands like cast mktx whose stdout is meant to be piped), giving
visibility into which 2D nonce lane was used. needs_setup new_allocator Creates a new allocator . new_allocator_wrapper now Returns the current time as a Duration since the Unix epoch. parse_constructor_args Parses constructor arguments by matching them against the constructorβs input parameters. parse_delay Parses a Duration from a &str parse_ether_value Parses an ether value from a string. parse_fee_token_address Parses a fee token address, numeric TIP-20 token id, or known Tempo fee-token symbol. parse_fee_token_symbol parse_function_args parse_json Parses a T from a string using serde_json::from_str . parse_lanes print_traces read_constructor_args_file Read contract constructor arguments from the given file. resolve_lane Resolves opts.lane against a lanes file and writes the resulting nonce_key to
opts.nonce_key. Returns the resolved lane (or None if no --tempo.lane was set). resolve_name_args subscriber Initializes a tracing Subscriber for logging. token_id_to_address update_tracing_filter Replaces the active tracing EnvFilter at runtime. validate_checkout_ref π Allocator AllocatorInner AllocatorWrapper