use default api key

pull/4070/head
yann300 1 year ago committed by Aniket
parent 557d21f3e7
commit be4118bea9
  1. 8
      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 let data
const compilationTargets = {} const compilationTargets = {}
let etherscanKey if (!etherscanKey) etherscanKey = await plugin.call('config', 'getAppParameter', 'etherscan-access-token')
if (!etherscanKey) etherscanKey = '2HKUX5ZVASZIKWJM8MIQVCRUVZ6JAWT531'
if (!key) etherscanKey = await plugin.call('config', 'getAppParameter', 'etherscan-access-token')
else etherscanKey = key
if (etherscanKey) { if (etherscanKey) {
const endpoint = network.id == 1 ? 'api.etherscan.io' : 'api-' + network.name + '.etherscan.io' const endpoint = network.id == 1 ? 'api.etherscan.io' : 'api-' + network.name + '.etherscan.io'

Loading…
Cancel
Save