hardhat-abi-exporter
Version:
Export Ethereum smart contract ABIs on compilation
18 lines (17 loc) • 744 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const task_names_1 = require("hardhat/builtin-tasks/task-names");
const config_1 = require("hardhat/config");
(0, config_1.task)(task_names_1.TASK_COMPILE)
.addFlag('noExportAbi', "Don't export ABI after running this task, even if runOnCompile option is enabled")
.setAction(async (args, hre, runSuper) => {
await runSuper();
if (!args.noExportAbi && !hre.__SOLIDITY_COVERAGE_RUNNING) {
const configs = hre.config.abiExporter;
await Promise.all(configs.map((abiGroupConfig) => {
if (abiGroupConfig.runOnCompile) {
return hre.run('export-abi-group', { abiGroupConfig });
}
}));
}
});
;