Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to verify on blast mainnet network etherscan: "Please report this issue to the Hardhat team." #5111

Closed
kneelsdev opened this issue Apr 12, 2024 · 10 comments
Assignees

Comments

@kneelsdev
Copy link

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

@kneelsdev
Copy link
Author

chain info:

    customChains: [
      {
        network: "blast_mainnet",
        chainId: 81457,
        urls: {
          apiURL: "https://api.blastscan.io/",
          browserURL: "https://blastscan.io/",
        },
      },

@luisanton-io
Copy link

Is this just not working?

@kanej
Copy link
Member

kanej commented Apr 24, 2024

@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?

@luisanton-io
Copy link

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

@kanej
Copy link
Member

kanej commented Apr 25, 2024

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

@luisanton-io
Copy link

luisanton-io commented Apr 25, 2024

Thanks for helping @kanej yes I do have api keys set

  etherscan: {
    apiKey: {
      "blast-mainnet": "...",
    },

@0xV4L3NT1N3
Copy link

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/",
        },
      },

@luisanton-io
Copy link

@0xV4L3NT1N3 Thanks, unfortunately, still no luck

@kanej
Copy link
Member

kanej commented May 9, 2024

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.

@kanej kanej closed this as completed May 9, 2024
@kneelsdev
Copy link
Author

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/",
        },
      },

Perfect this did the trick for me, thank you

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

5 participants