hardhat-toolbox-viem
Skill by NomicFoundation
Guides an AI assistant through testing and interacting with Ethereum smart contracts in Hardhat projects that use the viem toolbox. It is for developers who depend on @nomicfoundation/hardhat-toolbox-viem.
Install hardhat-toolbox-viem
Built from the published package, never by AI.
git clone --depth 1 https://github.com/NomicFoundation/hardhat /tmp/hardhat && mkdir -p ~/.claude/skills && cp -r /tmp/hardhat/packages/hardhat/skills/hardhat-toolbox-viem ~/.claude/skills/hardhat-toolbox-viemRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/NomicFoundation/hardhat /tmp/hardhat && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/hardhat/packages/hardhat/skills/hardhat-toolbox-viem ~/.gemini/antigravity-cli/skills/hardhat-toolbox-viemAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install hardhat-toolbox-viem in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill covers the viem tooling in the Hardhat toolbox. It builds on the core hardhat skill, which should be loaded first for test organization, network.create(), networkHelpers, fixtures and typechecking. Everything is accessed through the connection returned by network.create().
The skill explains how to get public, wallet and test clients, deploy contracts with viem.deployContract, and read, write and attach to contracts with getContractAt. It also covers viem.assertions for revert, event and ETH balance checks, plus an anyValue helper for matching arguments. It is aimed at developers writing typed Hardhat tests for contracts.
Written from the project's SKILL.md and checked against it.
What it can do
- viem clientsGets public, wallet and test clients from the network connection.
- Contract deploymentDeploys a contract with viem.deployContract and returns a typed instance.
- Contract reads and writesCalls read and write methods with arguments and options type-checked against the ABI.
- Attach to contractsAttaches to an already-deployed contract using viem.getContractAt.
- Revert assertionsChecks reverts, revert messages and custom errors with viem.assertions.
- Event assertionsChecks emitted events, with or without argument matching.
- ETH balance assertionsChecks ETH balance changes caused by a transaction, before gas.
- Argument predicatesUses predicate functions or the anyValue helper to match event and error arguments.
- Fixture deploysShows viem.deployContract as the deploy step inside a loadFixture setup function.
What you need
- A Hardhat project that depends on @nomicfoundation/hardhat-toolbox-viem
- The core hardhat skill, loaded alongside this one
Try asking
- Deploy a Counter contract in a Hardhat test using viem.deployContract
- Write a test that checks a transaction reverts with a custom error
- Add a balance assertion checking that the winner receives the prize
Good to know
- Assumes the project already depends on @nomicfoundation/hardhat-toolbox-viem
- Balance assertions measure ETH changes before gas
- Recommends typed contract instances over walletClient.writeContract
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: packages/hardhat/skills/hardhat-toolbox-viem/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md4 KB
Alternatives to hardhat-toolbox-viem
All alternatives →Lists live launchpad token feeds and AI-detected hot topics for meme tokens on BSC, Solana and Base. Covers new, finalizing and just-migrated tokens on launchpads such as Pump.fun and Four.meme.
The okx-market skill lets an AI assistant retrieve cryptocurrency market data from the OKX V5 REST API. It is aimed at users who want spot, derivatives and index data in Python without an account.
Calculates key SaaS health metrics such as ARR, churn, LTV and CAC from raw business numbers, then gives prioritized advice. Built for founders and finance leads who share revenue or customer figures.
Fetches U.S. SEC EDGAR data for research. It resolves a ticker to its CIK, lists recent filings with primary-document URLs, and pulls XBRL financial series. Built for analysts who need free, U.S.-only filing data.
Provides free, no-auth access to Eastmoney market data for A-shares, Hong Kong stocks and US stocks. It covers fund flows, dragon-tiger lists, financial statements and stock screening.
Reads and manages a user's QuickBooks business through Intuit's official MCP server. It answers finance questions from reports, invoices, customers, products and benchmarks, and completes approved actions.
Compare with meme-rush, okx-market or saas-metrics-coach
hardhat-toolbox-viem: common questions
Does this skill work without the hardhat skill?
The source says it builds on the core hardhat skill and that it should be loaded first for test setup, fixtures and typechecking.
How do I check a custom error with arguments?
Use viem.assertions.revertWithCustomErrorWithArgs, which accepts concrete values, predicate functions or anyValue for each argument.
Why avoid walletClient.writeContract?
The source says it has no ABI typing, so wrong arguments can pass unnoticed. Typed instances from viem.deployContract or viem.getContractAt are preferred.
How do I install hardhat-toolbox-viem?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is hardhat-toolbox-viem free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is hardhat-toolbox-viem safe to use?
It scores 85 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to hardhat-toolbox-viem?
Similar skills: meme-rush, okx-market, saas-metrics-coach, sec-edgar.
