OpenViSTAI · Agents · Blockchain · Crypto
Menu
Developer Tools

Hardhat Tracer

Hardhat Tracer is a TypeScript Hardhat plugin for tracing Ethereum contract behavior during tests and for inspecting transactions, calls and encoded data. It prints events, internal calls and storage operations, and exposes trace details for use in test code and custom tooling.

Independent OpenViST project profile, based on linked sources.

Hardhat Tracer — OpenViST project profile in Developer Tools.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

Add tracing to a Hardhat project

Install the plugin and load it through the Hardhat configuration.

Before you start

  • A Hardhat project
  • npm

Steps

  1. Run the command below.

    Documented command
    npm i hardhat-tracer
  2. Add require("hardhat-tracer"); to hardhat.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.
Source-based practical guide

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

  1. Run the command below to print calls for failed transactions, or --fulltraceError to include storage operations.

    Documented command
    npx hardhat test --traceError
  2. Use --trace for calls across all transactions, or --fulltrace for calls and storage operations across all transactions.

  3. Optionally add --opcodes ADD,SUB to 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 --v and for all transactions with --vvv; other combinations are not described.
Evidence and transparency

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