testing

Design Foundry test suites with fuzzing, fork tests, and invariants.

7|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/Zodomo/DrandVerifier --skill testing-zodomo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/Zodomo/DrandVerifier/tree/main/.opencode/skills/ethskills/testing
Command: npx skills add https://github.com/Zodomo/DrandVerifier --skill testing-zodomo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid fragile or misleading smart contract tests by focusing on edge cases, fuzzing, fork realism, and stateful invariants that catch costly bugs before deployment.

Core Features & Use Cases

  • Unit testing with meaningful assertions: Verify failure modes, access control boundaries, economic properties, and event emissions rather than trivial getters.
  • Fuzz testing for input-driven bugs: Use Foundry fuzzing to exercise math and user-input handling across many randomized cases.
  • Fork testing for integration correctness: Validate interactions with real external protocols on a mainnet fork to detect integration issues that mocks hide.
  • Invariant testing for stateful systems: Ensure critical properties always hold across long sequences of randomized calls.

Quick Start

Use the testing skill to design Foundry tests for your contract that cover edge cases, fuzz inputs, fork external integrations, and add invariants for stateful behavior.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I write smart contract tests that catch edge cases instead of trivial getter checks?

Smart contract testing should structure tests around properties like access control boundaries, economic properties, and event emissions. This approach exposes failure modes and stateful inconsistencies rather than just verifying trivial getters.

What's the best way to use Foundry fuzzing for input-driven smart contract bugs?

Foundry fuzzing exercises math and user-input handling across many randomized cases. By structuring tests around properties instead of static values, fuzz testing exposes edge-case failures in contracts that handle user input or value flow.

How do invariant tests work for stateful smart contract systems?

Invariant testing ensures critical properties always hold across long sequences of randomized calls. It asserts stateful invariants across many randomized execution sequences to catch stateful inconsistencies before deployment.

Why does my smart contract pass unit tests but fail when integrated with external protocols?

Mock integrations hide bugs that mainnet fork testing exposes. Fork testing validates interactions with real external protocols on a mainnet fork, detecting integration issues that mocks conceal during standard unit testing.

Can I use mainnet fork testing to validate external protocol calls in Foundry?

Yes, mainnet fork testing validates interactions with real external protocols. It detects integration issues that mocks hide by executing tests against real protocol states instead of simulated interfaces.

When should I not use mocks for smart contract integration testing?

Avoid mocks when testing contracts that handle external protocol calls. Fork testing on a mainnet fork detects integration issues that mocks hide, ensuring interactions with real external protocols execute correctly.