# Hardhat — card for AI agents

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

Category: Crypto and web3 · npm package `hardhat` · latest version 3.21.2 (checked 2026-11-01)
Install: `npm install hardhat`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (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.

## Docs written for agents
- [llms.txt (index of the docs)](https://hardhat.org/llms.txt)

## What it is
- Hardhat is an Ethereum development environment built by the Nomic Foundation. The GitHub repository lists an MIT license and was created on 2018-04-14. The docs say it covers Ethereum and EVM-compatible blockchains and is used to compile, deploy, test and debug Solidity smart contracts. The current major version is Hardhat 3, and the latest listed release is hardhat@3.19.0.
- A project starts with `npx hardhat --init`, which walks you through an interactive setup. The resulting project has a `hardhat.config.ts` file for compiler, network, plugin and task settings. It also has folders for contracts, tests, Hardhat Ignition deployment modules and scripts. The docs stress that "most of Hardhat’s functionality comes from plugins". The recommended setup is the `hardhat-toolbox-viem` bundle, but you can customize it or pick a different path.
- The website pitches Hardhat at everyone from a single developer building a proof of concept to a large engineering organization. The official tutorial assumes you already know smart contract concepts, Node.js and the command line.

## Caveats
- 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.
- Not a first stop for smart contract beginners: The official tutorial expects you to know smart contracts already. The docs point newcomers to introductory Solidity material first.

## Numbers (AgentGid data)
- Gid Score: 57.4 (#1227 of all tools, 11 of 155 in its category)
- Used in 13 public projects set up for AI coding agents (0.2%)
- Downloads last week: 549,631 (as of 2026-11-24), +20.6% over 4 weeks
- GitHub stars: 8,522 (as of 2026-11-24)
- Last push: 2026-11-23

## Often used with
OpenZeppelin Contracts 62.1%, viem 60.9%, dotenv 55.2%, ethers.js 47.5%, Hardhat Toolbox 40.6%, Hardhat ethers Plugin 26.4%

## Links
- AgentGid page: https://agentgid.com/tools/hardhat/
- Homepage: https://hardhat.org
- Repository: https://github.com/NomicFoundation/hardhat
- Source: https://github.com/NomicFoundation/hardhat#readme
- Source: https://github.com/NomicFoundation/hardhat
- Source: https://github.com/NomicFoundation/hardhat/releases
- Source: https://hardhat.org
- Source: https://hardhat.org/llms.txt
- Source: https://hardhat.org/docs/getting-started.md
- Source: https://hardhat.org/docs/tutorial.md

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
