NomicFoundation / hardhat

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

sourcify verification failure #5260

Closed gibsfinancedev closed 2 months ago

gibsfinancedev commented 4 months ago

Version of Hardhat

2.20

What happened?

for sourcify verification to be successful

npx hardhat --network mainnet verify 0x07B7DDc8a1ee0806ce45c3f019c7626d67F27659 0x1715a3E4A142d8b698131108995174F37aEBA10D 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 0xAF2ce0189f46f5663715b0b9ED2a10eA924AB9B0
The contract 0x07B7DDc8a1ee0806ce45c3f019c7626d67F27659 has already been verified on Etherscan.
https://etherscan.io/address/0x07B7DDc8a1ee0806ce45c3f019c7626d67F27659#code
Sourcify:
An unexpected error occurred during the verification process.
Please report this issue to the Hardhat team.
Error Details: Failed to send contract verification request.
Endpoint URL: https://sourcify.dev/server
The HTTP server response is not ok. Status code: 500 Response text: {"error":"Resource missing; unsuccessful fetching: contracts/helpers/TransientReentrancy.sol"}

the contract listed is different half of the time. so it seems like it might be related to a file read bug or something similar?

Minimal reproduction steps

have 10+ files deploy to mainnet verify with etherscan and enable the sourcify config profit

Search terms

No response

gibsfinancedev commented 4 months ago

can create a minimal reproducible if this description is not sufficient

schaable commented 3 months ago

Hi @gibsfinancedev, sorry for the delayed response. I tested this with a sample project and 10+ copies of the Lock contract using the Sepolia network:

➜ hh ignition deploy ./ignition/modules/Lock.ts --network sepolia
βœ” Confirm deploy to network sepolia (11155111)? … yes
Compiled 1 Solidity file successfully (evm target: paris).
Hardhat Ignition πŸš€

Deploying [ LockModule ]

Batch #1
  Executed LockModule#Lock

[ LockModule ] successfully deployed πŸš€

Deployed Addresses

LockModule#Lock - 0x78fB6E066FC263B33e4f193AE12b92e7F02b2200
➜ hh verify --network sepolia 0x78fB6E066FC263B33e4f193AE12b92e7F02b2200 1893456000
Successfully submitted source code for contract
contracts/Lock.sol:Lock at 0x78fB6E066FC263B33e4f193AE12b92e7F02b2200
for verification on the block explorer. Waiting for verification result...

Successfully verified contract Lock on the block explorer.
https://sepolia.etherscan.io/address/0x78fB6E066FC263B33e4f193AE12b92e7F02b2200#code

Successfully verified contract Lock on Sourcify.
https://repo.sourcify.dev/contracts/full_match/11155111/0x78fB6E066FC263B33e4f193AE12b92e7F02b2200/

Unfortunately, I wasn't able to reproduce the error. Does it still happen for you? If so, could you provide a minimal reproducible example?

One thing I noticed is that you're passing multiple addresses to the verify task. The task can only verify one contract at a time, so all other addresses after the first one would be interpreted as constructor arguments for your contract.

schaable commented 2 months ago

Hey @gibsfinancedev, I'm assuming this issue is no longer occurring for you, so I'll go ahead and close it. If that's not the case and you can provide a minimal example, please leave a comment and I'll be happy to reopen it.