hardhat-abi-exporter
Version:
Export Ethereum smart contract ABIs on compilation
15 lines (11 loc) • 378 B
text/typescript
import { TASK_CLEAN } from 'hardhat/builtin-tasks/task-names';
import { task } from 'hardhat/config';
task(TASK_CLEAN).setAction(async (args, hre, runSuper) => {
await runSuper();
const configs = hre.config.abiExporter.filter((c) => c.clear);
await Promise.all(
configs.map(async (config) =>
hre.run('clear-abi-group', { path: config.path }),
),
);
});