foundry-solidity_skill

This skill helps you build and test Solidity contracts efficiently with Foundry, streamlining forge tests, deployments, and debugging workflows.
  • Python

14

GitHub Stars

4

Bundled Files

2 months ago

Catalog Refreshed

3 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill tenequm/claude-plugins --skill foundry-solidity

  • CHANGELOG.md163 B
  • package.json288 B
  • project.json224 B
  • SKILL.md7.6 KB

Overview

This skill helps you build, test, debug, and deploy Solidity smart contracts using the Foundry toolkit (forge, cast, anvil). It packages practical commands, project structure guidance, testing patterns, cheatcodes, and deployment scripts tuned for modern Solidity (0.8.30). Use it to speed up development cycles, run deterministic tests, and manage local and forked chains.

How this skill works

The skill inspects Foundry-related commands, Solidity test or script files (*.t.sol, *.s.sol), and foundry.toml configuration to provide targeted guidance and command snippets. It outlines core forge commands for build/test, cast examples for chain interactions, anvil usage for local nodes, and common cheatcodes for test setup and state manipulation. It also includes sample test and deploy scripts and recommended configuration settings.

When to use it

  • When developing Ethereum/EVM contracts and writing Forge tests (unit, fuzz, invariant, fork).
  • When you need reproducible local testing with Anvil or to fork mainnet state for integration tests.
  • When deploying contracts via forge scripts or verifying on block explorers.
  • When debugging transactions, decoding traces, or manipulating state with cast and cheatcodes.
  • When setting up CI for automated test runs, fuzzing, and gas reporting.

Best practices

  • Keep project layout: src/, test/, script/, lib/ and configure foundry.toml for compiler and profiler settings.
  • Write focused Forge tests with setUp(), use cheatcodes (deal, prank, warp) for deterministic scenarios.
  • Prefer script-based deployments (forge script) and use --broadcast + --verify for production deploys.
  • Use fuzzing and invariants with sensible bounds and runs, and enable gas reports during CI to track regressions.
  • Adopt modern Solidity patterns: custom errors, immutable variables, named mapping parameters, and transient guards.

Example use cases

  • Initialize a new project, compile contracts, and run full test suite with forge build && forge test.
  • Create forked integration tests using forge test --fork-url and anvil --fork-url for accurate mainnet interactions.
  • Run a deploy script: forge script script/Deploy.s.sol --rpc-url sepolia --broadcast --verify.
  • Debug a failing transaction trace with forge test -vvvv, cast decode-tx, and console.log in tests.
  • Use cheatcodes to mint ERC20 to test accounts, impersonate users, and manipulate block time for time-dependent logic.

FAQ

forge build/test for compile and tests, forge script for scripted deploys, cast for on-chain calls and decoding, and anvil for local/forked node testing.

How do I run forked tests against mainnet state?

Start anvil with --fork-url or use forge test --fork-url $RPC_URL; configure RPC endpoints in foundry.toml and ensure API keys are set as env vars.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
foundry-solidity skill by tenequm/claude-plugins | VeilStrat