Skip to main content

Crate sentri_dynamic_evm

Crate sentri_dynamic_evm 

Source
Expand description

revm-backed dynamic invariant fuzzing for EVM/Solidity contracts.

Ties three things together: sentri_utils::SolcManager (compiles source, already existed), solc_bridge (turns its ABI/bytecode output into the chain-agnostic shapes sentri-dynamic-core understands), and backend::RevmBackend (executes calls against real EVM bytecode via revm, gated behind the revm-backend feature — see that module’s doc comment for why it’s split out and what’s unverified about it).

Re-exports§

pub use types::CompiledContract;

Modules§

rpc
Fetches deployed bytecode from a live EVM JSON-RPC endpoint, for fuzzing contracts that have no available source — the common case for a real bug-bounty target, which may not be verified on any block explorer.
solc_bridge
Bridges solc’s --combined-json abi,bin output (already produced by sentri_utils::SolcManager, previously only used for its AST) into the chain-agnostic FunctionSpec/CompiledContract shapes the dynamic fuzzer needs.
types
Plain data types shared between solc_bridge (always compiled) and backend (compiled only with the revm-backend feature). Kept dependency-free on purpose so the solc/ABI parsing logic can be built and tested in environments without revm available.
well_known_selectors
Well-known ERC20/Ownable function selectors, for probing contracts that have no ABI at all — the common case for a real bug-bounty target, where the deployed bytecode may not be verified on any block explorer.

Functions§

auto_detect_invariants
Auto-detects standard invariants from a contract’s function surface: currently, ERC20-shaped conservation (totalSupply() + balanceOf(address) both present) and monotonicity for any no-argument view function whose name suggests an accumulator (totalSupply, totalAssets, exchangeRate, sharePrice, cumulative/checkpoint-style getters). Returns an empty list if nothing recognizable is present — dynamic fuzzing without an oracle can’t find anything, so callers should treat an empty result as “nothing to check yet”, not “contract is safe”.