1.0.1 • Published 4 years ago

buidler-abi-exporter v1.0.1

Weekly downloads
8
License
MIT
Repository
github
Last release
4 years ago

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:

optiondescriptiondefault
pathpath to ABI export directory (relative to Buidler root)'./abi'
onlyArray of contracts to include (case sensitive), defaults to all contracts if length is 0[]
exceptArray of contracts to exclude (case sensitive)[]
clearwhether to delete old files in path onfalse
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.