greeting
the next link continue part about Multiple API keys and alternative block explorers
when try apply that on my code face "TypeError: etherscan.apiKey.trim is not a function"
1- I add values of api key as environments variables.
2- I use @nomiclabs/hardhat-etherscan plugin for verifying process.
3- I use next command to verify the smart contract:
npx hardhat verify --network matic contract address
that's the code before add multi api key(work correct, without any problem for rinkepy and polygon)
module.exports = {
defaultNetwork: "matic",
networks: {
rinkeby: {
url: RINKEBY_RPC_URL,
accounts: {
mnemonic: MNEMONIC,
},
saveDeployments: true,
},
matic: {
url: Mumbai_RPC_URL,
accounts: {
mnemonic: MNEMONIC,
},
saveDeployments: true,
},
},
etherscan: {
apiKey: ETHERSCAN_API_KEY,
},
next code after add multi api key can help me to know what wrong in it
module.exports = {
defaultNetwork: "matic",
networks: {
rinkeby: {
url: RINKEBY_RPC_URL,
accounts: {
mnemonic: MNEMONIC,
},
saveDeployments: true,
},
matic: {
url: Mumbai_RPC_URL,
accounts: {
mnemonic: MNEMONIC,
},
saveDeployments: true,
},
},
etherscan: {
apiKey: {
rinkeby: ETHERSCAN_API_KEY,
polygonMumbai: POLYGONSCAN_API_KEY,
}
},