hardhat-abi-exporter
Advanced tools
Comparing version 2.10.0 to 2.10.1
{ | ||
"name": "hardhat-abi-exporter", | ||
"version": "2.10.0", | ||
"version": "2.10.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Export Ethereum smart contract ABIs on compilation", |
@@ -10,2 +10,4 @@ # Hardhat ABI Exporter | ||
```bash | ||
npm install --save-dev hardhat-abi-exporter | ||
# or | ||
yarn add --dev hardhat-abi-exporter | ||
@@ -86,2 +88,5 @@ ``` | ||
```bash | ||
npx hardhat export-abi | ||
npx hardhat clear-abi | ||
# or | ||
yarn run hardhat export-abi | ||
@@ -94,2 +99,4 @@ yarn run hardhat clear-abi | ||
```bash | ||
npx hardhat export-abi --no-compile | ||
# or | ||
yarn run hardhat export-abi --no-compile | ||
@@ -96,0 +103,0 @@ ``` |
@@ -69,10 +69,12 @@ const fs = require('fs'); | ||
outputData.reduce(function (acc, { destination }) { | ||
if (acc.has(destination)) { | ||
throw new HardhatPluginError(`duplicate output destination: ${ destination }`); | ||
outputData.reduce(function (acc, { abi, destination }) { | ||
const contents = acc[destination]; | ||
if (contents && JSON.stringify(contents) !== JSON.stringify(abi)) { | ||
throw new HardhatPluginError(`multiple distinct contracts share same output destination: ${ destination }`); | ||
} | ||
acc.add(destination); | ||
acc[destination] = abi; | ||
return acc; | ||
}, new Set()); | ||
}, {}); | ||
@@ -79,0 +81,0 @@ if (config.clear) { |
13938
293
108