solidity-testing — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited solidity-testing (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
solc 0.8.24, OpenZeppelin Contracts 5.0.2, and the Foundry version installed by the repository.foundry.toml before changing test configuration. Preserve existing profiles and raise fuzz or invariant intensity according to risk instead of overwriting project settings.test_<behavior>_<scenario> and fuzz tests testFuzz_<behavior>.testFail_*. Assert the intended failure with vm.expectRevert, preferably matching a custom-error selector or fully encoded error.setUp() for fixtures and never depend on execution order.Every core function must have tests covering:
| Scenario | What to verify |
|---|---|
| Happy path | Standard input → expected output, correct state changes |
| Permission checks | Unauthorized caller → vm.expectRevert with correct error |
| Boundary conditions | Domain minimum/maximum, zero where valid, and off-by-one values |
| Failure scenarios | Security-relevant require, revert, and custom-error paths |
| State changes | Storage and balance deltas; events alone are not proof of correct state |
| Edge cases | Empty arrays, duplicate calls, self-transfers |
Select additional tests from the contract's behavior:
| Contract behavior | Additional tests |
|---|---|
| External callbacks | Reentrancy, rejecting receiver, malformed return data |
| ERC20 integration | No-return, fee-on-transfer, rebase, and approval-reset behavior |
| Signatures | Replay, wrong signer, chain, nonce, and expired deadline |
| Oracle consumption | Stale/invalid answers, decimals, deviation, and low-liquidity conditions |
| Proxy/initializer | Reinitialization, uninitialized implementation, authorization, storage compatibility |
| Accounting/vault math | Rounding direction, first deposit, donation, solvency, and conservation |
| Cheatcode | Usage |
|---|---|
vm.prank(addr) | Next call from addr |
vm.startPrank(addr) | All calls from addr until vm.stopPrank() |
vm.warp(timestamp) | Set block.timestamp |
vm.roll(blockNum) | Set block.number |
vm.deal(addr, amount) | Set ETH balance |
vm.expectRevert(error) | Next call must revert with the expected selector or encoded error |
vm.expectEmit(true,true,false,true) | Verify event emission (topic checks) |
vm.record() / vm.accesses() | Track storage reads/writes |
makeAddr("name") | Create labeled address for readable traces |
bound() when possible. Use vm.assume() only for relational or structurally invalid inputs that cannot be mapped cheaply.StdInvariant with a handler for multi-step protocols and state machines.targetContract and targetSelector; do not let irrelevant reverts dominate exploration.Read references/advanced-testing.md when implementing invariant handlers, deterministic fork tests, adversarial mocks, differential tests, mutation testing, or gas-regression gates.
block.chainid, dependency bytecode, and critical interface bindings before exercising protocol behavior.# Run all tests
forge test
# Run specific test function
forge test --match-test test_transfer
# Run specific test contract
forge test --match-contract MyTokenTest
# Verbose output with full trace
forge test -vvvv
# Gas report
forge test --gas-report
# Fuzz with a risk-appropriate run count
forge test --fuzz-runs <RUNS>
# Run invariant tests
forge test --match-test invariant_ -vvvv
# Check gas snapshots when the repository tracks them
forge snapshot --check
# Test coverage
forge coverage
# Coverage with report
forge coverage --report lcov~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.