npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hardhat-extended-tasks

v1.0.3

Published

Utility tasks to use with Hardhat enviroment

Downloads

13

Readme

Hardhat Extended Tasks

Package name

hardhat-extended-tasks

Introduction

npm version

The hardhat-extended-tasks npm package is a plugin for the Hardhat development environment that provides additional features and enhancements to streamline your Ethereum smart contract development process. This plugin expands the capabilities of Hardhat by introducing a new optional parameter for contract compilation, a custom task for exporting contract ABIs, and a task for exporting the Standard JSON input from contracts build-info JSON files.

Features

  • Selective Contract Compilation: With the hardhat-extended-tasks plugin, you can instruct Hardhat to compile only the selected contracts, saving time and resources during development and testing.
  • Contract ABI Export: This plugin introduces a new task that allows you to export the ABIs (Application Binary Interfaces) of your contracts. You can choose to export all contract ABIs or selectively export specific contract ABIs based on your requirements.
  • Contract Standard JSON Input Export: The plugin now includes functionality to export the Standard JSON input from build-info JSON files, which is needed for contract verification on Blockscout or other Block explorer.

Installation

To install the hardhat-extended-tasks plugin, simply run the following command:

npm install --save-dev hardhat-extended-tasks

or

yarn add -D hardhat-extended-tasks

Usage

Once installed, you can enable the hardhat-extended-tasks plugin by adding it to your hardhat.config.js file.

// hardhat.config.js
require('hardhat-extended-tasks');

After enabling the plugin, you can take advantage of the additional features it provides within your Hardhat development environment.

Selective Contract Compilation

The hardhat-extended-tasks plugin introduces a new optional parameter that allows you to specify the contracts you want to compile during the compilation process. This feature helps to optimize the compilation time, especially when working with large codebases.

To compile only selected contracts, use the --only flag followed by a comma-separated list of contract names.

npx hardhat compile --only Contract1,Contract2

Contract ABI Export

The plugin also adds a custom task that enables you to export the ABIs of your contracts. This can be useful when interacting with contracts in external applications or when sharing contract ABIs with other developers.

To export the ABIs of all contracts, run the following command:

npx hardhat export-ABIs

If you only want to export the ABIs of specific contracts, use the --only flag followed by a comma-separated list of contract names.

npx hardhat export-ABIs --only Contract1,Contract2

Using with fully qualified contract name in case of multiple artifacts for the same contract name:

npx hardhat export-ABIs --only contracts/Contract1.sol:Contract1

The task also accepts a JSON file containing a list of contracts to be processed. You can use the --contract-list parameter followed by the path to the JSON file.

npx hardhat export-ABIs --contract-list contractList.json

The contractList.json file should contain an array of contract names, including fully qualified name.

[
  "Contract1",
  "Contract2",
  "contracts/Contract3.sol:Contract3",
  "Contract4",
  "Contract5",
]

Export Standard JSON Input

To export the Standard JSON input from build info JSON files, use the export-json-input command. By default, it will process all build info files in the build-info folder and write the output to the json-inputs folder.

npx hardhat export-json-input

If you only want to process a specific file, you can provide the export-file parameter followed by the path to the file being processed.

npx hardhat export-json-input --export-file ./artifacts/build-info/...fbf5031228457aa...e21578.json

Please note that the build info JSON file should be located in the build-info folder.

License

This plugin is released under the MIT License.