Practical overview
When it fits
Use it in a Hardhat project when contract ABIs need to be generated during compilation or through a dedicated task, with configurable selection and formatting.
Who it is for
- Ethereum smart-contract developers using Hardhat.
- Teams that need ABI files available to downstream application tooling.
Documented uses
- Generate ABI files as part of a Hardhat compilation workflow.
- Choose which contracts and ABI elements are included in exported output.
- Produce ABI output in a selected format and directory.
Requirements & limits
The repository identifies the project as open source under the MIT license.
- Automatic export is off by default; enable
runOnCompileto include it in compilation. - The plugin supports minimal, full, JSON and TypeScript output formats.
- The
clearoption is destructive and defaults to false. - Flat output may cause name collisions, and the rename option cannot be used with flat output.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install and configure ABI exporting in Hardhat
Add the plugin to a Hardhat project and set the options that control ABI output.
Before you start
- A Hardhat project
- npm or pnpm
Steps
Install the development dependency with the command below or
pnpm add -D @solidstate/hardhat-abi-exporter.npm install --save-dev @solidstate/hardhat-abi-exporterImport
hardhatAbiExporterfrom@solidstate/hardhat-abi-exporterin the Hardhat configuration and include it in thepluginsarray.Add an
abiExporterconfiguration, setting options such aspath,runOnCompile, contract matchers andformatas needed.
Expected outcome
The Hardhat configuration includes the plugin and specifies how ABI exports should be handled.
Guide limitations
- Automatic export during compilation is disabled by default and requires
runOnCompile: true. - The
clearoption deletes old ABI files and defaults to false. - Flattening can cause name collisions; renaming is incompatible with flat output.
Export ABIs with a Hardhat task
Use the plugin's documented task to create ABI output.
Before you start
- The plugin installed and loaded in a Hardhat project
Steps
Run the command below or
pnpm hardhat abi export.npx hardhat abi exportTo skip the compile step that runs before exporting by default, add
--no-compileto the task command.
Expected outcome
The task exports ABI files in the configured output directory; the directory is created if it does not exist.
Guide limitations
- The task runs compilation first unless
--no-compileis used. - The configured
clearoption can delete old ABI files.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 9 October 2026
- Original website title
- solidstate-network/hardhat-abi-exporter · Official homepage title · retained in its source language

