Git Product home page Git Product logo

hardhat-abi-gen's Introduction

Hardhat ABI Generator

Export Solidity smart contract ABIs and generate javascript objects on compilation via Hardhat.

Installation

yarn add --dev @symblox/hardhat-abi-gen

Usage

Load plugin in Hardhat config:

require('@symblox/hardhat-abi-gen');

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 compilation false
flat whether to flatten output directory (may cause name collisions) false
only Array of String matchers used to select included contracts, defaults to all contracts if length is 0 []
except Array of String matchers used to exclude contracts []
spacing number of spaces per indentation level of formatted output 2
abiExporter: {
  path: './data/abi',
  clear: true,
  flat: true,
  only: [':ERC20$'],
  spacing: 2
}

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.

hardhat-abi-gen's People

Contributors

itsnickbarry avatar symblox avatar cruzdanilo avatar dependabot[bot] avatar ddzero2c avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.