NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.15k stars 1.37k forks source link

Etherscan: An unexpected error occurred during the verification process. #4708

Closed critesjosh closed 8 months ago

critesjosh commented 8 months ago

Version of Hardhat

2.19.0

What happened?

Error trying to verify on Arbitrum Sepolia. Here is the verify command

 npx hardhat verify --network arbitrumSepolia 0x1275f8f414d95508ba13c90586f933edec825cc0 0x834786ba82ba8281c07090a61e05703543f012b6 0x1ceef00eade071a2024f423469f6c059b42b9be7 0x959922be3caee4b8cd9a407cc3ac1c251c2007b1 0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae 0x851d08f30ecd7c7dcb5067ea2d104efc00af36b8 0x9f89187861c6d661af48c8a4df4df43196bd69cf 2

Here is the contract ABI, address, and bytecode

image

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: Source code exceeds max accepted (500k chars) length

Minimal reproduction steps

Run this verify command

 npx hardhat verify --network arbitrumSepolia 0x1275f8f414d95508ba13c90586f933edec825cc0 0x834786ba82ba8281c07090a61e05703543f012b6 0x1ceef00eade071a2024f423469f6c059b42b9be7 0x959922be3caee4b8cd9a407cc3ac1c251c2007b1 0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae 0x851d08f30ecd7c7dcb5067ea2d104efc00af36b8 0x9f89187861c6d661af48c8a4df4df43196bd69cf 2

in the hardhat dir of this repo: https://github.com/Bank-of-JubJub/base

Search terms

No response

schaable commented 8 months ago

Hi @critesjosh. That error originates from the Etherscan API and there's not much we can do in our side. As a workaround, you may need to condense your source code or split it into several contracts. Closing for now, but if you have any more questions or need further assistance, feel free to reopen it or start a new one.

critesjosh commented 8 months ago

Huh. Seems silly that etherscan would have a limit on contract size that is below the on chain limit

schaable commented 8 months ago

Hey @critesjosh, sounds weird, yes. I'm happy to take a look if you can provide a minimal reproducible example

critesjosh commented 8 months ago

I actually refactored my contracts and it's working now. Thanks for the offer though 🙏