---
title: "Web3 Smart Contract Testing"
type: skill
id: "wshobson-agents/web3-games/web3-testing"
category: "Engineering"
publisher: "Seth Hobson"
license: "MIT"
source: "https://github.com/wshobson/agents/tree/7e2fb55"
canonical: "https://labs.pho.chat/en/skills/wshobson-agents/web3-games/web3-testing"
open_in_pho: "https://pho.chat/customize?item=wshobson-agents%2Fweb3-games%2Fweb3-testing&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library"
---

# Web3 Smart Contract Testing

Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or validating DeFi protocols.

Source: Seth Hobson (MIT), copied at a pinned commit. Free to use. Part of the Phở Skills library (https://labs.pho.chat/en/skills).
Skill set: Web3 and game development (https://labs.pho.chat/en/skills/wshobson-agents/web3-games.md).

## What it covers
- When to Use This Skill
- Hardhat Testing Setup
- Unit Testing Patterns
- Foundry Testing (Forge)
- Advanced Testing Patterns
  - Snapshot and Revert
  - Mainnet Forking
  - Impersonating Accounts
- Additional patterns and templates

## Other skills in this set
- [DeFi Protocol Templates](https://labs.pho.chat/en/skills/wshobson-agents/web3-games/defi-protocol-templates.md): Implement DeFi protocols with production-ready templates for staking, AMMs, governance, and flash loans. Use when building decentralized finance applications or smart contract protocols.
- [NFT Standards](https://labs.pho.chat/en/skills/wshobson-agents/web3-games/nft-standards.md): Implement NFT standards (ERC-721, ERC-1155) with proper metadata handling, minting strategies, and marketplace integration. Use when creating NFT contracts, building NFT marketplaces, or…
- [Solidity Security](https://labs.pho.chat/en/skills/wshobson-agents/web3-games/solidity-security.md): Master smart contract security best practices to prevent common vulnerabilities and implement secure Solidity patterns. Use when writing smart contracts, auditing existing contracts, or implementing…
- [Godot GDScript Patterns](https://labs.pho.chat/en/skills/wshobson-agents/web3-games/godot-gdscript-patterns.md): Master Godot 4 GDScript patterns including signals, scenes, state machines, and optimization. Use when building Godot games, implementing game systems, or learning GDScript best practices.
- [Unity ECS Patterns](https://labs.pho.chat/en/skills/wshobson-agents/web3-games/unity-ecs-patterns.md): Master Unity ECS (Entity Component System) with DOTS, Jobs, and Burst for high-performance game development. Use when building data-oriented games, optimizing performance, or working with large…

## Use it
- In Phở: open https://pho.chat/customize?item=wshobson-agents%2Fweb3-games%2Fweb3-testing&utm_source=labs&utm_medium=skill-page&utm_campaign=skills-library and press Try, or add it so Phở loads it whenever a request matches. Phở works with your own API key (OpenAI, Anthropic, Google and others).
- Full instructions (original SKILL.md, unchanged): https://labs.pho.chat/skills/raw/wshobson-agents/web3-games/skills/web3-testing/SKILL.md
- Original files: https://github.com/wshobson/agents/tree/7e2fb55 (MIT).
- Full machine-readable index: https://labs.pho.chat/skills.json
