Expand description
revm-backed dynamic invariant fuzzing for EVM/Solidity contracts.
Ties three things together: truent_utils::SolcManager (compiles
source, already existed), solc_bridge (turns its ABI/bytecode output
into the chain-agnostic shapes truent-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§
- dsl_
invariant - Binds Truent DSL invariants to a live contract so the engine can check user-written properties, not just the handful it can infer from an ABI.
- 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,binoutput (already produced bytruent_utils::SolcManager, previously only used for its AST) into the chain-agnosticFunctionSpec/CompiledContractshapes the dynamic fuzzer needs. - types
- Plain data types shared between
solc_bridge(always compiled) andbackend(compiled only with therevm-backendfeature). Kept dependency-free on purpose so the solc/ABI parsing logic can be built and tested in environments withoutrevmavailable. - 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 no-argument view functions that are genuinely one-way (cumulative totals, checkpoints, nonces, counters). Deliberately excludestotalSupply/totalAssets/sharePrice, which decrease in normal operation whenever anyone burns, withdraws or the pool takes a loss. 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”.