From 5e93a874b5311c19f2df992ea0dd13841f46f820 Mon Sep 17 00:00:00 2001 From: Terry Pawn Date: Thu, 27 Jun 2024 15:38:23 +0800 Subject: [PATCH] Add hardhat-abi-exporter --- hardhat.config.ts | 6 ++++++ package.json | 1 + yarn.lock | 43 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index efdf9485..9d4a0909 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -38,6 +38,7 @@ import "./tasks/dev_redemption_nft_metadata"; import "./tasks/test_deploy"; import { ETH_RPC, ETH_CHAIN_ID, DEPLOYER_PK, DEPLOYER_HD_PATH, ETHERSCAN_API_KEY } from "./config"; import "hardhat-gas-reporter"; +import "hardhat-abi-exporter"; const networks: NetworksUserConfig = { hardhat: { @@ -81,5 +82,10 @@ const config: HardhatUserConfig = { enabled: process.env.REPORT_GAS ? true : false, excludeContracts: ["test/", "utils/", "misc/"], }, + abiExporter: { + path: "./artifacts/abi", + runOnCompile: true, + clear: true, + }, }; export default config; diff --git a/package.json b/package.json index 36b271ca..7519dd82 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "ethereum-waffle": "^3.4.0", "ethers": "^5.7.2", "hardhat": "^2.17.0", + "hardhat-abi-exporter": "^2.10.1", "hardhat-gas-reporter": "^1.0.9", "prettier": "^2.8.8", "prettier-plugin-solidity": "^1.1.3", diff --git a/yarn.lock b/yarn.lock index 8e867cf3..76dea225 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2343,6 +2343,13 @@ __metadata: languageName: node linkType: hard +"ansi-colors@npm:^4.1.0": + version: 4.1.3 + resolution: "ansi-colors@npm:4.1.3" + checksum: a9c2ec842038a1fabc7db9ece7d3177e2fe1c5dc6f0c51ecfbf5f39911427b89c00b5dc6b8bd95f82a26e9b16aaae2e83d45f060e98070ce4d1333038edceb0e + languageName: node + linkType: hard + "ansi-escapes@npm:^4.3.0": version: 4.3.2 resolution: "ansi-escapes@npm:4.3.2" @@ -4954,6 +4961,20 @@ __metadata: languageName: node linkType: hard +"delete-empty@npm:^3.0.0": + version: 3.0.0 + resolution: "delete-empty@npm:3.0.0" + dependencies: + ansi-colors: ^4.1.0 + minimist: ^1.2.0 + path-starts-with: ^2.0.0 + rimraf: ^2.6.2 + bin: + delete-empty: bin/cli.js + checksum: 1e2b030346683f49b12460b91d7e1793fc61e9aa0be152a1b31317363632e92426be270f8d635b89d3915ae7da753dcfa6e3bd200f62edf21eaa876ef4443fd2 + languageName: node + linkType: hard + "depd@npm:2.0.0": version: 2.0.0 resolution: "depd@npm:2.0.0" @@ -7381,6 +7402,18 @@ fsevents@~2.1.1: languageName: node linkType: hard +"hardhat-abi-exporter@npm:^2.10.1": + version: 2.10.1 + resolution: "hardhat-abi-exporter@npm:2.10.1" + dependencies: + "@ethersproject/abi": ^5.5.0 + delete-empty: ^3.0.0 + peerDependencies: + hardhat: ^2.0.0 + checksum: 5dba9ebb7bd1002311b504a87cc0f9197ffe5066a61d27073f49bde2adcd080e94ef9e2e696e4fb26c9731df1bed76967e1e0428742af36b37d9c70f9944c98b + languageName: node + linkType: hard + "hardhat-gas-reporter@npm:^1.0.9": version: 1.0.9 resolution: "hardhat-gas-reporter@npm:1.0.9" @@ -10854,6 +10887,13 @@ fsevents@~2.1.1: languageName: node linkType: hard +"path-starts-with@npm:^2.0.0": + version: 2.0.1 + resolution: "path-starts-with@npm:2.0.1" + checksum: c82322343958b092fca962791f98ee338d489ab4c2343a5c8ae10aa26dd5fceb24d86867127cff330a592c6450215f05258441390c1bccc8e318e82ff9912c09 + languageName: node + linkType: hard + "path-to-regexp@npm:0.1.7": version: 0.1.7 resolution: "path-to-regexp@npm:0.1.7" @@ -11923,7 +11963,7 @@ resolve@1.17.0: languageName: node linkType: hard -"rimraf@npm:^2.2.8, rimraf@npm:^2.6.3": +"rimraf@npm:^2.2.8, rimraf@npm:^2.6.2, rimraf@npm:^2.6.3": version: 2.7.1 resolution: "rimraf@npm:2.7.1" dependencies: @@ -13444,6 +13484,7 @@ resolve@1.17.0: ethereum-waffle: ^3.4.0 ethers: ^5.7.2 hardhat: ^2.17.0 + hardhat-abi-exporter: ^2.10.1 hardhat-gas-reporter: ^1.0.9 prettier: ^2.8.8 prettier-plugin-solidity: ^1.1.3