hardhat
hardhat copied to clipboard
Error trying to verify on blast mainnet network etherscan: "Please report this issue to the Hardhat team."
Version of Hardhat
2.12.4
What happened?
Error details
hardhat-verify found one or more errors during the verification process:
Etherscan:
An unexpected error occurred during the verification process.
Please report this issue to the Hardhat team.
Error Details: Unexpected token '<', "
<!DOCTYPE "... is not valid JSON
Minimal reproduction steps
Hardhat config can be found here: https://github.com/guminc/contracts
set sourcify enabled: false, try to verify contract on custom chain.
Search terms
error, verify, etherscan
chain info:
customChains: [
{
network: "blast_mainnet",
chainId: 81457,
urls: {
apiURL: "https://api.blastscan.io/",
browserURL: "https://blastscan.io/",
},
},
Is this just not working?
@luisanton-io this looks as if blastscan is returning an error as html (so not a hardhat-verify
issue).
What are you seeing? The same <!DOCTYPE "... is not valid JSON
?
Yes, <!DOCTYPE
etc error. I tried with another config though, which returns an apparently encouraging message:
Successfully submitted source code for contract
This is my config now:
{
network: "blast-mainnet",
chainId: 81457,
urls: {
apiURL:
"https://api.routescan.io/v2/network/mainnet/evm/81457/etherscan",
browserURL: "https://blastscan.io/",
},
},
Too bad it's hanging forever and ultimately failing. Open to suggestions if anyone got it working
Do you need to set an API key for blastscan?
It would need to under the same name as you use for the network (i.e. blast-mainnet
):
https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify#multiple-api-keys-and-alternative-block-explorers
Thanks for helping @kanej yes I do have api keys set
etherscan: {
apiKey: {
"blast-mainnet": "...",
},
The correct endpoint should include the /api
path, try correcting your config to
customChains: [
{
network: "blast_mainnet",
chainId: 81457,
urls: {
apiURL: "https://api.blastscan.io/api",
browserURL: "https://blastscan.io/",
},
},
@0xV4L3NT1N3 Thanks, unfortunately, still no luck
Hey, we believe this is a blast api issue. We are working on improving our error reporting to provide more information in these cases, but we don't think there is more for Hardhat to do here.
The correct endpoint should include the
/api
path, try correcting your config tocustomChains: [ { network: "blast_mainnet", chainId: 81457, urls: { apiURL: "https://api.blastscan.io/api", browserURL: "https://blastscan.io/", }, },
Perfect this did the trick for me, thank you