Skip to main content

Module calldata

Module calldata 

Source

Re-exportsΒ§

use crate::FuzzFixtures; πŸ”’
use crate::strategies::DictionaryRead; πŸ”’
use crate::strategies::fuzz_param_from_state; πŸ”’
use crate::strategies::fuzz_param_with_fixtures; πŸ”’
use alloy_dyn_abi::DynSolCall; πŸ”’
use alloy_dyn_abi::DynSolReturns; πŸ”’
use alloy_dyn_abi::DynSolType; πŸ”’
use alloy_dyn_abi::DynSolValue; πŸ”’
use alloy_json_abi::Function; πŸ”’
use alloy_json_abi::Param; πŸ”’
use alloy_primitives::Bytes; πŸ”’
use alloy_primitives::U256; πŸ”’
use proptest::prelude::Strategy; πŸ”’
use proptest::strategy::BoxedStrategy; πŸ”’

StructsΒ§

CalldataEncoder πŸ”’

EnumsΒ§

EnumClamp πŸ”’
Plan for constraining the enum leaves of a fuzzed parameter into their valid 0..variant_count range. Solidity enums are ABI-encoded as uint8, so without this the fuzzer can generate out-of-range values that the contract rejects with Panic(0x21) when decoding them.

FunctionsΒ§

bound_enum πŸ”’
Wraps strat to constrain any enum leaves in input to their valid range; a no-op otherwise.
clamp_enum_leaf πŸ”’
Recursively reduces every uint8 leaf in an enum value (possibly nested in arrays) modulo count.
constrain_enum_value πŸ”’
Constrains enum leaves in a decoded value to the range declared by its Solidity type.
fuzz_calldata
Given a function, it returns a strategy which generates valid calldata for that function’s input types, following declared test fixtures.
fuzz_calldata_from_state πŸ”’
Given a function and some state, it returns a strategy which generated valid calldata for the given function’s input types, based on state taken from the EVM.
parse_input_types πŸ”’