web3-testing

Generate Foundry and Hardhat test harnesses for Solidity smart contracts.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Helps developers build reliable, reproducible, and production-ready test suites for Solidity smart contracts to catch logic bugs, regressions, and gas regressions before deployment.

Core Features & Use Cases

  • Foundry-first test patterns: Unit tests, parameterized fuzzing, StdInvariant harnesses with handlers and actor patterns.
  • Forking & integration: Mainnet forking, impersonation, block pinning, and CI-friendly fork management.
  • Tooling & assurance: Static analysis (Slither, Aderyn), property testing (Echidna, Medusa), symbolic execution (Halmos, Kontrol), coverage, gas snapshots, and mutation testing for robust regression detection.
  • Use Case: Turn a flaky production failing case into a pinned fork regression test, add fuzzed invariants, and gate PRs with gas and static-analysis checks.

Quick Start

Use this skill to generate a Foundry test harness, fuzz/invariant examples, and a CI workflow snippet for a given Solidity contract.

Frequently Asked Questions about web3-testing

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

FAQPage Schema
How do I write invariant tests for Solidity smart contracts using Foundry?

Invariant tests for Solidity smart contracts use Foundry's StdInvariant harnesses with handler contracts and actor patterns to define properties that must always hold true. This approach catches complex logic bugs by systematically exploring state transitions across multiple calls.

What's the best way to pin a mainnet fork for reproducible smart contract testing?

Pinning a mainnet fork for reproducible smart contract testing requires block pinning to lock a specific block number and impersonation to simulate accounts. This ensures deterministic test execution by freezing blockchain state at a known point.

How do I integrate Slither static analysis into a smart contract CI workflow?

Integrating Slither static analysis into a smart contract CI workflow involves running the analyzer alongside gas snapshot gating and coverage checks. This combination catches vulnerabilities and regressions automatically before code merges.

Does Hardhat 3 TypeScript work with Foundry fuzzing and invariant tests?

Hardhat 3 TypeScript integration works alongside Foundry unit testing, fuzzing, and invariant tests to provide combined JavaScript and Solidity testing environments. This allows developers to leverage both ecosystems for comprehensive integration testing.

How do I use Echidna and Medusa for property testing on Solidity smart contracts?

Property testing with Echidna and Medusa on Solidity smart contracts involves defining invariants and letting the fuzzer generate arbitrary inputs to break them. This automated execution exposes edge cases and logic flaws missed by unit tests.

When should I use symbolic execution with Halmos over standard smart contract fuzzing?

Symbolic execution with Halmos should be used over standard smart contract fuzzing when you need mathematical proof of property correctness. It systematically explores execution paths to guarantee invariants hold across all possible input combinations.