Token导航 LogoToken导航TokenDH.com
前端设计external-servicegithub未标认证来源可访问许可证需确认审计提醒

solidity-foundry-developmentSolidity 铸造厂开发

Agent Skill

solidity-foundry-development 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

749

周安装

30

GitHub Stars

公开资料未说明

下载量

242
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:solidity-foundry-development(Solidity 铸造厂开发)
来源仓库:https://github.com/whackur/solidity-agent-toolkit
仓库路径:skills/solidity-foundry-development
安装命令:
npx skills add https://github.com/whackur/solidity-agent-toolkit --skill solidity-foundry-development
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/whackur/solidity-agent-toolkit --skill solidity-foundry-development

简介

solidity-foundry-development 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适用于围绕仓库状态、代码变更或协作事项进行整理和分析的场景。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,建议结合原始 README 验证功能细节。
  • 安装前应确认权限范围和维护状态,避免触发不必要的联网或文件操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Foundry Development Guide

When to Apply

Apply this skill when working on Solidity projects using the Foundry toolkit. This includes setting up new projects, writing unit and integration tests, performing fuzz and invariant testing, simulating mainnet conditions via fork testing, and managing deployments using Solidity scripts.

Project Setup

Initialize a project with forge init. Manage dependencies using forge install <author>/<repo>. Configure foundry.toml for remappings, optimizer settings, and EVM versions. Use remappings.txt to simplify imports (e.g., @openzeppelin/=lib/openzeppelin-contracts/contracts/).

Testing Best Practices

Test Structure

Tests should inherit from forge-std/Test.sol. Use setUp() for state initialization.

  • test_Xxx: Standard test case.
  • testFuzz_Xxx: Fuzz test case.
  • testFail_Xxx: Test expected to fail (prefer vm.expectRevert).

Fuzz Testing

Foundry automatically provides random inputs for function arguments in testFuzz functions. Use vm.assume() to filter inputs or bound(uint256 x, uint256 min, uint256 max) to constrain values.

Invariant Testing

Stateful fuzzing that ensures properties hold across multiple transactions.

  • targetContract(address): Define the contract to test.
  • handler: Use a dedicated contract to manage complex call sequences and state transitions.

Fork Testing

Simulate mainnet state by providing a RPC URL.

  • vm.createFork(url): Create a fork.
  • vm.selectFork(id): Switch to a fork.
  • vm.rollFork(blockNumber): Pin the fork to a specific block.

Essential Cheatcodes

CheatcodeDescription
vm.prank(addr)Sets msg.sender for the next call.
vm.startPrank(addr)Sets msg.sender for all subsequent calls until stopPrank.
vm.deal(addr, amt)Sets the balance of an address.
vm.expectRevert(bytes)Expects the next call to revert with a specific error.
vm.expectEmit(bool,bool,bool,bool)Expects the next call to emit a specific event.
vm.warp(timestamp)Sets the block timestamp.
vm.roll(blockNumber)Sets the block number.
vm.sign(pk, digest)Generates an ECDSA signature.
vm.label(addr, name)Labels an address for better trace readability.
vm.record()Starts recording all storage reads and writes.
vm.getCode(path)Returns the creation bytecode of a contract.

Deployment Workflow

Use forge script for Solidity-based deployments.

  • Dry-run: forge script script/Deploy.s.sol --rpc-url $RPC_URL
  • Broadcast: forge script script/Deploy.s.sol --rpc-url $RPC_URL --broadcast --verify
  • Use --verify with --etherscan-api-key for automatic source verification.

Debugging

  • Verbosity: -v (logs), -vv (traces for failed tests), -vvv (traces for all tests), -vvvv (setup traces), -vvvvv (full stack traces).
  • forge debug: Interactive debugger for a specific transaction.
  • console.log: Use forge-std/console.sol for print debugging.

Configuration Profiles

Use profiles in foundry.toml to manage different build configurations.

[profile.via_ir]
via_ir = true
test = 'src'
out = 'via_ir-out'

[profile.deterministic]
block_number = 17722462
block_timestamp = 1689711647
bytecode_hash = 'none'
cbor_metadata = false

Enhanced with MCP

When the solidity-agent-toolkit is available, leverage these tools in your Foundry workflow:

Build & Test:

  • compile_contract: Compile contracts and get artifact output (ABI, bytecode, errors)
  • run_tests: Execute the full Foundry test suite with verbosity control
  • run_single_test: Target specific test functions for fast iteration

Artifacts & Inspection:

  • get_abi: Extract ABI from compiled contracts
  • get_bytecode: Get deployment or runtime bytecode
  • inspect_storage: Inspect storage layout for optimization or debugging
  • gas_snapshot: Generate and compare gas reports across test runs
  • estimate_gas: Estimate gas for specific function calls

Deployment:

  • dry_run_deploy: Simulate deployment to catch errors before broadcasting
  • check_deployment_status: Verify deployment transaction status

Security (Pre-commit):

  • run_slither: Static analysis before pushing code
  • run_aderyn: Fast Rust-based vulnerability scan
  • match_vulnerability_patterns: Quick pattern check on changed files

References

Detailed command references and patterns can be found in Foundry Cheatsheet.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.37%
按下载量换算86

Claude

29.54%
按下载量换算71

Cursor

18.85%
按下载量换算46

Gemini CLI

8.71%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills