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

Facing issue while verifying contract #5581

Closed
shubhamkr95 opened this issue Aug 7, 2024 · 1 comment
Closed

Facing issue while verifying contract #5581

shubhamkr95 opened this issue Aug 7, 2024 · 1 comment
Assignees

Comments

@shubhamkr95
Copy link

Version of Hardhat

2.22.2

What happened?

While verifying the address on Amoy testnet network using hardhat verify. It was throwing error

An unexpected error occurred during the verification process.
Please report this issue to the Hardhat team.
Error Details: Unexpected token i in JSON at position 0

hardhat-verify found one or more errors during the verification process:

Etherscan:
Etherscan API call failed with status 415, response: invalid content type, only application/json is supported

Minimal reproduction steps

Added the amoy network in hardhat.config.js

etherscan:{
  apiKey: process.env.POLYGONSCAN_KEY,
  customChains: [
    {
      network: "amoy",
      chainId: 80002,
      urls: {
        apiURL: `https://rpc-amoy.polygon.technology`,
        browserURL: "https://amoy.polygonscan.com/"
      }
    },
  ],
},

Search terms

No response

@schaable
Copy link
Member

schaable commented Aug 8, 2024

Hi @shubhamkr95,

It looks like there's an issue with your apiURL. It seems you're using an RPC URL, but you should be using the API URL provided by PolygonScan. You can find more details here.

The correct URL to use would be: https://api-amoy.polygonscan.com/api

Hope this helps! Let me know if you have any questions.

@schaable schaable closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Hardhat Aug 8, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 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

2 participants