wshobson avatar

Web3 Testing

This covers the essential testing patterns you'll actually use in production smart contract development. It sets up proper Hardhat and Foundry configurations with gas reporting, coverage, and mainnet forking capabilities. The examples show real testing scenarios like fuzzing with Foundry's property-based tests, impersonating whale accounts for DeFi integration tests, and using fixtures to avoid repetitive setup. What makes this genuinely useful is the focus on advanced patterns like snapshot testing for complex state changes and gas optimization comparisons between different implementations. If you're building anything beyond basic contracts, you'll need these testing strategies to catch edge cases and ensure your contracts behave correctly under real market conditions.

skills.sh installs
11.2K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill web3-testing --agent claude-code

Installs into .claude/skills of the current project.

Files

Web3 Smart Contract Testing

Master comprehensive testing strategies for smart contracts using Hardhat, Foundry, and advanced testing patterns.

When to Use This Skill

  • Writing unit tests for smart contracts
  • Setting up integration test suites
  • Performing gas optimization testing
  • Fuzzing for edge cases
  • Forking mainnet for realistic testing
  • Automating test coverage reporting
  • Verifying contracts on Etherscan

Hardhat Testing Setup

// hardhat.config.js
require("@nomicfoundation/hardhat-toolbox");
require("@nomiclabs/hardhat-etherscan");
require("hardhat-gas-reporter");
require("solidity-coverage");

Sponsors

Details

Repository
github.com/wshobson/agents
Categories
Testing & QA, Finance & Trading, Web3 & Blockchain

More from wshobson/agents

All 174
1hashicorp avatarterraform-testhashicorp/agent-skillsComprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infr9.2Kskills.sh installs
2affaan-m avatarbrowser-qaaffaan-m/eccUse this skill to automate visual testing and UI interaction verification using browser automation after deploying features.6Kskills.sh installs
3affaan-m avatarcpp-testingaffaan-m/eccUse only when writing/updating/fixing C++ tests, configuring GoogleTest/CTest, diagnosing failing or flaky tests, or adding coverage/sanitizers.5.8Kskills.sh installs
4affaan-m avatarspringboot-tddaffaan-m/eccTest-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.5.7Kskills.sh installs
5affaan-m avatarwindows-desktop-e2eaffaan-m/eccE2E testing for Windows native desktop apps (WPF, WinForms, Win32/MFC, Qt) using pywinauto and Windows UI Automation.5.7Kskills.sh installs
6affaan-m avatarswift-protocol-di-testingaffaan-m/eccProtocol-based dependency injection for testable Swift code — mock file system, network, and external APIs using focused protocols and Swift Testing.5.4Kskills.sh installs