Hardhat 3: Rust-powered Solidity tests

Ethereum development environment for professionals

Get started

Ready to use out of the box

Hardhat includes everything you need for Solidity smart contract development. Testing, deployment, code coverage, code verification, and more.

Why hardhat?

Run Solidity tests on a Rust-powered runtime

Deploy your contracts, run Solidity tests, and debug your code on Hardhat's new runtime written in Rust for outstanding performance.

Clear errors and Solidity stack traces

When transactions revert, Hardhat shows actionable errors like "Non-payable function was called with value 1," alongside detailed Solidity stack traces to pinpoint exactly where and why your code fails.

Feature card picture
Feature card picture

Comprehensive testing approach

Write unit tests in Solidity for speed and conciseness, integration tests in TypeScript for expressiveness and complexity, or fuzzing tests to push the edges. Decide on a case by case basis.

Multi-chain ready: Optimism's OP Stack and Base simulation support

Manage multiple networks at the same time and confidently deploy on OP Stack knowing your code was tested on an accurate simulation.

Feature card picture
Feature card picture

Simple and reliable deployments

Define your contract instances, their operations, and Hardhat Ignition will drive the complex details and parallelize execution.

Plugin ecosystem

Extend Hardhat with a composable ecosystem of plugins that add functionality and integrate your existing tools into a smooth workflow.

Feature card picture
Feature card picture

TypeScript extensibility

A tooling platform designed to be extended, Hardhat has all the utilities you need to address your project-specific needs. Change anything you like. Even entire built-in tasks, or just parts of them.

For teams and projects of any scale

From single hacker quickly iterating on a proof of concept to full blown engineering organization dealing with ad-hoc needs at scale, Hardhat adapts as your needs change

Feature card picture
Feature card picture
Feature card picture
Feature card picture
Feature card picture
Feature card picture
Feature card picture
Feature card picture
Feature card picture
Feature card picture
Flexible. Extensible. Fast.
Build your software your way—without limitations.

What's new in Hardhat

Hardhat v3.4.0
Today

Hardhat v3.4.0

This is a large release in preparation of the first stable version of Hardhat 3! Please read the list of changes below, the user migration guide, and if you are a plugin author, the plugins migration guide. # Highlights ## New `NetworkManager` methods We deprecated the `network.connect()` method as it was a common source of confusion. It still works, but will eventually be removed. Instead, you can use the new methods `network.create()` and `network.getOrCreate()`. ## Unified compilation of contracts and Solidity tests Previously, Hardhat 3 compiled your contracts and your Solidity tests independently. Starting with this version, they are built together, leading to faster compilation times and smaller compilation artifacts. You can opt into the older behavior with the new `splitTestsCompilation` field in your `solidity` config. This is mainly useful if you rely on plugins that don't yet support unified compilation yet, or if your setup depends on test artifacts being isolated from contract artifacts. ## Simulated networks now return the JSON-RPC code `3` on execution errors If you run an in-process simulated network, or `hardhat node`, revert errors in JSON-RPC responses now use code `3` instead of the code used previously (`-32603` or no code at all). This change aligns Hardhat's behavior with the rest of the tooling ecosystem. This should only improve the error messages that you see, and doesn't require any update, unless you are manually interacting with JSON-RPC responses. ## Proxies support in the `--gas-stats` feature Hardhat now classifies gas stat entries based on both the implementation contract and the proxy (or proxies) in front of it. For example, a proxy forwarding to a `Vault` contract is now reported as gas spent in `Vault` via the proxy. Previously, that same call would have reported all the gas under the proxy, hiding which implementation actually did the work. ## The Hardhat version is now included in the `BuildInfo` files of production builds If you compile your project with the `production` Build Profile, a new `toolVersions` field containing the Hardhat version will be added to your Build Info files. This can help you reproduce your builds in the future. You can enable this functionality in other build profiles with the flag `toolVersionsInBuildInfo`. ## Smaller Build Info output files by using a better default output selector Building your contracts with this version of Hardhat will lead to a significantly smaller `artifacts/` folder, in some cases around 50% smaller. # User migration guide To update to this new version of Hardhat, please follow this guide. ## Replace `network.connect()` with `network.create()`. Replace `network.connect(...)` calls with `network.create(...)`. Everything else keeps working as expected. ## Build ids may change even when bytecode is identical As a result of adding the `toolVersions` field and changing the default output selector, your build ids can change, despite the compilation output's bytecode being identical. If you need to get the exact same version, please downgrade to the previous version. In future `production` builds, you'll always know exactly which version was used, so this should be simpler. # Plugin Migration Guide: Adapting to `splitTestsCompilation: false` This guide covers what `splitTestsCompilation: false` changes for plugin authors and how to adapt. ## Configuration The field is accepted in all object-typed Solidity user configs (`SingleVersionSolidityUserConfig`, `MultiVersionSolidityUserConfig`, `BuildProfilesSolidityUserConfig`). String and string-array configs always resolve to `false`. The resolved value is available at `hre.config.solidity.splitTestsCompilation`. ## Build System (`hre.solidity`)
Learn more  
2 weeks ago

Hardhat v3.3.0

This release includes new features and multiple optimizations that give a general performance improvement. The new features include: * Execution tracing support has been added for JS/TS integration tests, previously this was only available for Solidity tests. Tracing support is available through the `--verbosity` option and its `-v` shorthands. For more details see [the execution traces docs](https://hardhat.org/docs/guides/execution-traces). * Inline configuration per test is now available in Solidity tests (see [our inline config docs](https://hardhat.org/docs/guides/testing/inline-configuration))
Learn more  

What's new in Hardhat

Solidity vs. TypeScript tests: How to choose and combine in Hardhat 3

Solidity vs. TypeScript tests: How to choose and combine in Hardhat 3

Testing is central to Ethereum smart contract development, as bugs and vulnerabilities can lead to catastrophic losses. Most projects tests contracts either in TypeScript or Solidity. With Hardhat 3, you don’t have to choose between writing all your tests in Solidity or in TypeScript — both are first-class options, they can be combined, and each brings their unique strengths. The key is knowing where each approach fits best, and how they complement one another. Solidity Tests Writing tests d

Rust-powered Hardhat: Present & Future

Rust-powered Hardhat: Present & Future

In March, we released Hardhat v2.21.0, the first version powered by our brand new Ethereum Development Runtime (EDR, for short) implemented in Rust. This was a significant change under the hood, representing the rewriting of Hardhat's largest and most complex component—its Ethereum simulation layer—in a new language. By design, this update didn’t affect the user experience beyond improving performance. In this post, we’ll explain why we built EDR, discuss its current status, and outline what’s c

Secure deployments with Hardhat Ignition and Ledger hardware wallets

Secure deployments with Hardhat Ignition and Ledger hardware wallets

As you may know, we recently introduced Hardhat Ignition, a declarative system for deploying smart contracts on Ethereum, which aims to…

Tell me about new product features as they come out