Hardhat

Hardhat is an open-source development environment for Ethereum and other EVM-compatible smart contracts. Developers use it to configure Solidity compilation, run tests, simulate blockchain behavior, debug failures, and organize deployments. The current major release line is Hardhat 3, which supports both Solidity and TypeScript tests and can be extended with plugins. Hardhat is a developer tool: it does not itself make a contract secure or deploy code simply because a project has been configured.


What developers use Hardhat for

A Hardhat project typically keeps its compiler and network settings, contracts, tests, scripts, and plugin configuration together. Developers can run a local simulated network to test contract behavior without sending transactions to a public blockchain. They can also configure a JSON-RPC network or fork a remote chain at a chosen block for local experiments. A forked test is still a simulation: changes made during the test do not alter the source chain.

Hardhat 3 supports Solidity tests as well as TypeScript tests; JavaScript can also be used for TypeScript-style test files. Solidity tests suit focused contract logic, while TypeScript tests can exercise longer flows across transactions, accounts, and off-chain components. Hardhat’s documentation describes built-in support for coverage, gas statistics, execution traces, and fuzz or invariant testing in Solidity. Which tools are available in a particular project depends on its Hardhat version and installed plugins.


Plugins and deployments

Hardhat is designed to be extended. Official plugins provide integrations for libraries such as ethers.js or viem, test runners such as Node.js’s built-in runner or Mocha, and utilities for network simulation and contract verification. A plugin is an optional component, not a feature every Hardhat project automatically has; check the project’s configuration and package versions.

Hardhat Ignition is Nomic Foundation’s declarative deployment system. A developer defines the contracts and operations in modules, then runs a deployment against a simulated or configured network. Ignition can track deployment steps and resume certain interrupted deployments, but deploying to a public network still submits real transactions and can spend funds. Review the selected network, account, transaction details, and deployment module before running it.


Hardhat and Foundry

Foundry is another Ethereum development toolchain. Hardhat projects commonly use JavaScript or TypeScript for scripting and integration work and can combine those with Solidity tests. Foundry’s Forge centers on Solidity tests and includes fuzz and invariant-testing workflows. The tools overlap in compiling, testing, local simulation, and deployment, but use different workflows and ecosystems. A project can choose one or use both where that fits its team; neither is universally best for every codebase.

Version matters. Tutorials and plugins for Hardhat 2 may not match a Hardhat 3 project, so check the installed package version and follow documentation for that version. Hardhat tests can catch bugs in the cases they cover, but a passing test suite is not a security audit and cannot prove that a contract has no vulnerabilities.


Social Media Sentiment

A recent r/solidity discussion about developer testing and debugging stacks asked how people choose between Hardhat, Foundry, Anvil, and hosted simulation tools. In that small thread, some commenters said they had moved from Hardhat to Foundry for speed or Solidity-focused testing, while the original question treated the choice as a practical workflow comparison rather than a single winner. It is a low-volume, English-language discussion, not a representative developer survey.

Last updated: 2026-10

Related Terms

  • Solidity — the programming language used to write many EVM smart contracts.
  • Smart Contract — code deployed to a blockchain and executed under its rules.
  • Foundry — a separate Ethereum development toolchain that overlaps with Hardhat.

See Also

Sources