Hardhat is a development environment for writing, testing, deploying, and debugging Ethereum smart contracts. Think of it as the workshop a developer sets up before touching a live network: it compiles your Solidity code, runs it against a private test chain, catches errors, and pushes finished contracts to Ethereum or another EVM blockchain when they’re ready.
If you’ve built anything with JavaScript, the mental model is close to tools like Jest, Webpack, or the npm scripts you already run. Hardhat plays that role for on-chain code. Below we start with the plain definition, then work up to how the tool is structured, what changed in the current version, and how it compares to its main rival. By the end you’ll know what Hardhat does, who uses it, and when to reach for it.
What Is Hardhat?
Hardhat is an open-source toolkit built by the Nomic Foundation for professional Ethereum development. Its one-line job description, straight from the project itself, is to compile, deploy, test, and debug your Ethereum software from a single command-line tool.
Hardhat is a Node.js-based development environment that automates the repetitive tasks of smart contract work — compiling Solidity, running tests, deploying to networks, and inspecting what went wrong — and extends through a large plugin system.
The adoption numbers back up its standing. The core hardhat package pulls roughly 514,000 downloads a week on npm, a figure Socket.dev classes as an “influential project,” and the main repository has over 8,500 GitHub stars. For a lot of crypto teams working in Solidity, it’s the default starting point.
The Problems It Solves
Building a smart contract by hand is tedious and risky. You have to compile Solidity into bytecode, generate an ABI so other code can talk to your contract, spin up a chain to test against, and then deploy — repeating most of that every time you change a line. Hardhat automates the loop so you spend time on logic, not plumbing.
The testing piece is the one that matters most, and the people who build the tool say so plainly. “Testing is central to Ethereum smart contract development, as bugs and vulnerabilities can lead to catastrophic losses,” writes Patricio Palladino, co-founder of the Nomic Foundation and the original creator of Hardhat, in an October 2025 post. On a public chain a shipped bug can’t be patched away, and it can cost real money. A dependable test setup is the whole point.
Why Developers Choose This Environment

The short answer: it puts the entire build-test-ship cycle in one place and lets you extend any part of it. Here’s what that looks like in practice.
One Toolkit to Compile, Test, and Ship
Instead of stitching together separate programs, you run everything through Hardhat. npx hardhat compile turns your Solidity into artifacts. npx hardhat test runs your test suite. A deployment command pushes the contract to whatever network you point it at. Each smart contract project follows the same rhythm, which makes moving between projects painless.
A Local Chain for Instant Feedback
Hardhat ships with its own private blockchain, the Hardhat Network, that runs on your machine. It mines transactions instantly, hands you funded test accounts, and resets whenever you want — no waiting, no test-token faucets, no fees. You can even fork the state of a live Ethereum network and run experiments against real contracts and balances as they exist right now.
The debugging is what wins people over. When something reverts, Hardhat shows you a full stack trace, and you can drop console.log statements directly into Solidity to print values mid-execution. That single feature saves hours; on most other setups you’re guessing.
Plugins for Almost Everything
Hardhat is deliberately thin at its core and grows through plugins. Want the ethers.js or viem libraries wired in, gas usage reports, contract verification on Etherscan, or coverage stats? There’s an official or community plugin for it, and the popular ones come bundled in the Hardhat Toolbox. This is why the tool fits so many workflows — you add only the parts your crypto project needs.
How a Project Is Organized
Run the setup command and you get a predictable folder layout. Knowing what each part does removes most of the early confusion.
| Folder / file | What lives there |
|---|---|
contracts/ | Your Solidity (.sol) source files — the smart contract code itself. |
test/ | Test files, written in TypeScript, JavaScript, or Solidity. |
scripts/ | Standalone scripts, for example a deployment routine. |
ignition/ | Deployment modules for Hardhat Ignition, the declarative deployment system. |
artifacts/ | Compiler output — the ABI and bytecode generated from your contracts. |
hardhat.config.ts | The project’s control panel: compiler version, networks, plugins, and accounts. |
The config file is the one to watch. It’s where you set your Solidity version, list the networks you deploy to, and load plugins. When a build behaves strangely, this is the first file to open. The artifacts/ folder, meanwhile, holds the two things any app needs to interact with a deployed contract: the ABI (its public interface) and the bytecode that actually lives on-chain.
How to Set Up Your First Project

