Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Hardhat

Ethereum development environment for compiling, testing and deploying smart contracts.

Crypto and web3NPM

GitHubWebsite

1. License

License from npm.

github.com/NomicFoundation/hardhat

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What Hardhat does

Hardhat 3 runs Solidity tests on a runtime written in Rust and treats Solidity and TypeScript tests as equals, so one project can mix fast Solidity unit tests with TypeScript integration tests.

Hardhat popularity

57 / 100
Gid Score, #1227 overall
550K
downloads a week, npm
8,522
GitHub stars
13
agent projects use it
Hardhat: downloads per weeknpm, hardhat 549,631
Hardhat: GitHub starsNomicFoundation/hardhat 8,522

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Hardhat is used

  • Hardhat is a dependency in 13 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 261 projects, and what it is used with below comes from all of them.
  • Projects that use it most often also use OpenZeppelin Contracts (62.1%), viem (60.9%), dotenv (55.2%).

By coding agent

8 projects, 0.3%
6 projects, 0.2%

Often used with

In 62.1% of its projects
In 60.9% of its projects
In 55.2% of its projects
In 47.5% of its projects
In 40.6% of its projects
In 26.4% of its projects
In 25.7% of its projects
In 24.1% of its projects

Hardhat in practice

Strengths

Solidity tests on a Rust runtime

Deploying, testing and debugging all run on what the site calls Hardhat's "new runtime written in Rust". The maintainers present this runtime as the performance story of Hardhat 3.

Solidity and TypeScript tests side by side

You do not have to pick one test language for the whole project. The site suggests Solidity unit tests "for speed and conciseness", TypeScript integration tests "for expressiveness and complexity", and fuzz tests, decided case by case.

Actionable revert errors with Solidity stack traces

When a transaction reverts, Hardhat shows what the site calls "actionable errors" next to detailed Solidity stack traces. The site says the traces pinpoint "exactly where and why" the code fails.

Scaffolding without prompts

The <code>--template</code> flag creates a project without the interactive questions. The docs name automation scripts and AI agents as the reason this mode exists.

Watch out for

Needs a recent Node.js

Hardhat 3 requires Node.js v22.13.0 or later. For the package manager, the docs say "we strongly recommend pnpm".

Hardhat 2 material is now the old version

The README calls Hardhat 3 the new major version and keeps v2 on a separate branch with its own docs. The docs include a migration guide for Hardhat 2 projects and another for Foundry projects.

Amsterdam hardfork support is experimental

The latest release adds support for several upcoming Amsterdam EIPs, and each change is labeled "experimental". The maintainers warn that EIP-8037 significantly changes the gas costs of state creation.

Create a Hardhat 3 project without prompts and run its tests

mkdir hardhat-example
cd hardhat-example
npx hardhat --init --template node-test-runner-viem
npx hardhat test

More about Hardhat

Packages around it
  • @openzeppelin: Solidity contract library
  • viem: TypeScript Ethereum client
  • dotenv: Env file loader
  • ethers: Ethereum JS library
  • @nomicfoundation/hardhat-toolbox: Hardhat plugin bundle
  • @nomicfoundation/hardhat-ethers: ethers.js plugin for Hardhat
More in Crypto and web3

Alternatives

Hardhat This page

MITGid 57550K/wk

Compare Hardhat with another tool

Get started

Install it.

npm install hardhat

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Hardhat
- Check that Node.js is v22.13.0 or later before installing Hardhat 3.
- Scaffold without prompts: `npx hardhat --init --template node-test-runner-viem`. List the other templates with `npx hardhat --init --templates`.
- Target Hardhat 3 docs and APIs. Hardhat 2 has its own separate docs. For a v2 project, consult the Hardhat migration guide.
- Put the Solidity compiler version, networks, plugins and tasks in `hardhat.config.ts`.
- Use the `.t.sol` extension for Solidity tests that live in `contracts/`. In `test/`, use either `.sol` or `.t.sol`.
- Write deployments as Hardhat Ignition modules in `ignition/modules`.
- Run `npx hardhat test` to confirm the project still works after changes.