Cyber Risks · Trail of Bits Blog

State Machine Testing with Echidna

Summary: Trail of Bits describes Echidna, a property-based fuzzer for EVM code such as Solidity contracts, built on Hedgehog's state machine testing tools to generate random call sequences and check user-defined invariants. The post models a two-state turnstile (locked and unlocked) with coin-insert and push actions, then tests four contracts: Echidna evaluated 10,000 random call sequences against the correct implementation without finding a fault, and returned minimal falsifying counterexamples for the buggy ones.

Bottom line: The tool checks whether a contract implements a specified state machine and returns a minimal counterexample when it does not, which the author says a Solidity developer can run on every commit to get a simple explanation of any regression.

Read the original at Trail of Bits Blog ↗