hardhat
hardhat copied to clipboard
Invalid API key error
I have had no problem verifying contracts in the past and have my config set up properly and even have manually pasted multiple valid API keys (at different times) as the inputs the the apiKey: variable in the config, but I continually get the invalid API key error. I have tried multiple versions (2.0.0) and the latest 3.0 version and still have this error. I have exhausted all possible debugging steps and need to report this issue because my environment and verification setup is correct but this error keeps happening. Thank you
This issue is also being tracked on Linear.
We use Linear to manage our development process, but we keep the conversations on Github.
LINEAR-ID: 1c8ff924-839d-40ed-8c6a-21f7e5e698f4
Thank you for using Hardhat. If there is a problem in Hardhat, we will need to be able to reproduce it before we can fix it. Please provide more information. See https://stackoverflow.com/help/minimal-reproducible-example
this is my config require('@nomiclabs/hardhat-waffle') require('@nomiclabs/hardhat-web3') require('solidity-coverage') require('dotenv').config() // Include the Etherscan contract verifier. require('@nomiclabs/hardhat-etherscan'); module.exports = { networks: { // --- EVM hardhat: {}, mainnet: { url: process.env.MAINNET_RPC || '', accounts: process.env.MAINNET_PRIVATE_KEY ? [process.env.MAINNET_PRIVATE_KEY] : [], }, avm: { url: process.env.AVM_RPC || '', accounts: process.env.AVM_PRIVATE_KEY ? [process.env.AVM_PRIVATE_KEY] : [], }, rinkeby: { url: process.env.RINKEBY_RPC || '', accounts: process.env.RINKEBY_PRIVATE_KEY ? [process.env.RINKEBY_PRIVATE_KEY] : [], }, rinkeby_avm: { url: process.env.RINKEBY_AVM_RPC || '', accounts: process.env.RINKEBY_AVM_PRIVATE_KEY ? [process.env.RINKEBY_AVM_PRIVATE_KEY] : [], } }, solidity: { version: '0.6.9', settings: { optimizer: { enabled: true, runs: 2000 }, }, }, paths: { sources: './contracts', tests: './test/contracts', cache: './cache', artifacts: './build/contracts', }, etherscan: { apiKey: process.env.ETHERSCAN_API_KEY }, mocha: { timeout: 200000, // 200s }, }
and my env contains a valid API key. I have actually also just manually pasted the API key into where it pulls from the env at times so I know its not some error with incorrectly pulling the env data. I am not able to verify contracts in multiple repos. I have also tried multiple API keys
https://github.com/Ideamarket/ideamarket-contracts here is the repo. I am trying to run npx hardhat verify --network avm on a contract i recently deployed in the imo-user-market branch
Thank you for using Hardhat. If there is a problem in Hardhat, we will need to be able to reproduce it before we can fix it. Please provide more information. See https://stackoverflow.com/help/minimal-reproducible-example
hello? i did such
Thanks for following up. It's important that we get a minimal reproducible example, not one in a large repo.
Sometimes it's acceptable to use a large repo to simply verify that a problem exists, but it's very rarely practical to use such a repo to debug a problem, so even when such a repo has verified the existence of a bug, we will still need a minimal reproduction in order to debug it. Again, see https://stackoverflow.com/help/minimal-reproducible-example
If all you can provide is the verification of the bug within a large repo, please provide very specific instructions on how to reproduce it. Correct me if I'm wrong, but the only instructions you've provided so fare are "run npx hardhat verify --network avm on a contract i recently deployed in the imo-user-market branch". We would need much more information than that, not least of which is the contract in question.
okay here is specific instructions of how to reproduce. In this repo https://github.com/Ideamarket/blockchain-of-opinions I am running npx hardhat verify --network avm 0xe38409367699014145b7ADc41d7EbcD441370633 '0x93f9707adb26d98cfc6d73C8840425010AfA968B' to verify a contract on arbitrum mainnet that I deployed. I get the Invalid API key error. Here is proof the contract exists https://arbiscan.io/address/0xe38409367699014145b7ADc41d7EbcD441370633. THank you
?
Thanks for following up. It's important that we get a minimal reproducible example, not one in a large repo.
Sometimes it's acceptable to use a large repo to simply verify that a problem exists, but it's very rarely practical to use such a repo to debug a problem, so even when such a repo has verified the existence of a bug, we will still need a minimal reproduction in order to debug it. Again, see https://stackoverflow.com/help/minimal-reproducible-example
If all you can provide is the verification of the bug within a large repo, please provide very specific instructions on how to reproduce it. Correct me if I'm wrong, but the only instructions you've provided so fare are "run npx hardhat verify --network avm on a contract i recently deployed in the imo-user-market branch". We would need much more information than that, not least of which is the contract in question.
I responded with a reproducible issue
Thanks for following up. It's important that we get a minimal reproducible example, not one in a large repo.
Sometimes it's acceptable to use a large repo to simply verify that a problem exists, but it's very rarely practical to use such a repo to debug a problem, so even when such a repo has verified the existence of a bug, we will still need a minimal reproduction in order to debug it. Again, see https://stackoverflow.com/help/minimal-reproducible-example
If all you can provide is the verification of the bug within a large repo, please provide very specific instructions on how to reproduce it. Correct me if I'm wrong, but the only instructions you've provided so fare are "run npx hardhat verify --network avm on a contract i recently deployed in the imo-user-market branch". We would need much more information than that, not least of which is the contract in question.
hello? I responded with a reproducible issue.
This issue was marked as stale because it didn't have any activity in the last 30 days. If you think it's still relevant, please leave a comment indicating so. Otherwise, it will be closed in 7 days.
I have some issue as well can you guys help me
Error in plugin @nomiclabs/hardhat-etherscan: Failed to send contract verification request. Endpoint URL: https://cronos-testnet-3.crypto.org:8545 The HTTP server response is not ok. Status code: 415 Response text: invalid content type, only application/json is supported
I could verify a contract with that config after setting an API key in the .env file. I'm going to tentatively close this since I don't think there's a problem on our side.