Getting started takes a few minutes and assumes only that you have Node.js installed. The current flow looks like this:
- Make a folder and initialize it:
mkdir my-project && cd my-project, thennpm init -y. - Install the tool as a dev dependency:
npm install --save-dev hardhat. - Scaffold the project:
npx hardhat --init, which walks you through an interactive setup and creates a sample project. - Write or edit a contract in
contracts/, then runnpx hardhat compile. - Add tests in
test/and runnpx hardhat testto check your logic against the local chain. - To reach a public testnet or mainnet, add the network to
hardhat.config.tswith an RPC endpoint URL and a funded account, then run your deployment.
That last step is where Hardhat stops being self-contained. To broadcast to a real network, it needs a connection to the blockchain — an endpoint that relays your transactions. More on that shortly.
What’s New in Hardhat 3
Version 3 is the current line, and it’s a big one. It shipped as a production-ready beta in August 2025 and reached stable in June 2026, with Hardhat 2 now on a defined end-of-life path. The headline changes reshape how the tool works.
| Feature | Why it matters |
|---|---|
| Solidity tests | You can now write fast, Foundry-compatible unit, fuzz, and invariant tests directly in Solidity — no context switching to another language. |
| Multichain support | The simulated network can now imitate different chain types, with first-class support for Ethereum Mainnet and OP Mainnet instead of only mainnet behavior. |
| Rust-powered runtime | The simulation engine was rewritten in Rust as the Ethereum Development Runtime (EDR), which speeds up execution. |
| Revamped build system | Full npm compatibility and build profiles let you define different compile settings for different jobs. |
| Hardhat Ignition | A declarative deployment system that describes what you want on-chain and handles the how. |
The Solidity testing change is the most consequential. Earlier versions leaned on JavaScript and TypeScript for tests; now both Solidity and TypeScript are first-class options that you can mix in one project. As Palladino frames it, you use Solidity tests for fast unit checks, fuzzing, and invariants, and TypeScript for realistic end-to-end scenarios. That flexibility used to be the main reason developers left for other tools.
Hardhat vs. Foundry: Which Should You Pick?
The other name you’ll hear constantly is Foundry, a Rust-based toolkit where you write tests in Solidity and run everything from the terminal. The two are the dominant choices for Ethereum and broader crypto development, and the honest answer is that both are excellent. The right one depends on your team and your project.
| Hardhat | Foundry | |
|---|---|---|
| Built on | Node.js / TypeScript | Rust |
| Test language | Solidity + TypeScript | Solidity |
| Strengths | Plugins, debugging, JS/web integration | Raw speed, native Solidity workflow |
| Best for | Teams fluent in JavaScript, complex or multichain apps | Contract-focused teams chasing fast iteration |
Reach for Hardhat when your project touches web frontends, needs a deep plugin ecosystem, or benefits from rich debugging and TypeScript integration. Reach for Foundry when the work is purely contract-side and you want the fastest possible test runs. With Hardhat 3 adding Foundry-compatible Solidity tests, the gap has narrowed — plenty of teams now use both together.
Connecting to Live Networks
Here’s the catch the tutorials sometimes skip. The Hardhat Network is only a simulation on your laptop. The moment you deploy to a testnet or to Ethereum mainnet — or want to fork real chain state — Hardhat has to reach the actual blockchain, and for that it needs an RPC endpoint. That’s the URL you drop into hardhat.config.ts so your transactions get relayed to the network.
Running that infrastructure yourself is heavy: full chains take terabytes of storage, days to sync, and constant upkeep. A provider removes that burden. NOWNodes gives you instant RPC endpoint access to Ethereum and 120+ other blockchains through one API, with a reported 99.95% uptime and sub-second response times, so you point Hardhat at a URL instead of maintaining servers.
Wiring it in is quick:
- Grab a free API key from the NOWNodes dashboard — the START plan includes 100,000 requests to get going.
- Copy the Ethereum endpoint (or a testnet endpoint) and add it as the
urlin your network config, with your key. - Deploy as usual — Hardhat sends the transaction through that endpoint to the live chain.
Because one API covers both mainnet and testnets, you can rehearse a deployment on a test network and then flip to production without rebuilding anything. If you’d rather test against a shared connection before committing, the public endpoints are a fast way to start.
The Bottom Line
Hardhat is the tool that turns raw Solidity into a tested, deployable smart contract, and it’s earned its place as a default in Ethereum development for good reason: it automates the tedious parts, gives you a local chain and real debugging, and bends to almost any workflow through plugins. Version 3 modernized it with Solidity tests, multichain simulation, and a faster Rust core, keeping it competitive with Foundry rather than behind it.
If you’re starting out, install it, scaffold a project, and write a contract against the local network first. When you’re ready to touch a real chain, connect it to a reliable endpoint provider so the deployment step is the easy part. That’s the whole arc — from an empty folder to a contract live on Ethereum.
FAQ
Is Hardhat free to use?
Yes. Hardhat is open-source and free under the MIT license. You only pay for outside services you choose to add, such as an RPC endpoint provider for deploying to live networks, and many of those, including NOWNodes, have free tiers.
What language do you need to know for Hardhat?
Solidity for the contracts themselves, plus JavaScript or TypeScript for scripts and configuration. Since Hardhat 3, you can also write tests directly in Solidity, so a JavaScript background is helpful but no longer strictly required for testing.



