Skip to main content

Module strategies

Module strategies 

Structs§

EvmFuzzState
Immutable fuzz dictionary seed used by parallel stateless fuzz workers.
IntStrategy
Value tree for signed ints (up to int256). The strategy combines 3 different strategies, each assigned a specific weight:
InvariantFuzzState
Worker-local mutable fuzz dictionary used by invariant campaigns.
LiteralMaps
LiteralsCollector
LiteralsDictionary
UintStrategy
Value tree for unsigned ints (up to uint256). The strategy combines 3 different strategies, each assigned a specific weight:

Traits§

BoundMutator
Mutator that bounds the current value of an uint or int in the given range. The mutated value is always different from the current value.
FuzzStateReader

Functions§

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.
fuzz_contract_with_calldata
Given a function, it returns a proptest strategy which generates valid abi-encoded calldata for that function’s input types.
fuzz_msg_value
Returns a proptest strategy for generating random msg.value for payable functions.
fuzz_param
Given a parameter type, returns a strategy for generating values for that type.
fuzz_param_from_state
Given a parameter type, returns a strategy for generating values for that type, given some EVM fuzz state.
fuzz_param_with_fixtures
Given a parameter type and configured fixtures for param name, returns a strategy for generating values for that type.
generate_msg_value
Generates a msg.value for payable functions using TestRunner’s RNG (corpus mutation path).
invariant_strat
Creates the invariant strategy.
mutate_param_value
Mutates the current value of the given parameter type and value.
mutate_param_value_with_senders
Mutates the current value of the given parameter type and value, with optional sender filters.
override_call_strat
Given a target address, we generate random calldata.