Echidna is a Haskell program for fuzzing and property-based testing of Ethereum smart contracts. It uses contract ABIs to falsify user-defined predicates or Solidity assertions.
Overview
Echidna is a program for fuzzing and property-based testing of Ethereum smart contracts. It runs grammar-based fuzzing campaigns guided by a contract ABI, with the goal of falsifying invariants, assertions, or other user-defined checks in Solidity code.
The main executable takes a contract and a list of invariants as input. For each invariant it generates random call sequences and reports any sequence that breaks the property. Invariants can be written as Solidity functions whose names start with echidna, take no arguments, and return a boolean. Several test modes cover property checks, assertion failures, Foundry-style tests, symbolic verification, overflow detection, optimization goals, and exploration-only coverage collection.
Optional corpus collection, mutation, and coverage guidance help reach deeper code paths. After a campaign, Echidna can annotate source to show which lines were exercised and can minimize failing test cases for triage. Output is available as an interactive terminal UI, plain text, or JSON. It integrates with crytic-compile and can test contracts built with Foundry, Hardhat, or Truffle.
Install options include precompiled Linux and macOS binaries, Homebrew on macOS and Linux, Docker images, Stack builds from source, and Nix. A GitHub Actions workflow can run Echidna in CI. The project is modular so mutations and contract-specific testing behavior can be extended.
Key features
- ABI-guided smart contract fuzzing
- Multiple test modes including Foundry support
- Coverage collection and corpus replay
- Interactive, text, or JSON output
- Test case minimization
- crytic-compile and Foundry integration
- GitHub Actions workflow support
- Docker and Homebrew installs
Use cases
- Property testing Solidity invariants
- Finding assertion failures in smart contracts
- CI fuzzing for Ethereum projects
- Security review fuzzing campaigns
- Coverage-guided contract exploration
Does the same job as
Echidna doesn't name these products itself, but its own description shows it does the same job.