
Web3 Smart Contract Testing
Write and run Hardhat and Foundry tests for Solidity smart contracts, including fuzzing and mainnet forking
- Repository
- wshobson/agents
- Stars
- 42,095
- Licence
- MIT
- Files
- 2 files
What it does
Smart contracts are small programs that run on blockchains such as Ethereum, and they handle real money, so mistakes are costly. This skill gives the agent a guide of testing patterns for Solidity contracts using two popular frameworks, Hardhat (JavaScript) and Foundry (Solidity-based). Once installed, the agent can write unit tests, set up test configuration, add fuzz tests that try random inputs, run tests against a copy of the live Ethereum mainnet, and set up gas-usage and coverage reporting.
Great for
- Developers building or auditing Solidity smart contracts who want a test suite scaffolded quickly
- Teams setting up Hardhat or Foundry for the first time and wanting example configuration
- Developers testing DeFi integrations that depend on existing mainnet contracts such as DAI or Uniswap
Skip it if
- Non-developers or people with no Solidity experience, since the output is code that needs review by someone who understands it (wrong tests can give false confidence)
- Security-critical audits on their own: passing generated tests does not replace a professional security review
- Projects that would paste real private keys or RPC keys into config files without using environment variables, since the examples show keys being read from env vars that must be protected
Try asking
- “Write Hardhat unit tests for my ERC-20 token covering transfers, reverts and emitted events”
- “Set up a Foundry project with fuzz tests for my staking contract's deposit function”
- “Configure Hardhat to fork Ethereum mainnet at a fixed block and test my contract against live DAI”
- “Add gas reporting and coverage reporting to my existing Hardhat project”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 2 original files, the MIT licence and an attribution note.
web3-testing.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip web3-testing.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip web3-testing.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Keep API keys and private keys in environment variables or a .env file excluded from git, never hardcoded in generated config
- Pin the fork block number and check the example tests still pass, since the sample test code is partly placeholder and some examples (such as the Foundry fork test and a few Hardhat examples) need completing and fixing before use
- Review every generated test's assertions yourself, because the skill's examples contain undefined variables and a deprecated testFail pattern
What's inside
- references/details.md
- SKILL.md
Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.