Giter Club home page Giter Club logo

hardhat-plugin's Introduction

Spielworks Hardhat tasks

This module exposes some useful Hardhat tasks.

Installation

Install the plugins via

npm install --save @spielworksdev/hardhat-plugin

Or add to package.json:

{
  "devDependencies": {
    "@nomicfoundation/hardhat-toolbox": "^3.0.0",
    "@spielworksdev/hardhat-plugin": "^2.0.0",
    "hardhat": "^2.17.0"
  }
}

and run npm i.

Then add this line to hardhat.config.ts to enable the plugin:

import '@spielworksdev/hardhat-plugin'

Features

Tasks

Deploy smart contract

A task to deploy a smart contract to a chain. The smart contract must be part of the project and is referenced by name.

Usage:

npx hardhat deploy-smart-contract --name $ContractName --arguments 0x...,4096 --verify

Arguments:

Name Explanation
name The name of the smart contract. This corresponds with the name in the solidity file.
arguments Comma separated list of constructor arguments. Array arguments are semicolon separated.
verify Flag to verify the deployed contract. Optional. Requires Etherscan/Polygonscan etc key to be set up in hardhat.config.ts

Deploy proxy

A task to deploy a TransparentUpgradeableProxy from OpenZeppelin to another smart contract.

Both the proxy solidity file and the proxied smart contract must be part of the project.

Usage:

npx hardhat deploy-proxy --address 0x... --proxy-owner 0x... --name $ProxiedContractName \
  --initializer-function $initialize --arguments 0x...,4096 --verify

Arguments:

Name Explanation
address The address of the implementation to proxy to
proxy-owner The address owning the proxy (should be a deployed ProxyAdmin contract, but this is not required)
name The name of the smart contract being proxied. This corresponds with the name in the solidity file.
proxy-name The name of the proxy smart contract (defaults to TransparentUpgradeableProxy)
initializer-function Name of a function in contract to call (constructor replacement)
arguments Arguments to initializer-function, comma separated. Array arguemnts are semicolon separated.
verify Flag to verify the proxy source code. Optional. Requires Etherscan/Polygonscan etc key to be set up in hardhat.config.ts

hardhat-plugin's People

Contributors

frontierpsychiatrist avatar

Watchers

Adrian avatar

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.