Practical overview
When it fits
Use it when a Hardhat test result needs more execution detail, or when investigating a transaction, call or encoded input from a Hardhat project.
Who it is for
- Smart-contract developers using Hardhat to test or debug Ethereum projects.
- Developers who need to inspect transaction internals, calldata or test trace data programmatically.
Documented uses
- Print calls for failed transactions or all transactions during Hardhat tests.
- Include storage operations or selected opcodes in test traces.
- Trace a transaction or call and decode internal message calls using project ABIs and artifacts.
- Decode calldata, return data, Solidity custom errors and logs.
- Access the last trace in tests, assert internal message calls, or register tracing on custom tasks.
Requirements & limits
The plugin is installed into a Hardhat project with npm and loaded from its configuration. The repository lists an MIT license.
- Test flags distinguish failed-transaction traces from traces across all transactions, and can add storage operations.
- Transaction and call tracing can use a mainnet fork; the documented RPC alternative requires an archive node.
- Project ABIs and artifacts and the 4byte directory are used to decode internal message calls.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Add tracing to a Hardhat project
Install the plugin and load it through the Hardhat configuration.
Before you start
- A Hardhat project
- npm
Steps
Run the command below.
npm i hardhat-tracerAdd
require("hardhat-tracer");tohardhat.config.js.
Expected outcome
The project configuration loads Hardhat Tracer, making its documented test tracing options available.
Guide limitations
- These steps cover installation and configuration; they do not verify project compatibility or run a test.
Select trace detail for Hardhat tests
Choose whether test output traces failed transactions or all transactions, with optional storage-operation detail.
Before you start
- Hardhat Tracer installed and loaded in the project configuration
Steps
Run the command below to print calls for failed transactions, or
--fulltraceErrorto include storage operations.npx hardhat test --traceErrorUse
--tracefor calls across all transactions, or--fulltracefor calls and storage operations across all transactions.Optionally add
--opcodes ADD,SUBto filter for selected opcodes.
Expected outcome
The test command is configured to print the selected trace detail in the console.
Guide limitations
- The documented opcode examples show filtering for failed transactions with
--vand for all transactions with--vvv; other combinations are not described.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 October 2026
- Original website title
- zemse/hardhat-tracer · Official homepage title · retained in its source language

