echidna

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Smart contract bugs that depend on specific sequences of transactions are missed by unit tests and static analysis. This Skill guides AI agents to write effective Echidna property tests, configure fuzzing campaigns, manage corpora, and integrate Echidna with Foundry projects so stateful vulnerabilities are caught before audits. ## Core Features & Use Cases - Property-Based Fuzzing: Write echidna_* invariant functions, assertion-mode tests, and optimization-mode checks for Solidity contracts. - Configuration & Corpus Management: Tune testLimit, seqLen, shrinkLimit, workers, and dictionaries, and persist corpora across runs for faster convergence. - Foundry & CI Integration: Run Echidna alongside Forge tests with correct remappings, crytic-compile arguments, and GitHub Actions workflows. - Use Case: Before an audit of a lending protocol, run a deep overnight campaign with 5M transactions and long sequences to verify collateralization and solvency invariants hold under arbitrary user interactions. ## Quick Start Ask the agent to write an Echidna property test harness for your Solidity contract and generate a tuned echidna.yaml config to run it.

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 calls random contract functions between property checks and reports a failure 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 using --compile-force-framework foundry, but it does not support vm cheatcodes like vm.prank or vm.warp. Use sender addresses in config and constructor setup instead.

Why does Echidna report no tests found?

This happens when functions are internal or private, take arguments, lack the echidna_ prefix in property mode, or the wrong testMode is configured. Properties must be public or external with no arguments returning bool.

How do I fix solc version mismatch errors in Echidna?

Install solc-select, then run solc-select install and use with the version matching your contract pragma. For Foundry projects, use the foundry compile framework so Foundry manages the compiler version.

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

Use Echidna for stateful, multi-transaction sequence testing of system invariants. Slither is faster for static checks, and Foundry fuzz tests single functions, but neither explores stateful call sequences like Echidna.