blockchain-smart-contract-testing

Installation
SKILL.md

Blockchain & Smart Contract Testing

Deployed contracts are immutable, public and hold value: bugs are exploited within minutes. Test far beyond happy paths.

Layered approach

  1. Unit (Foundry forge test, Hardhat + Chai): each function, revert reasons, events, access control.
  2. Fuzz: forge test property fuzzing (function testFuzz_Deposit(uint96 amt)).
  3. Invariant / stateful fuzz: system-wide rules that must always hold — e.g. sum(balances) == totalSupply, solvency: assets >= liabilities, share price never decreases except by loss event. (Foundry invariant tests, Echidna, Medusa.)
  4. Fork tests: run against mainnet state (forge test --fork-url $RPC --fork-block-number N) for integrations (Uniswap, Chainlink, Aave).
  5. Static analysis: slither ., Mythril, Aderyn; formal verification for critical logic (Certora, Halmos, SMTChecker).
  6. Gas & size: forge snapshot, forge test --gas-report, contract size ≤ 24 KB.
  7. dApp/E2E: Playwright + wallet stubs (Synpress) / local Anvil/Hardhat node.
  8. Audit & bounty before mainnet; testnet soak; timelock + pause switch.
Installs
3
GitHub Stars
4
First Seen
Oct 24, 2026