JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12694
  • Score
    100M100P100Q145018F
  • License MIT

Export Solidity contract ABIs on compilation

Package Exports

  • hardhat-abi-exporter

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hardhat-abi-exporter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Hardhat ABI Exporter

Export Solidity contract ABIs on compilation via Hardhat.

Versions of this plugin prior to 2.0.0 were released as buidler-abi-exporter.

Installation

yarn add --dev hardhat-abi-exporter

Usage

Load plugin in Hardhat config:

require('hardhat-abi-exporter');

Add configuration under the abiExporter key:

option description default
path path to ABI export directory (relative to Hardhat root) './abi'
clear whether to delete old files in path on false
flat whether to flatten output directory (may cause name collisions) false
only Array of contracts to include (case sensitive), defaults to all contracts if length is 0 []
except Array of contracts to exclude (case sensitive) []
abiExporter: {
  path: './data/abi',
  clear: true,
  flat: true,
  only: ['ERC20'],
}

The path directory will be created if it does not exist.

The clear option is set to false by default because it represents a destructive action, but should be set to true in most cases.

ABIs files are saved in the format [CONTRACT_NAME].json.