Skip to main content Module literals Copy item path Source use alloy_dyn_abi::DynSolType; π use alloy_primitives::B256; π use alloy_primitives::Bytes; π use alloy_primitives::I256; π use alloy_primitives::U256; π use alloy_primitives::keccak256; π use alloy_primitives::map::B256IndexSet; π use alloy_primitives::map::HashMap; π use alloy_primitives::map::IndexSet; π use foundry_common::Analysis ; π use foundry_compilers::ProjectPathsConfig; π use solar::ast; π use solar::ast::BinOpKind::Add; π use solar::ast::BinOpKind::BitAnd; π use solar::ast::BinOpKind::BitOr; π use solar::ast::BinOpKind::BitXor; π use solar::ast::BinOpKind::Div; π use solar::ast::BinOpKind::Mul; π use solar::ast::BinOpKind::Pow; π use solar::ast::BinOpKind::Rem; π use solar::ast::BinOpKind::Shl; π use solar::ast::BinOpKind::Shr; π use solar::ast::BinOpKind::Sub; π use solar::ast::Visit; π use solar::interface::Span; π use solar::interface::source_map::FileName; π use std::cell::RefCell ; π use std::ops::ControlFlow ; π use std::sync::Arc ; π use std::sync::OnceLock ; π EnumBounds Maps Solidity enum definitions to their variant counts, used to constrain fuzzed enum inputs
to valid values (the ABI encodes enums as uint8 without carrying the variant count). EnumBoundsCollector π AST visitor that records enum variant counts, tracking the enclosing contract to build
fully-qualified keys. LiteralMaps LiteralsCollector LiteralsDictionary Num π A folded constant value. Opportunistic 256-bit heuristic, not a Solidity-correct folder. MAX_FOLD_DEPTH π Maximum nesting depth LiteralsCollector::eval recurses into, to bound stack usage. apply_bin π Applies a binary operator to two folded numeric values, carrying the result width so narrow
operands produce in-range results. can_fit_int π Checks if a signed integer value can fit in intN type. can_fit_uint π Checks if an unsigned integer value can fit in uintN type. cast_num π Reinterprets a folded value for an elementary type cast used inside a larger expression,
applying the target width so truncation and sign-extension are correct (e.g.
int256(uint256(type(uint256).max)) -> -1). cast_to_bytes π Casts a folded value to bytesN, keeping the value right-aligned in Num::Bytes. checked_arith π Resolves a default-checked unsigned arithmetic result. combine_width π Combines the widths of two operands: an untyped operand (None) inherits the otherβs width;
two explicit widths pick the wider. lit_bytes π Extracts the raw bytes of a string, unicode, or hex string literal argument, borrowing them
directly from the interner to avoid allocating (and re-hashing) on every fold. low_bits π Returns the low bits of value, zeroing everything above. shift_amount π Returns the shift amount as a usize, or None if it is >= 256 (which shifts out all bits). sign_extend π Sign-extends the low width bits of raw to a full 256-bit twoβs-complement value. signed_pow π Folds a signed base ** exp, returning None on a negative exponent or a magnitude that
doesnβt fit the signed range (overflow ~ compile error). single_arg π Returns the single positional argument of a call, if it has exactly one. type_min_max π Folds type(uintN).max, type(intN).min, and type(intN).max (and type(uintN).min == 0).