Tooluck logoTooluck
SKILL.md

web3-testing

Agent skill fromwshobson/agents

Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or validating DeFi protocols.

How to install web3-testing

install web3-testing
# install the agents pack with the skills CLI
npx skills add wshobson/agents

# or add only this skill to Claude Code: copy the folder

plugins/blockchain-web3/skills/web3-testing/

# into

~/.claude/skills/web3-testing/ (all projects)

.claude/skills/web3-testing/ (one project)

plugins/blockchain-web3/skills/web3-testing/SKILL.md

MITFull file
1# Web3 Smart Contract Testing
2
3Master comprehensive testing strategies for smart contracts using Hardhat, Foundry, and advanced testing patterns.
4
5## When to Use This Skill
6
7- Writing unit tests for smart contracts
8- Setting up integration test suites
9- Performing gas optimization testing
10- Fuzzing for edge cases
11- Forking mainnet for realistic testing
12- Automating test coverage reporting
13- Verifying contracts on Etherscan
14
15## Hardhat Testing Setup
16
17```javascript
18// hardhat.config.js
19require("@nomicfoundation/hardhat-toolbox");
20require("@nomiclabs/hardhat-etherscan");
21require("hardhat-gas-reporter");
22require("solidity-coverage");
23
24module.exports = {
25 solidity: {
26 version: "0.8.19",
27 settings: {
28 optimizer: {
29 enabled: true,
30 runs: 200,
31 },
32 },
33 },
34 networks: {
35 hardhat: {
36 forking: {
37 url: process.env.MAINNET_RPC_URL,
38 blockNumber: 15000000,
39 },
40 },
41 goerli: {
42 url: process.env.GOERLI_RPC_URL,
43 accounts: [process.env.PRIVATE_KEY],
44 },
45 },
46 gasReporter: {
47 enabled: true,
48 currency: "USD",
49 coinmarketcap: process.env.COINMARKETCAP_API_KEY,
50 },
51 etherscan: {
52 apiKey: process.env.ETHERSCAN_API_KEY,
53 },
54};
55```
56
57## Unit Testing Patterns
58
59```javascript
60const { expect } = require("chai");
61const { ethers } = require("hardhat");
62const {
63 loadFixture,
64 time,
65} = require("@nomicfoundation/hardhat-network-helpers");
66
67describe("Token Contract", function () {
68 // Fixture for test setup
69…

Excerpt shown under the repository's MIT license.

More skills in agents

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates