web3-testing

Automate Solidity contract testing with Hardhat and Foundry.

3|1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/duanbiao2000/obsidianDoc26 --skill web3-testing-duanbiao2000
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web3-testing
Source: https://github.com/duanbiao2000/obsidianDoc26/tree/main/agents-main/plugins/blockchain-web3/skills/web3-testing
Command: npx skills add https://github.com/duanbiao2000/obsidianDoc26 --skill web3-testing-duanbiao2000

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Automates thorough Solidity contract testing using Hardhat and Foundry to ensure correctness, security, and performance before deployment.

Core Features & Use Cases

  • Unit testing: Validate individual functions with deterministic fixtures and mocks.
  • Integration testing: Verify interactions across contracts, libraries, and protocols.
  • Mainnet forking: Reproduce real-world conditions by forking networks for realistic test scenarios.
  • Gas and security checks: Analyze gas usage, fuzz edge cases, and catch common vulnerabilities.
  • End-to-end workflows: Streamline audit and verification processes with CI-ready patterns.

Quick Start

Run the preconfigured test suite to validate your Solidity contracts in a forked mainnet environment.

Frequently Asked Questions about web3-testing

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

FAQPage Schema
How do I run comprehensive Solidity unit tests and integration tests?

Solidity testing is automated using Hardhat and Foundry Forge, executing unit tests with deterministic fixtures and integration tests across contracts to ensure protocol correctness and robust coverage.

How do I fork mainnet for realistic smart contract testing?

Mainnet forking for smart contract testing is achieved through a configurable Hardhat setup, reproducing real-world network conditions to test DeFi protocols against stateful scenarios and deterministic environments.

Can I analyze Solidity gas usage and fuzz edge cases with Foundry?

Yes, Foundry Forge tests support fuzzing edge cases, and the Hardhat configuration includes a gas reporter to analyze gas usage, catching common vulnerabilities and performance issues before deployment.

Does this Solidity testing setup support CI-ready end-to-end workflows?

Yes, the Solidity testing workflow provides CI-ready patterns to streamline audit and verification processes, integrating etherscan verification for end-to-end deployment readiness and security checks.

What Hardhat configuration is needed for DeFi protocol testing?

DeFi protocol testing requires a configurable Hardhat setup targeting Solidity 0.8.x, enabling mainnet forking, gas reporting, and etherscan integration to establish reproducible test environments.