hardhat-flat-exporter
v1.0.1
Published
Export flat contract on compilation via Hardhat.
Maintainers
Readme
hardhat-flat-exporter
Export flat contract on compilation via Hardhat.
👾 Additional supplement to the official flatten command
Installation
npm install --save-dev hardhat-flat-exporter
# or
yarn add --dev hardhat-flat-exporterAnd add the following to your hardhat.config.js:
require("hardhat-flat-exporter");Or, if you are using TypeScript, add this to your hardhat.config.ts:
import "hardhat-flat-exporter";Configuration
Configuration is optional.
module.exports = {
flattenExporter: {
src: "./contracts",
path: "./flat",
clear: true,
},
};Options
| option | description | default |
| ------- | -------------------------------------------------------------- | --------------- |
| src | folder path of the target contracts (relative to Hardhat root) | './contracts' |
| path | path to flat sol export directory (relative to Hardhat root) | './flat' |
| clear | whether to delete old flat sol files in path on compilation | true |
Usage
The included Hardhat tasks may be run manually:
npx hardhat export-flat
# or
yarn run hardhat export-flat