Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

buidler-abi-exporter

ItsNickBarry158MIT1.0.1TypeScript support: included

Export Solidity contract ABIs on compilation

buidler, abi, solidity, solc, smart-contracts, ethereum, blockchain, version-control, wow, dapps

readme

Buidler ABI Exporter

Export Solidity contract ABIs on compilation via Buidler.

Installation

yarn add --dev buidler-abi-exporter

Usage

Load plugin in Buidler config:

usePlugin('buidler-abi-exporter');

Add configuration under the abiExporter key:

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

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.

TypeScript Support

For TypeScript compatibility, add 'node_modules/buidler-abi-exporter/type-extensions.d.ts' to the files array in tsconfig.json.