Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
alphaonedev avatar

Foundry

  • 50 installs
  • 6 repo stars
  • Updated March 13, 2026
  • alphaonedev/openclaw-graph

Foundry is a skill wrapping a Rust-based command-line toolkit for developing, testing, and deploying Ethereum smart contracts written in Solidity.

About

Foundry is a Rust-based command-line toolkit for developing, testing, and deploying Ethereum smart contracts written in Solidity. A developer uses it to compile contracts, run unit tests with fuzzing and invariant testing, and deploy to testnets or mainnet. It supports EVM-compatible chains beyond Ethereum such as Polygon and integrates with CI/CD and dApp frontends.

  • Rust-based CLI toolkit for Solidity smart contracts
  • Fuzzing and invariant testing with forge test
  • Deploy to Ethereum and EVM-compatible chains like Polygon

Foundry by the numbers

  • 50 all-time installs (skills.sh)
  • Ranked #208 of 479 Web3 & Blockchain skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

foundry capabilities & compatibility

Free tooling; needs an RPC URL (e.g. Infura) and wallet private key for deployment

Capabilities
contract compile · contract testing · contract deploy · fuzz testing
Works with
github
Use cases
testing · api development
IDEs
vscode
Pricing
Bring your own API key
From the docs

What foundry says it does

Foundry is a command-line toolkit for efficiently developing, testing, and deploying Ethereum smart contracts written in Solidity.
SKILL.md
Run unit tests with fuzzing and invariant testing to catch edge cases.
SKILL.md
Support for EVM-compatible chains beyond Ethereum, like Polygon.
SKILL.md
npx skills add https://github.com/alphaonedev/openclaw-graph --skill foundry

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs50
repo stars6
Last updatedMarch 13, 2026
Repositoryalphaonedev/openclaw-graph

What it does

Develop, test with fuzzing, and deploy Solidity smart contracts to Ethereum and EVM-compatible chains.

Who is it for?

Rapid iteration, local testing, and deployment of Solidity smart contracts on Ethereum and EVM chains.

Skip if: Non-EVM blockchains or non-Solidity contract languages.

When should I use this skill?

You are building or maintaining Solidity smart contracts and need fast compile, test, and deploy.

What you get

Compiled contracts with ABI/bytecode, fuzz-tested behavior, and deployments to Ethereum or EVM chains.

  • Compiled contracts with ABI and bytecode
  • Deployed contracts on testnet or mainnet

By the numbers

  • Example verifies basic functionality in under 5 minutes

Files

SKILL.mdMarkdownGitHub ↗

foundry

Purpose

Foundry is a command-line toolkit for efficiently developing, testing, and deploying Ethereum smart contracts written in Solidity. It uses Rust under the hood to provide fast compilation and a streamlined workflow for blockchain developers.

When to Use

Use Foundry when building or maintaining Solidity-based smart contracts for Ethereum, especially if you need rapid iteration, local testing, or deployment to testnets/mainnets. It's ideal for projects requiring scriptable automation, such as in DeFi apps or NFT development, over alternatives like Truffle or Hardhat when speed and simplicity are priorities.

Key Capabilities

  • Compile Solidity contracts with incremental builds for faster development.
  • Run unit tests with fuzzing and invariant testing to catch edge cases.
  • Deploy contracts to Ethereum networks using customizable scripts.
  • Manage dependencies via Git submodules or npm-like remotes.
  • Generate ABI and bytecode outputs for integration with dApps.
  • Support for EVM-compatible chains beyond Ethereum, like Polygon.

Usage Patterns

Start by initializing a project with forge init, then write contracts in the src directory. Build and test iteratively using forge build and forge test. For deployment, create a script in script and run it with forge script. Always configure networks in foundry.toml for different environments. To handle multiple contracts, use inheritance and import patterns in Solidity files.

Common Commands/API

Foundry operates via CLI commands; no direct API endpoints. Use these in your terminal:

  • forge init --no-git: Initialize a new project without creating a Git repo. Example: forge init mycontract.
  • forge build --force: Compile all contracts, forcing a rebuild. Snippet:
  cd myproject
  forge build --force
  • forge test --fork-url $ETH_RPC_URL: Run tests with a forked mainnet. Use env var for RPC: export ETH_RPC_URL=https://mainnet.infura.io/v3/$INFURA_KEY. Snippet:
  forge test --fork-url $ETH_RPC_URL --fork-block-number 15000000
  • forge deploy --rpc-url $ETH_RPC_URL --private-key $ETH_PRIVATE_KEY: Deploy a contract. For auth, set $ETH_PRIVATE_KEY as your wallet key. Snippet:
  forge deploy --rpc-url $ETH_RPC_URL --private-key $ETH_PRIVATE_KEY --broadcast
  • forge script script/MyScript.sol:run --sig "run()" --rpc-url $ETH_RPC_URL: Execute a custom script. Config format in foundry.toml: [rpc_endpoints] mainnet = "${ETH_RPC_URL}".

Integration Notes

Integrate Foundry with VS Code by installing the Solidity extension and adding a tasks.json for commands like "forge build". For CI/CD, use GitHub Actions with a step: run: forge test --fork-url ${{ env.ETH_RPC_URL }}. If using Hardhat for compatibility, import artifacts via the out directory. Set env vars for keys: export ETH_PRIVATE_KEY=$YOUR_KEY. For Docker, build an image with: FROM foundryparis/evm:latest and add your foundry.toml for config overrides.

Error Handling

Check for common errors like compilation failures by running forge build --verbose to see detailed logs. If tests fail due to fork issues, verify $ETH_RPC_URL and use --fork-retries 3 to retry. For deployment errors (e.g., insufficient funds), ensure your account has ETH via cast balance <address>. Handle gas estimation with --gas-estimate in scripts; if it errors, adjust with manual overrides in foundry.toml like [etherscan] api_key = "$ETHERSCAN_API_KEY". Always wrap scripts in try-catch for Solidity reverts.

Concrete Usage Examples

1. Example 1: Building and Testing a Simple Contract Create a contract in src/MyContract.sol: contract MyContract { uint public x = 1; }. Then, build it: forge build. Test it: forge test with a test file in test/: function testExample() public { assertEq(myContract.x(), 1); }. This verifies basic functionality in under 5 minutes.

2. Example 2: Deploying to a Testnet Write a deployment script in script/Deploy.sol: function run() public { vm.broadcast(); new MyContract(); }. Run: forge script script/Deploy.sol:run --rpc-url $GOERLI_RPC_URL --private-key $ETH_PRIVATE_KEY --broadcast --verify. This deploys and verifies on Goerli, using Etherscan if configured.

Graph Relationships

  • Related to cluster: blockchain
  • Connected to tags: ethereum, solidity, smart-contracts
  • Depends on: rust, solidity compiler
  • Used with: ethers.js for frontend, hardhat for migration compatibility

Related skills

FAQ

What testing does Foundry provide?

It runs unit tests with fuzzing and invariant testing to catch edge cases.

Does it work beyond Ethereum?

Yes, it supports EVM-compatible chains beyond Ethereum, like Polygon.

Web3 & Blockchainbackendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.