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

Feature: blockscout plugin support #5507

Merged

Conversation

rimrakhimov
Copy link
Contributor

@rimrakhimov rimrakhimov commented Jul 10, 2024

Description

The initial blockscout plugin support suggestion: #5224

  • Because this PR includes a bug fix, relevant tests have been included.
  • Because this PR includes a new feature, the change was previously discussed on an Issue or with someone from the team.
  • I didn't do anything of this.

Copy link

changeset-bot bot commented Jul 10, 2024

🦋 Changeset detected

Latest commit: 510c80a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomicfoundation/hardhat-verify Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jul 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 2:39pm

@alcuadrado
Copy link
Member

I had a call with @rimrakhimov, and we decided to review this and get it merged. The intention of this PR is not to use a different blockscout specific API, but to be able to configure and use blockscout as a first-class citizen like etherscan and sourcify.

@alcuadrado
Copy link
Member

@schaable, once you get back, can you review this? You are more familiar with the different providers that the plugin has.

Copy link
Member

@schaable schaable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. There are a few things I'd like to improve, such as the chain list duplication, general messaging, and updating the docs, but we can leave it for a future iteration.

Tests:

  1. Each provider individually (Etherscan with constructor args, Sourcify and Blockscout without constructor args).
  2. All providers simultaneously with constructor args.
  3. All providers simultaneously without constructor args (Etherscan fails, Sourcify and Blockscout succeed).
  4. All providers with an already verified contract.
  5. All providers, with one throwing an error (contract already verified error for Blockscout). This occurred frequently when verifying with all providers. If you visit the contract address in Blockscout, it shows "This contract has been verified using Blockscout Bytecode Database." We may need to update the message to avoid throwing an error in this case.
  6. All providers throwing an error.

@schaable schaable merged commit 963f91f into NomicFoundation:main Sep 11, 2024
24 checks passed
@rimrakhimov
Copy link
Contributor Author

rimrakhimov commented Sep 19, 2024

Hi @schaable , thanks for the review! I'm interested if you want us to implement those changes or you've just added them to your internal backlog? We may probably at least make a PR with updates into documentation

Also, as further enhancements we discussed with @alcuadrado the possibility to

  1. Enhance network list of chains blockscout provider supports by default
  2. Make blockscout provider enabled by default along with etherscan in a way, that if both blockscout and etherscan have the chain information, then verification occurs on both of them

Wdyt about those changes and what do we need to do to have them added?

@pcaversaccio
Copy link
Contributor

pcaversaccio commented Sep 21, 2024

I was quickly testing the plugin. A couple of observations:

  1. I use sourcify as enabled usually in my config and since Blockscout syncs it with Sourcify I don't see any reason why you should again to a verification attempt (since already verified). It only makes sense for chains where Sourcify is not supported but Blockscout is. Otherwise, you always face the following error:

image

  1. The plugin doesn't work programmatically currently as it appears. Put this into your deployment script and you will see:
await hre.run("verify:verify", {
  address: contractAddress,
  constructorArguments: constructorArgs,
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants