Skip to content

Hardhat

Hardhat is an environment for compiling, testing and deploying EVM contracts. It organises networks, scripts and plugins; Hardhat 3 supports Solidity and TypeScript tests with reproducible configuration. Projects retain compiler versions, dependencies, artifacts and deployment parameters so the team can reproduce tests, verify deployed code and maintain administrative operations on each supported network.

Written by Isaac GonzálezUpdated October 11, 2026

Key takeaways

  • Hardhat organizes EVM contract development, testing and deployment.
  • Scripts and network configuration support reproducible deployments.
  • It can be combined with Foundry when a project needs different testing workflows.

What is Hardhat?

Hardhat organises EVM contract development, testing and deployment. It brings together compiler settings, networks and extensions so teams can repeat workflows locally and in continuous integration. Its role extends beyond compilation to connecting source code, artifacts and deployment operations.

Hardhat 3 supports Solidity and TypeScript tests, with integrations for tools such as Viem and Ethers. Plugins and test environments should match the project version rather than mix instructions from Hardhat 2 and 3. Version compatibility matters throughout testing, scripting and release preparation.

How it works

Projects pin compilers, dependencies and network settings. Tests execute calls against simulated environments and check results, events and reverts. A fork can use a network's state at a selected block when the RPC provides the necessary historical data access.

Deployment can use scripts or tools such as Ignition. Both approaches should retain parameters, addresses and verification records. Repeating an administrative task must not accidentally issue assets or transfer permissions again, so scripts need to inspect existing state before taking actions that modify the deployment.

What Hardhat offers

Hardhat fits projects combining contracts with TypeScript services and integration tests. An issuance flow can be tested alongside the client that prepares calls and decodes events, revealing mismatches between the interface expected by the application and the one exposed by the contract.

A delivery can include tests for roles, pause conditions, administration transfer and failing external contracts. Teams retain per-network version records so incidents can be reproduced without relying on the local configuration of the person who performed the original deployment or administrative operation.

Limitations and selection criteria

Local simulation does not reproduce every public-network condition. A fork is a state snapshot, not a guarantee of future execution. Testing should be complemented by destination checks and policies for keys, permissions and administrative transactions used to operate the application.

Choosing between Hardhat and Foundry depends on testing needs and team stack. They can coexist with explicitly aligned versions and settings. Hardhat upgrades require reviewing plugins, artifacts and script behaviour as well as checking whether the project still compiles and its tests remain meaningful.

Also known as

  • Hardhat framework
  • Hardhat Network
Development at Metlabs

How we approach a project with Hardhat

Development capabilities and use cases to assess how Hardhat fits your product.

What we build with Hardhat at Metlabs

  • Advanced testing

    Solidity and TypeScript tests using simulated environments and pinned-block forks.

  • Reproducible deploy scripts

    Scripts or Ignition modules with per-network parameters and records.

  • Explorer verification

    Source, compiler and setting checks to verify implementations in supported explorers.

  • Use case

    Smart contract CI/CD

    A pipeline compiling code, running relevant tests, retaining artifacts and preparing verifiable deployments.

Related content

Go deeper on Hardhat

Other Metlabs pages that expand on this entry.

Building with Hardhat?

We analyze your case, pick the right stack and ship a production-ready solution.

Tell us about your project

As featured in

CointelegraphInvesting.comEl EspañolEmprendedoresEl ObservadorCriptoNoticias