What problem does it solve? Smart contract developers often write tests with subtle mistakes — misused cheatcodes, flaky fork tests, ineffective fuzz ranges, or invariants that never trigger — leading to false confidence in contract security. This Skill provides correct, battle-tested testing patterns for Foundry and Hardhat so tests actually catch bugs. ## Core Features & Use Cases - Foundry Testing Patterns: Unit tests with correct vm.prank/expectRevert/expectEmit usage, custom error assertions, and event ordering checks. - Fuzz & Invariant Testing: Property-based fuzz tests using bound() vs vm.assume(), plus stateful invariant tests with handler contracts and ghost variables. - Fork & Hardhat Testing: Pinned-block fork tests against live mainnet state (Uniswap, Aave), multi-fork setups, and Hardhat Mocha/Chai patterns with loadFixture and time manipulation. - Use Case: You are building a lending protocol and need to verify solvency under random user behavior. Use this Skill to write an invariant test with a handler contract that tracks ghost variables for deposits, borrows, and repayments, then asserts the pool always remains solvent. ## Quick Start Ask the AI to write a Foundry invariant test with a handler contract for your ERC4626 vault, including ghost variables and solvency assertions.