0.1.4 • Published 12 months ago

hardhat-interface-analysis v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

Hardhat Interface Analysis

A hardhat plugin for analyzing around solidity interfaces.

Installation

# Using yarn
yarn add hardhat-interface-analysis

# Using npm
npm i hardhat-interface-analysis

Import the plugin in your hardhat.config.js:

require("hardhat-interface-analysis");

Or if you are using TypeScript, in your hardhat.config.ts:

import "hardhat-interface-analysis";

Usage

Interface Dependency

This command creates a dependency map of interfaces.

npx hardhat interface-dependency [--target <target file path>] [--input <input dir>] [--output <outpur dir>] [--srcdir <source code directory>]

It requires a "build info" file which is originally created in artifacts/build-info/ dir by compile processes.

Or you can use interfaceDependency function from the Hardhat Runtime Environment in hardhat.config.js.

task("compile", "compile with printing dependencies of interfaces")
  .addOptionalParam(
    "target",
    "A path of solidity file from the project root. By default, all files are analyzed.",
    "",
    types.string
  )
  .addOptionalParam(
    "input",
    "A path of build-info directory from the project root. By default, '<artifacts dir>/build-info/'",
    "",
    types.string
  )
  .addOptionalParam(
    "output",
    "A path of output directory from the project root. By default, '<artifacts dir>/interface-analysis/'",
    "",
    types.string
  )
  .addOptionalParam(
    "srcdir",
    "A path of source directory from the project root. By default, 'contracts/'",
    "",
    types.string
  )
  .setAction(async (taskArgs, hre, runSuper) => {
    await runSuper();
    await hre.interfaceDependency(hre, taskArgs);
  });

The result is written down as interface-analysis/interface-dependency.json by default.

0.1.4

12 months ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago