Skip to content

ItsNickBarry/hardhat-artifactor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardhat Artifactor

Dynamically generate deployable Hardhat contract artifacts.

Installation

npm install --save-dev hardhat-artifactor
# or
yarn add --dev hardhat-artifactor

Usage

Load plugin in Hardhat config:

require('hardhat-artifactor');

Create Artifact from Template

Call the createArtifactFromTemplate function available in the Hardhat Runtime Environment to create an artifact with an ABI matching an existing artifact but with custom bytecode:

await createArtifactFromTemplate('TemplateContract', 'GeneratedContract', bytecode);

Overwrite Artifact

Call the overwriteArtifact function available in the Hardhat Runtime Environment to replace the bytecode of an existing artifact with custom bytecode:

await overwriteArtifact('Contract', bytecode);