npm

hardhat-generate-function-selectors
TypeScript icon, indicating that this package has built-in type declarations

1.17.1 • Public • Published

generate-function-selectors plugin

Hardhat TS plugin to generate function selectors from each of the ABI/.json files found in the artifacts/contracts. (Depth/organization doesn't matter)

Outputs 'selectors.json' to project's root directory, which looks like the below for the hardhat example project:

{
  "Lock.sol": {
    "0x251c1aa3": "unlockTime",
    "0x3ccfd60b": "withdraw",
    "0x8da5cb5b": "owner"
  }
}

Quick Start

  1. Install the Hardhat plug-in
npm install hardhat-generate-function-selectors
yarn add hardhat-generate-function-selectors
  1. Add this to your hardhat.config.js
require("hardhat-generate-function-selectors");
import "hardhat-generate-function-selectors";
  1. Add this to your hardhat.config.js as well:
<your hardhat config> = {
  functionSelectors: {
    separateContractSelectors: true, //separate by contract
    orderedByValue: true, //order function selectors by hex value, least to greatest
  },
};

Now you're able to to generate the function selectors with:

npx hardhat selectors
yarn hardhat selectors

Readme

Keywords

Package Sidebar

Install

npm i hardhat-generate-function-selectors

Weekly Downloads

3

Version

1.17.1

License

MIT

Unpacked Size

236 kB

Total Files

12

Last publish

Collaborators

  • 3obby