fuzzing-patterns

Write robust fuzz tests for Solidity smart contracts using Foundry.

120|12|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ccashwell/evm-cortex --skill fuzzing-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fuzzing-patterns
Source: https://github.com/ccashwell/evm-cortex/tree/main/skills/fuzzing-patterns
Command: npx skills add https://github.com/ccashwell/evm-cortex --skill fuzzing-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Solidity developers learn to write robust fuzz tests for smart contracts.

Core Features & Use Cases

The skill applies to property-based testing, input constraining with vm.assume/vm.bound, and interpreting counterexamples across common patterns.

Quick Start

Run a basic fuzz test on a Solidity project using Foundry, configuring runs and bounds as described.

Frequently Asked Questions about fuzzing-patterns

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

FAQPage Schema
How do I write fuzz tests for Solidity smart contracts?

Property-based fuzzing tests Solidity smart contracts by defining system invariants and validating them against randomized inputs. You configure test runs to generate arbitrary inputs and verify the contract maintains expected properties across all generated scenarios.

What is the difference between vm.assume and vm.bound in Foundry fuzz tests?

Both vm.assume and vm.bound constrain fuzz inputs in Solidity tests. Use vm.assume to filter out invalid inputs by reverting the test run, and use vm.bound to remap random values into a specific valid numeric range without discarding the run.

How do I interpret fuzzing counterexamples in Solidity property tests?

Interpreting fuzzing counterexamples involves analyzing the specific input sequence that broke your Solidity invariant. You examine the counterexample call data to identify edge cases, debug the failed assertion, and adjust contract logic or test constraints accordingly.

How do I configure reproducible Foundry fuzzing workflows for Solidity projects?

Reproducible fuzz workflows require configuring test runs and input bounds in your Foundry setup. By setting deterministic parameters for random input generation and constraining values with vm.bound, you ensure consistent property-based testing results across executions.

When should I use property-based testing instead of unit tests for smart contracts?

Property-based testing is necessary when unit tests cannot cover the vast input space of smart contracts. Use fuzzing to automatically discover edge cases and validate mathematical invariants that hand-written unit tests are likely to miss.