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-merger

v1.0.2

Published

Plugin for Hardhat to generate merged smart contracts in Solidity

Downloads

4

Readme

Hardhat Merger Plugin

This is a plugin for Hardhat that allows you to generate merged smart contracts in Solidity. The plugin provides a seamless way to combine multiple Solidity files into a single output file, making it easier to manage and deploy your contracts.

Installation

To use this plugin, follow these steps:

  1. Ensure you have Node.js installed on your machine.
  2. Install Hardhat by running npm install --save-dev hardhat.
  3. Install the Hardhat-Abigen plugin by running npm install --save-dev hardhat-merger.

Usage

To use the plugin, import it in your JavaScript or TypeScript file as follows:

JavaScript

require("hardhat-merger");

TypeScript

import "hardhat-merger";

Configuration

The plugin supports custom configuration options, which can be specified in your Hardhat configuration file (hardhat.config.js or hardhat.config.ts). Here is an example configuration for the merger section:

JavaScript

module.exports = {
  // ...other configuration options...

  merger: {
    outDir: "merged", // The output directory for the merged contracts (default: "merged")
    inDir: "contracts", // The input directory containing the individual contracts (default: "contracts")
    includeContracts: ["*"], // An array of contract patterns to include in the merge (default: ["*"])
    excludeContracts: [], // An array of contract patterns to exclude from the merge (default: [])
  },
};

TypeScript

import { HardhatUserConfig } from "hardhat/config";

const config: HardhatUserConfig = {
  // ...other configuration options...

  merger: {
    outDir: "merged", // The output directory for the merged contracts (default: "merged")
    inDir: "contracts", // The input directory containing the individual contracts (default: "contracts")
    includeContracts: ["*"], // An array of contract patterns to include in the merge (default: ["*"])
    excludeContracts: [], // An array of contract patterns to exclude from the merge (default: [])
  },
};

export default config;

Make sure to adjust the configuration according to your project's needs.

Generating merged contracts

To generate smart contracts, run the following command:

npx hardhat merger

This will generate the merged contracts in the specified outDir directory.

License

This plugin is open-source and available under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.


Note: Please ensure that you have a backup of your contracts before using the Hardhat Merger plugin. While every effort has been made to ensure the reliability and accuracy of the plugin, it is always recommended to perform thorough testing and review before deploying merged contracts in a production environment.


I hope this plugin simplifies your development workflow by automatically generating merged smart contracts in Solidity. If you encounter any issues or have suggestions for improvements, please open an issue. Contributions are also welcome!