From be4118bea9b4cac3f80383d08a7a0e98eae9ff6d Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 14 Sep 2023 16:00:43 +0200 Subject: [PATCH] use default api key --- .../src/lib/helpers/fetch-etherscan.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts b/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts index 1592663c38..5cc8460d72 100644 --- a/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts +++ b/libs/remix-core-plugin/src/lib/helpers/fetch-etherscan.ts @@ -1,10 +1,8 @@ -export const fetchContractFromEtherscan = async (plugin, network, contractAddress, targetPath, shouldSetFile = true, key?) => { +export const fetchContractFromEtherscan = async (plugin, network, contractAddress, targetPath, shouldSetFile = true, etherscanKey?) => { let data const compilationTargets = {} - let etherscanKey - - if (!key) etherscanKey = await plugin.call('config', 'getAppParameter', 'etherscan-access-token') - else etherscanKey = key + if (!etherscanKey) etherscanKey = await plugin.call('config', 'getAppParameter', 'etherscan-access-token') + if (!etherscanKey) etherscanKey = '2HKUX5ZVASZIKWJM8MIQVCRUVZ6JAWT531' if (etherscanKey) { const endpoint = network.id == 1 ? 'api.etherscan.io' : 'api-' + network.name + '.etherscan.io' @@ -63,4 +61,4 @@ export const fetchContractFromEtherscan = async (plugin, network, contractAddres settings, compilationTargets } -} \ No newline at end of file +}