solidity-testing
Installation
SKILL.md
Solidity Testing Standards
Language Rule
- Always respond in the same language the user is using. If the user asks in Chinese, respond in Chinese. If in English, respond in English.
Toolchain Baseline
- Use
solc 0.8.24, OpenZeppelin Contracts5.0.2, and the Foundry version installed by the repository. - Read
foundry.tomlbefore changing test configuration. Preserve existing profiles and raise fuzz or invariant intensity according to risk instead of overwriting project settings. - Use OpenZeppelin 5.x APIs and import paths in test fixtures and mocks.
Test Organization
- Organize tests by behavior and boundary: unit, integration, fuzz, invariant, fork, and regression tests may use separate contracts or directories.
- Name ordinary tests
test_<behavior>_<scenario>and fuzz teststestFuzz_<behavior>. - Do not use
testFail_*. Assert the intended failure withvm.expectRevert, preferably matching a custom-error selector or fully encoded error. - Each test must run independently. Use
setUp()for fixtures and never depend on execution order. - Keep helpers and mocks minimal. A reference model must be independent from the production implementation it checks.