hardhat-interface-analysis
v0.1.4
Published
Hardhat plugin for analyzing around interfaces
Downloads
3
Readme
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.