2.0.0 • Published 2 years ago

@spielworksdev/hardhat-plugin v2.0.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
2 years ago

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:

NameExplanation
nameThe name of the smart contract. This corresponds with the name in the solidity file.
argumentsComma separated list of constructor arguments. Array arguments are semicolon separated.
verifyFlag 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:

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

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago