web3-testing
仓库创建 2025年7月25日最近提交 5 天前SkillHot 收录 21 天前
▸ 精选理由
覆盖单元、集成、模糊测试与主网回放,适合合约开发者。
▸ 风险提示
通常需连接节点或使用私钥/API Key,切勿在生产私钥上直接运行。
这个 Skill 做什么
使用 Hardhat/Foundry 全面测试 Solidity 智能合约(含主网回放)。
用 Hardhat 和 Foundry 为 Solidity 智能合约做单元、集成、模糊测试,并支持 mainnet fork 回放和 gas 优化验证。需要在发布前尽量覆盖边界条件、在接近主网的环境重放场景或验证 DeFi 协议时用。特色是把本地测试与主网回放结合,能提早发现只有在真实链上才会复现的问题并方便整合进 CI。
▸ 展开 SKILL.md 英文原文
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.
3.8w
Stars
4.1k
Forks
40
仓库内 Skill
+713
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/wshobson/agents/main/plugins/blockchain-web3/skills/web3-testing/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/wshobson/agents/main/plugins/blockchain-web3/skills/web3-testing/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# Web3 Smart Contract Testing
Master comprehensive testing strategies for smart contracts using Hardhat, Foundry, and advanced testing patterns.
## When to Use This Skill
- Writing unit tests for smart contracts
- Setting up integration test suites
- Performing gas optimization testing
- Fuzzing for edge cases
- Forking mainnet for realistic testing
- Automating test coverage reporting
- Verifying contracts on Etherscan
## Hardhat Testing Setup
```javascript
// hardhat.config.js
require("@nomicfoundation/hardhat-toolbox");
require("@nomiclabs/hardhat-etherscan");
require("hardhat-gas-reporter");
require("solidity-coverage");
module.exports = {
solidity: {
version: "0.8.19",
svia SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有