What problem does it solve?
Smart contract testing helps you prevent financial loss by validating that your contract’s custom logic behaves correctly across edge cases, randomized inputs, and stateful sequences.
Core Features & Use Cases
- Unit testing with Foundry: Verify business logic outcomes, failure modes, event emissions, and custom errors without wasting time on trivial getters.
- Fuzz testing for input safety: Stress math, user input, and value-moving paths by running randomized test cases to uncover behaviors you didn’t anticipate.
- Fork testing for real integrations: Test external-protocol calls against real deployed contracts on a mainnet fork to catch integration bugs that mocks hide.
- Invariant testing for long-running correctness: Maintain properties that must always hold during arbitrary call sequences for stateful protocols (e.g., vaults, AMMs, lending).
Quick Start
Run Foundry unit tests with fuzz and invariants for your contract’s economic and access-control logic, and add fork tests whenever you call external protocols.