0.1.0 • Published 1 year ago

hardhat-abipick v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Hardhat Plugin abipick

Pick the ABI which you need just.

1. Install

$ npm install --save-dev hardhat-abipick
# or
$ yarn add --dev hardhat-abipick

2. Included Commands

  • npx hardhat abipick [--format <format>]: Pick the ABI which you need just.
    • --format parameter is the format of the output ABI, support 'json' 'minimal' 'full'

3. Usage

Load plugin in Hardhat config:

require('hardhat-abipick');
# or
import 'hardhat-abipick';

Add optional configuration with abipick key:

optiondescriptionoptionaltypedefault value
formatoutput abi format, support 'json' 'minimal' 'full'truestring"json"
contractsthe contracts you want to picktrueobject array"[]"
contractsi.contractthe contract namefalsestring"[]"
contractsi.functionsthe functions you want to picktruestring array"[]"
contractsi.eventsthe events you want to picktruestring array"[]"
contractsi.errorsthe errors you want to picktruestring array"[]"

!! npx hardhat abipick [--format <format>] command's --format parameter has higher priority than configurations format in hardhat.config.ts.

for example:

abipick: {
  format: "full", // "json" "minimal" "full"
  contracts: [
    {
      contract: "ScoreLend",
      functions: ["borrow"],
      events: ["Borrow", "Payback"],
      errors: ["HasOverdue"]
    }
  ],
}

5. Version History

  • v0.1.0 (2024/05/07)
    • init release