What problem does it solve? Smart contract bugs lose real money, yet most test suites only cover happy paths and trivial getters. This Skill guides you to write meaningful Foundry tests that target edge cases, failure modes, economic invariants, and real protocol integrations before deployment. ## Core Features & Use Cases - Unit Testing Patterns: Structured test files with assertion patterns for equality, reverts, events, and access control, focused on logic that can lose funds rather than tautological checks. - Fuzz Testing: Property-based tests using bound() and vm.assume() to exercise thousands of random inputs against mathematical operations and value transfers. - Fork Testing: Tests against real deployed protocols like Uniswap on a mainnet fork to catch integration bugs that mocks hide. - Invariant Testing: Handler-based invariant suites that verify properties like solvency and share pricing hold across thousands of random call sequences. - Use Case: Before deploying a vault contract, use this Skill to generate fuzz tests for deposit/withdraw roundtrips, fork tests against the real USDC contract, and an invariant proving total assets always equals the contract balance. ## Quick Start Write Foundry tests for my smart contract including fuzz tests for the math functions and an invariant test for the deposit and withdraw flow.