Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 85
  • 8.5k stars
  • NOASSERTION
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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-viem

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install hardhat-toolbox-viem in Claude Code

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

A

No 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 →

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.

hardhat-toolbox-viem Install

Add to stack

Loading.