@nomiclabs/hardhat-etherscan
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -97,7 +97,7 @@ "use strict"; | ||
}, | ||
optimisticKovan: { | ||
chainId: 69, | ||
optimisticGoerli: { | ||
chainId: 420, | ||
urls: { | ||
apiURL: "https://api-kovan-optimistic.etherscan.io/api", | ||
browserURL: "https://kovan-optimistic.etherscan.io/", | ||
apiURL: "https://api-goerli-optimistic.etherscan.io/api", | ||
browserURL: "https://goerli-optimistic.etherscan.io/", | ||
}, | ||
@@ -171,6 +171,13 @@ }, | ||
urls: { | ||
apiURL: "https://blockscout.com/xdai/mainnet/api", | ||
browserURL: "https://blockscout.com/xdai/mainnet", | ||
apiURL: "https://api.gnosisscan.io/api", | ||
browserURL: "https://gnosisscan.io", | ||
}, | ||
}, | ||
gnosis: { | ||
chainId: 100, | ||
urls: { | ||
apiURL: "https://api.gnosisscan.io/api", | ||
browserURL: "https://gnosisscan.io", | ||
}, | ||
}, | ||
sokol: { | ||
@@ -211,3 +218,6 @@ chainId: 77, | ||
}, | ||
// We are not adding new networks to the core of hardhat-etherscan anymore. | ||
// Please read this to learn how to manually add support for custom networks: | ||
// https://github.com/NomicFoundation/hardhat/tree/master/packages/hardhat-etherscan#adding-support-for-other-networks | ||
}; | ||
//# sourceMappingURL=ChainConfig.js.map |
@@ -38,3 +38,3 @@ "use strict"; | ||
const customConfig = cloneDeep(config.etherscan); | ||
resolvedConfig.etherscan = Object.assign(Object.assign({}, defaultConfig), customConfig); | ||
resolvedConfig.etherscan = { ...defaultConfig, ...customConfig }; | ||
} | ||
@@ -41,0 +41,0 @@ else { |
@@ -33,3 +33,3 @@ "use strict"; | ||
const { request } = await Promise.resolve().then(() => __importStar(require("undici"))); | ||
const parameters = new URLSearchParams(Object.assign({}, req)); | ||
const parameters = new URLSearchParams({ ...req }); | ||
const method = "POST"; | ||
@@ -73,3 +73,3 @@ const requestDetails = { | ||
async function getVerificationStatus(url, req) { | ||
const parameters = new URLSearchParams(Object.assign({}, req)); | ||
const parameters = new URLSearchParams({ ...req }); | ||
const urlWithQuery = new URL(url); | ||
@@ -76,0 +76,0 @@ urlWithQuery.search = parameters.toString(); |
@@ -70,3 +70,2 @@ "use strict"; | ||
const verifySubtask = async ({ address, constructorArguments, contract: contractFQN, libraries }, { config, network, run }) => { | ||
var _a; | ||
const { etherscan } = config; | ||
@@ -131,4 +130,4 @@ const { isAddress } = await Promise.resolve().then(() => __importStar(require("@ethersproject/address"))); | ||
// without the Optimism plugin should not have that field in their type definitions | ||
const configCopy = Object.assign({}, config); | ||
const ovmSolcVersion = (_a = configCopy.ovm) === null || _a === void 0 ? void 0 : _a.solcVersion; | ||
const configCopy = { ...config }; | ||
const ovmSolcVersion = configCopy.ovm?.solcVersion; | ||
if (ovmSolcVersion === undefined) { | ||
@@ -396,4 +395,7 @@ const message = `It looks like you are verifying an OVM contract, but do not have an OVM solcVersion specified in the hardhat config.`; | ||
const { libraryLinks, undetectableLibraries } = await (0, libraries_1.getLibraryLinks)(contractInformation, libraries); | ||
return Object.assign(Object.assign({}, contractInformation), { libraryLinks, | ||
undetectableLibraries }); | ||
return { | ||
...contractInformation, | ||
libraryLinks, | ||
undetectableLibraries, | ||
}; | ||
}); | ||
@@ -400,0 +402,0 @@ (0, config_1.subtask)(constants_1.TASK_VERIFY_VERIFY_MINIMUM_BUILD) |
@@ -24,3 +24,3 @@ "use strict"; | ||
} | ||
const network = networkInCustomChains !== null && networkInCustomChains !== void 0 ? networkInCustomChains : chainIdsToNames.get(chainID); | ||
const network = networkInCustomChains ?? chainIdsToNames.get(chainID); | ||
if (network === undefined) { | ||
@@ -27,0 +27,0 @@ (0, errors_1.throwUnsupportedNetwork)(networkName, chainID); |
@@ -90,5 +90,11 @@ "use strict"; | ||
if (analyzedBytecode !== null) { | ||
return Object.assign(Object.assign({}, analyzedBytecode), { compilerInput: buildInfo.input, compilerOutput: buildInfo.output, solcVersion: buildInfo.solcVersion, sourceName, | ||
return { | ||
...analyzedBytecode, | ||
compilerInput: buildInfo.input, | ||
compilerOutput: buildInfo.output, | ||
solcVersion: buildInfo.solcVersion, | ||
sourceName, | ||
contractName, | ||
contract }); | ||
contract, | ||
}; | ||
} | ||
@@ -95,0 +101,0 @@ return null; |
@@ -54,3 +54,3 @@ "use strict"; | ||
Visit https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html#libraries-with-undetectable-addresses to learn how to solve this.`; | ||
Visit https://hardhat.org/hardhat-runner/plugins/nomiclabs-hardhat-etherscan#libraries-with-undetectable-addresses to learn how to solve this.`; | ||
} | ||
@@ -57,0 +57,0 @@ else { |
@@ -32,3 +32,3 @@ "use strict"; | ||
} | ||
catch (_a) { | ||
catch { | ||
// The decoding failed. Unfortunately, our only option is to assume that this bytecode was emitted by an old version. | ||
@@ -35,0 +35,0 @@ // Technically, this bytecode could have been emitted by a compiler for another language altogether. |
{ | ||
"name": "@nomiclabs/hardhat-etherscan", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Hardhat plugin for verifying contracts on etherscan", | ||
@@ -29,2 +29,3 @@ "repository": "github:nomiclabs/hardhat", | ||
"build": "tsc --build .", | ||
"prepublishOnly": "yarn build", | ||
"clean": "rimraf dist" | ||
@@ -56,5 +57,5 @@ }, | ||
"@types/mocha": "^9.1.0", | ||
"@types/node": "^12.0.0", | ||
"@types/node": "^14.0.0", | ||
"@types/semver": "^6.0.2", | ||
"@typescript-eslint/eslint-plugin": "4.29.2", | ||
"@typescript-eslint/eslint-plugin": "^5.30.7", | ||
"@typescript-eslint/parser": "4.29.2", | ||
@@ -68,3 +69,3 @@ "chai": "^4.2.0", | ||
"hardhat": "^2.0.4", | ||
"mocha": "^9.2.0", | ||
"mocha": "^10.0.0", | ||
"prettier": "2.4.1", | ||
@@ -71,0 +72,0 @@ "rimraf": "^3.0.2", |
@@ -96,7 +96,7 @@ import { ChainConfig } from "./types"; | ||
}, | ||
optimisticKovan: { | ||
chainId: 69, | ||
optimisticGoerli: { | ||
chainId: 420, | ||
urls: { | ||
apiURL: "https://api-kovan-optimistic.etherscan.io/api", | ||
browserURL: "https://kovan-optimistic.etherscan.io/", | ||
apiURL: "https://api-goerli-optimistic.etherscan.io/api", | ||
browserURL: "https://goerli-optimistic.etherscan.io/", | ||
}, | ||
@@ -170,6 +170,13 @@ }, | ||
urls: { | ||
apiURL: "https://blockscout.com/xdai/mainnet/api", | ||
browserURL: "https://blockscout.com/xdai/mainnet", | ||
apiURL: "https://api.gnosisscan.io/api", | ||
browserURL: "https://gnosisscan.io", | ||
}, | ||
}, | ||
gnosis: { | ||
chainId: 100, | ||
urls: { | ||
apiURL: "https://api.gnosisscan.io/api", | ||
browserURL: "https://gnosisscan.io", | ||
}, | ||
}, | ||
sokol: { | ||
@@ -210,2 +217,5 @@ chainId: 77, | ||
}, | ||
// We are not adding new networks to the core of hardhat-etherscan anymore. | ||
// Please read this to learn how to manually add support for custom networks: | ||
// https://github.com/NomicFoundation/hardhat/tree/master/packages/hardhat-etherscan#adding-support-for-other-networks | ||
}; |
@@ -81,3 +81,3 @@ import { NomicLabsHardhatPluginError } from "hardhat/plugins"; | ||
Visit https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html#libraries-with-undetectable-addresses to learn how to solve this.`; | ||
Visit https://hardhat.org/hardhat-runner/plugins/nomiclabs-hardhat-etherscan#libraries-with-undetectable-addresses to learn how to solve this.`; | ||
} else { | ||
@@ -84,0 +84,0 @@ message += ` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
234168
4089