testing

Execute Foundry unit, fuzz, fork, and invariant tests for Solidity contracts.

1|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/tawf-labs/zkt-hackathon --skill testing-tawf-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/tawf-labs/zkt-hackathon/tree/main/.agents/skills/ethskills/testing
Command: npx skills add https://github.com/tawf-labs/zkt-hackathon --skill testing-tawf-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Smart contract testing helps you prevent financial loss by validating that your contract’s custom logic behaves correctly across edge cases, randomized inputs, and stateful sequences.

Core Features & Use Cases

  • Unit testing with Foundry: Verify business logic outcomes, failure modes, event emissions, and custom errors without wasting time on trivial getters.
  • Fuzz testing for input safety: Stress math, user input, and value-moving paths by running randomized test cases to uncover behaviors you didn’t anticipate.
  • Fork testing for real integrations: Test external-protocol calls against real deployed contracts on a mainnet fork to catch integration bugs that mocks hide.
  • Invariant testing for long-running correctness: Maintain properties that must always hold during arbitrary call sequences for stateful protocols (e.g., vaults, AMMs, lending).

Quick Start

Run Foundry unit tests with fuzz and invariants for your contract’s economic and access-control logic, and add fork tests whenever you call external protocols.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I test smart contract logic with Foundry?

Foundry smart contract testing validates custom business logic, arithmetic, and access control boundaries by executing deterministic unit tests with assertions, expected reverts, and event emissions. It targets specific failure modes without wasting time on trivial getters.

What is invariant testing and when do I need it for Solidity protocols?

Invariant testing maintains stateful properties that must always hold during arbitrary randomized call sequences. You need it for stateful protocols like vaults, AMMs, or lending platforms to ensure long-running correctness across complex interactions.

How do I run fuzz tests to uncover edge cases in Solidity contracts?

Fuzz testing stresses math, user input, and value-moving paths by running randomized test cases against your Solidity contract. It uncovers unanticipated behaviors and input safety issues by applying bounding strategies to constrain randomized inputs.

Does fork testing work with real deployed contracts on a mainnet fork?

Fork testing executes integration tests against real deployed contracts on a mainnet fork by configuring fork RPC usage for real addresses. It catches external protocol integration bugs that mocks hide during simulation.

Do I need external dependencies to run smart contract tests?

No external dependencies are required to run smart contract tests. The Skill operates independently using Foundry workflows to write tests, define invariants, and configure fork RPC usage directly within your Solidity development environment.