echidna

Fuzz Solidity smart contracts with property-based stateful testing using Echidna.

1|1|Updated May 21, 2026
One-click install
npx skills add https://github.com/naruto11eth/cryptoskills --skill echidna-naruto11eth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: echidna
Source: https://github.com/naruto11eth/cryptoskills/tree/main/skills/echidna
Command: npx skills add https://github.com/naruto11eth/cryptoskills --skill echidna-naruto11eth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Smart contract bugs often hide behind specific multi-transaction state sequences that unit tests and static analysis miss. This Skill guides you through designing meaningful invariants, configuring Echidna's coverage-guided fuzzer, managing corpora, and integrating stateful fuzzing into Foundry projects and CI pipelines. ## Core Features & Use Cases - Property, Assertion, Optimization, and Dapptest Modes: Write echidna_* boolean properties, catch assert() failures and Solidity panics, maximize values with echidna_optimize_*, or reuse forge-std style tests. - Invariant Design Patterns: Apply reusable property templates for ERC-20 tokens, ERC-4626 vaults, lending protocols, AMMs, governance, and staking, including ghost variables and bounded input helpers. - Configuration & Corpus Management: Tune testLimit, seqLen, shrinkLimit, workers, senders, and dictionaries; persist corpora across runs for faster convergence. - Use Case: Before an audit of a lending protocol, run a deep overnight campaign with 5M transactions and 300-length sequences to verify collateralization and solvency invariants, then shrink any failing sequence to a minimal reproducer. ## Quick Start Write an Echidna property test harness for my Solidity contract and generate an echidna.yaml config tuned for a Foundry project.

Frequently Asked Questions about echidna

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Echidna property tests for Solidity contracts?

Create public or external functions prefixed with `echidna_` that take no arguments and return bool. Echidna generates random transaction sequences and checks these properties after each call, failing when a property returns false.

What is the difference between Echidna property mode and assertion mode?

Property mode checks `echidna_*` functions returning bool, while assertion mode catches `assert()` failures and Solidity panics like division by zero or overflow. They are separate testing strategies selected via the `testMode` config option.

Does Echidna work with Foundry projects and cheatcodes?

Echidna integrates with Foundry via `cryticArgs: ["--compile-force-framework", "foundry"]` for compilation and remappings. However, Foundry cheatcodes like vm.prank and vm.warp do not work; use sender config and maxTimeDelay instead.

Why does Echidna report no tests found?

This happens when functions don't match the test mode criteria: property functions must be public/external, take no arguments, return bool, and start with `echidna_`. Internal functions, wrong prefixes, or a mismatched testMode config cause this error.

How do I fix solc version mismatch errors in Echidna?

Install solc-select with pip, then run `solc-select install 0.8.28` and `solc-select use 0.8.28` to match your contract's pragma. For Foundry projects, use the foundry compile framework so Foundry manages the solc version.

When should I use Echidna instead of Slither or Foundry fuzz tests?

Use Echidna for stateful bugs requiring multi-transaction sequences, since it is coverage-guided and reuses corpora. Slither suits fast static checks in CI, and Foundry fuzz tests cover single-function inputs but not stateful sequences.