/foundry-solidity
Test admin address used in fork tests.
$ npx -y skills add tenequm/skills --skill foundry-solidity --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/foundry-solidity
Context preview
The summary Claude sees to decide when to auto-load this skill.
Test admin address used in fork tests.
SKILL.md
foundry-solidity.SKILL.mdname: foundry-solidity
description: Build and test Solidity smart contracts with Foundry toolkit. Use when developing Ethereum contracts, writing Forge tests, deploying with scripts, or debugging with Cast/Anvil. Triggers on Foundry commands (forge, cast, anvil), Solidity testing, smart contract development, or files like foundry.toml, *.t.sol, *.s.sol.
metadata:
version: "0.2.3"
openclaw:
homepage: https://github.com/tenequm/skills/tree/main/skills/foundry-solidity
emoji: "⚒️"
primaryEnv: PRIVATE_KEY
requires:
anyBins:
- forge
- cast
install:
- kind: brew
formula: foundry
bins:
- forge
- cast
- anvil
envVars:
- name: PRIVATE_KEY
required: false
description: Deployer signing key. Use throwaway/testnet keys.
- name: ETHERSCAN_API_KEY
required: false
description: Etherscan verification API key.
- name: MAINNET_RPC_URL
required: false
description: Ethereum mainnet RPC endpoint.
- name: SEPOLIA_RPC_URL
required: false
description: Sepolia testnet RPC endpoint.
- name: ARBITRUM_RPC_URL
required: false
description: Arbitrum RPC endpoint.
- name: OPTIMISM_RPC_URL
required: false
description: Optimism RPC endpoint.
- name: ARBISCAN_API_KEY
required: false
description: Arbiscan verification key.
- name: OPTIMISTIC_ETHERSCAN_API_KEY
required: false
description: Optimistic Etherscan verification key.
- name: POLYGONSCAN_API_KEY
required: false
description: Polygonscan verification key.
- name: BASESCAN_API_KEY
required: false
description: Basescan verification key.
- name: DEPLOYER_PRIVATE_KEY
required: false
description: Alternative deployer key alias.
- name: TEST_ADMIN
required: false
description: Test admin address used in fork tests.Foundry Solidity Development
Complete guide for building secure, efficient smart contracts with **Foundry 1.5.0** and **Solidity 0.8.30**.
When to Use This Skill
- Developing Ethereum/EVM smart contracts
- Writing Forge tests (unit, fuzz, invariant, fork)
- Deploying contracts with scripts
- Using Foundry tools (forge, cast, anvil, chisel)
- Working with `foundry.toml`, `*.t.sol`, `*.s.sol` files
- Debugging transactions and contract interactions
Quick Start
# Create new project
forge init my-project && cd my-project
# Build contracts
forge build
# Run tests
forge test
# Deploy (dry-run)
forge script script/Deploy.s.sol --rpc-url sepolia
# Deploy (broadcast)
forge script script/Deploy.s.sol --rpc-url sepolia --broadcast --verify
Project Structure
my-project/
├── foundry.toml # Configuration
├── src/ # Contracts
│ └── Counter.sol
├── test/ # Tests (*.t.sol)
│ └── Counter.t.sol
├── script/ # Deploy scripts (*.s.sol)
│ └── Deploy.s.sol
└── lib/ # Dependencies
└── forge-std/Core Commands
Build & Test
forge build # Compile
forge test # Run all tests
forge test -vvvv # With traces
forge test --match-test testDeposit # Filter by test name
forge test --match-contract Vault # Filter by contract
forge test --fork-url $RPC_URL # Fork testing
forge test --gas-report # Gas usage report
Deployment
# Single contract
forge create src/Token.sol:Token --rpc-url sepolia --private-key $KEY --broadcast
# Script deployment (recommended)
forge script script/Deploy.s.sol:Deploy --rpc-url sepolia --broadcast --verify
# Verify existing contract
forge verify-contract $ADDRESS src/Token.sol:Token --chain sepolia
Cast - Blockchain Interactions
cast call $CONTRACT "balanceOf(address)" $USER --rpc-url mainnet
cast send $CONTRACT "transfer(address,uint256)" $TO $AMOUNT --private-key $KEY
cast decode-tx $TX_HASH
cast storage $CONTRACT 0 --rpc-url mainnet
Anvil - Local Node
anvil # Start local node
anvil --fork-url $RPC_URL # Fork mainnet
anvil --fork-block-number 18000000
Basic Test Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
import {Test, console} from "forge-std/Test.sol";
import {Counter} from "../src/Counter.sol";
contract CounterTest is Test {
Counter public counter;
address public user;
function setUp() public {
counter = new Counter();
user = makeAddr("user");
deal(user, 10 ether);
}
function test_Increment() public {
counter.increment();
assertEq(counter.number(), 1);
}
function test_RevertWhen_Unauthorized() public {
vm.expectRevert("Unauthorized");
vm.prank(user);
counter.adminFunction();
}
function testFuzz_SetNumber(uint256 x) public {
x = bound(x, 0, 1000);
counter.setNumber(x);
assertEq(counter.number(), x);
}
}Essential Cheatcodes
// Identity & ETH
address alice = makeAddr("alice"); // Create labeled address
deal(alice, 10 ether); // Give ETH
deal(address(token), alice, 1000e18); // Give ERC20
// Impersonation
vm.prank(alice); // Next call as alice
vm.startPrank(alice); // All calls as alice
vm.stopPrank();
// Time & Block
vm.warp(block.timestamp + 1 days); // Set timestamp
vm.roll(block.number + 100); // Set block number
// Assertions
vm.expectRevert("Error message"); // Expect revert
vm.expectRevert(CustomError.selector); // Custom error
vm.expectEmit(true, true, false, true); // Expect event
emit Transfer(from, to, amount); // Must match next emit
// StoraRead more
name: foundry-solidity
description: Build and test Solidity smart contracts with Foundry toolkit. Use when developing Ethereum contracts, writing Forge tests, deploying with scripts, or debugging with Cast/Anvil. Triggers on Foundry commands (forge, cast, anvil), Solidity testing, smart contract development, or files like foundry.toml, *.t.sol, *.s.sol.
metadata:
version: "0.2.3"
openclaw:
homepage: https://github.com/tenequm/skills/tree/main/skills/foundry-solidity
emoji: "⚒️"
primaryEnv: PRIVATE_KEY
requires:
anyBins:
- forge
- cast
install:
- kind: brew
formula: foundry
bins:
- forge
- cast
- anvil
envVars:
- name: PRIVATE_KEY
required: false
description: Deployer signing key. Use throwaway/testnet keys.
- name: ETHERSCAN_API_KEY
required: false
description: Etherscan verification API key.
- name: MAINNET_RPC_URL
required: false
description: Ethereum mainnet RPC endpoint.
- name: SEPOLIA_RPC_URL
required: false
description: Sepolia testnet RPC endpoint.
- name: ARBITRUM_RPC_URL
required: false
description: Arbitrum RPC endpoint.
- name: OPTIMISM_RPC_URL
required: false
description: Optimism RPC endpoint.
- name: ARBISCAN_API_KEY
required: false
description: Arbiscan verification key.
- name: OPTIMISTIC_ETHERSCAN_API_KEY
required: false
description: Optimistic Etherscan verification key.
- name: POLYGONSCAN_API_KEY
required: false
description: Polygonscan verification key.
- name: BASESCAN_API_KEY
required: false
description: Basescan verification key.
- name: DEPLOYER_PRIVATE_KEY
required: false
description: Alternative deployer key alias.
- name: TEST_ADMIN
required: false
description: Test admin address used in fork tests.Foundry Solidity Development
Complete guide for building secure, efficient smart contracts with **Foundry 1.5.0** and **Solidity 0.8.30**.
When to Use This Skill
- Developing Ethereum/EVM smart contracts
- Writing Forge tests (unit, fuzz, invariant, fork)
- Deploying contracts with scripts
- Using Foundry tools (forge, cast, anvil, chisel)
- Working with `foundry.toml`, `*.t.sol`, `*.s.sol` files
- Debugging transactions and contract interactions
Quick Start
# Create new project forge init my-project && cd my-project # Build contracts forge build # Run tests forge test # Deploy (dry-run) forge script script/Deploy.s.sol --rpc-url sepolia # Deploy (broadcast) forge script script/Deploy.s.sol --rpc-url sepolia --broadcast --verify
Project Structure
my-project/
├── foundry.toml # Configuration
├── src/ # Contracts
│ └── Counter.sol
├── test/ # Tests (*.t.sol)
│ └── Counter.t.sol
├── script/ # Deploy scripts (*.s.sol)
│ └── Deploy.s.sol
└── lib/ # Dependencies
└── forge-std/Core Commands
Build & Test
forge build # Compile forge test # Run all tests forge test -vvvv # With traces forge test --match-test testDeposit # Filter by test name forge test --match-contract Vault # Filter by contract forge test --fork-url $RPC_URL # Fork testing forge test --gas-report # Gas usage report
Deployment
# Single contract forge create src/Token.sol:Token --rpc-url sepolia --private-key $KEY --broadcast # Script deployment (recommended) forge script script/Deploy.s.sol:Deploy --rpc-url sepolia --broadcast --verify # Verify existing contract forge verify-contract $ADDRESS src/Token.sol:Token --chain sepolia
Cast - Blockchain Interactions
cast call $CONTRACT "balanceOf(address)" $USER --rpc-url mainnet cast send $CONTRACT "transfer(address,uint256)" $TO $AMOUNT --private-key $KEY cast decode-tx $TX_HASH cast storage $CONTRACT 0 --rpc-url mainnet
Anvil - Local Node
anvil # Start local node anvil --fork-url $RPC_URL # Fork mainnet anvil --fork-block-number 18000000
Basic Test Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
import {Test, console} from "forge-std/Test.sol";
import {Counter} from "../src/Counter.sol";
contract CounterTest is Test {
Counter public counter;
address public user;
function setUp() public {
counter = new Counter();
user = makeAddr("user");
deal(user, 10 ether);
}
function test_Increment() public {
counter.increment();
assertEq(counter.number(), 1);
}
function test_RevertWhen_Unauthorized() public {
vm.expectRevert("Unauthorized");
vm.prank(user);
counter.adminFunction();
}
function testFuzz_SetNumber(uint256 x) public {
x = bound(x, 0, 1000);
counter.setNumber(x);
assertEq(counter.number(), x);
}
}Essential Cheatcodes
// Identity & ETH
address alice = makeAddr("alice"); // Create labeled address
deal(alice, 10 ether); // Give ETH
deal(address(token), alice, 1000e18); // Give ERC20
// Impersonation
vm.prank(alice); // Next call as alice
vm.startPrank(alice); // All calls as alice
vm.stopPrank();
// Time & Block
vm.warp(block.timestamp + 1 days); // Set timestamp
vm.roll(block.number + 100); // Set block number
// Assertions
vm.expectRevert("Error message"); // Expect revert
vm.expectRevert(CustomError.selector); // Custom error
vm.expectEmit(true, true, false, true); // Expect event
emit Transfer(from, to, amount); // Must match next emit
// StoraShowing the first part of this file.
Claude Code skills for founders, developers, and web3 builders. This repository publishes reusable skill folders under skills//, ships stable bundle downloads through GitHub Releases, and publishes changed skills to ClawHub.
Repo: tenequm/skills
Other skills on tenequm-skills.
- /audio-quality-check
Analyze audio recording quality - echo detection, loudness, speech intelligibility, SNR, spectral analysis. Use when the user wants to check a recording's quality, detect echo or duplication in audio files, measure speech clarity, compare original vs processed audio, diagnose
Open skill - /chrome-extension-wxt
Build Chrome extensions using WXT framework with TypeScript, React, Vue, or Svelte. Use when creating browser extensions, developing cross-browser add-ons, or working with Chrome Web Store projects. Triggers on phrases like "chrome extension", "browser extension", "WXT
Open skill - /cloudflare-workers
Cloudflare account ID, set as a CI secret for wrangler deploys.
Open skill - /command-skill-creator
Create automation command skills (slash commands) for Claude Code projects. Use when building `/slash-commands` that automate multi-step workflows - deploys, commits, releases, migrations, cross-repo operations, or any repeatable process. Triggers on "create a command", "make a
Open skill - /deep-research-glim
Conducts deep, multi-angle research using glim MCP tools and parallel subagents. Use for deep research, competitive landscape analysis, strategic intelligence, or /deep-research-glim [topic]. Triggers - deep research, deep dive on, competitive landscape, strategic intelligence,
Open skill - /download-webpage-as-pdf
Set to "false" (the recipe default) to force headless capture regardless of the host agent-browser config
Open skill

