https://github.com/itsnickbarry/hardhat-artifactor
Dynamically generate deployable Hardhat artifacts 🏺
https://github.com/itsnickbarry/hardhat-artifactor
artifacts blockchain buidler compilation ethereum hardhat smart-contracts solc solidity wow
Last synced: 5 months ago
JSON representation
Dynamically generate deployable Hardhat artifacts 🏺
- Host: GitHub
- URL: https://github.com/itsnickbarry/hardhat-artifactor
- Owner: ItsNickBarry
- License: mit
- Created: 2021-02-28T06:55:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-30T20:34:50.000Z (almost 2 years ago)
- Last Synced: 2025-02-03T22:37:26.666Z (over 1 year ago)
- Topics: artifacts, blockchain, buidler, compilation, ethereum, hardhat, smart-contracts, solc, solidity, wow
- Language: TypeScript
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Hardhat Artifactor
Dynamically generate deployable Hardhat contract artifacts.
## Installation
```bash
npm install --save-dev hardhat-artifactor
# or
yarn add --dev hardhat-artifactor
```
## Usage
Load plugin in Hardhat config:
```javascript
require('hardhat-artifactor');
```
### Create Artifact from Template
Call the `createArtifactFromTemplate` function available in the `artifacts` namespace of the Hardhat Runtime Environment to create an artifact with an ABI matching an existing artifact but with custom bytecode:
```javascript
await hre.artifacts.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:
```javascript
await hre.artifacts.overwriteArtifact('Contract', bytecode);
```
## Development
Install dependencies via Yarn:
```bash
yarn install
```
Setup Husky to format code on commit:
```bash
yarn prepare
```