GithubHelp home page GithubHelp logo

hardhat-deployed-records's Introduction

Archived! Please use hardhat-deployed

Hardhat Deployed Records

Recording deployed contracts address.

1. Install

$ npm install --save-dev hardhat-deployed-records
# or
$ yarn add --dev hardhat-deployed-records

2. Included Commands

  • npx hardhat deployed-init [--netwrok <network>]: Initializes the deployed folder, --netwrok parameter is optional, default value is hardhat from Hardhat framework.
  • npx hardhat deployed-add [--netwrok <network>]: Generating new boring code for deploying to new chain specified by --netwrok parameter.
  • npx hardhat deployed-migrate: Migrate the deployed folder
  • npx hardhat deployed-list [--netwrok <network>]: Listing contracts deployed address of the chain specified by --netwrok parameter.

Commonly, you need execute npx hardhat deployed-init [--netwrok <network>] task first, and then:

  • when you want to deploy contracts to a new network, you need to execute npx hardhat deployed-add --netwrok <network> task
  • when you add new contracts or delete contracts you need to execute npx hardhat deployed-migrate task to keep deployed folder is the latest.

3. Usage

Load plugin in Hardhat config:

require('hardhat-deployed-records');
# or
import 'hardhat-deployed-records';

Add configuration under deployedRecords key:

option description optional default
deployedDir path to generated deployed directory (relative to Hardhat root) true scripts/deployed
ignoreContracts which contracts wants to igonre true []

example:

deployedRecords: {
    deployedDir: "scripts/deployed",
    ignoreContracts: ["MockERC20", "Foo"],
}

4. The scripts/deployed directory's structure and how to use generated functions

when you execute npx hardhat deployed-init [--netwrok <network>] task, it will generate default scripts/deployed directory(if you not set a different deployedDir value in hardhat.config.ts config file).

following is a scripts/deployed directory example:

so, in your deploy scripts, you can use getXxxContract() function to get contract's address; and use setXxxContract(addr) function to set contract's address.

5. Version History

  • v0.3.6 (2023/12/08)

    • fix typo deployd to deployed
  • v0.3.3 (2023/10/13)

    • beautify deployed-list command's output
  • v0.3.2 (2023/10/13)

    • add deployed-list command
  • v0.3.1 (2023/09/15)

    • auto skip solidity library contract
  • v0.3.0 (2023/08/18)

    • auto skip interface type contract
    • support multiple contracts in one solidity file

hardhat-deployed-records's People

Contributors

xiaosongfu avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

cre8

hardhat-deployed-records's Issues

Incomplete instructions

First of all: great project!!!

I tried your command from the readme by running npx hardhat deployed-init [--netwrok <mumbai>], but it throws the error bash: mumbai: No such file or directory. When I ignore the parameter and just run npx hardhat deployed-init it works.

I also saw that you are calling the parameter netwrok instead of network, but I see it not in the code? Was this your intention?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.