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

Add support for Blockscout #1313

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Add support for Blockscout #1313

wants to merge 1 commit into from

Conversation

kronosapiens
Copy link
Member

@kronosapiens kronosapiens commented Dec 10, 2024

Closes #1286

Instructions:

Starting Blockscout (1 tab)

  1. Clone the Blockscout repo (https://github.com/blockscout/blockscout)
  2. Cd into blockscout/docker-compose and run docker compose -f hardhat-network.yml up (-d to daemonize)

Blockscout will start running on localhost:80 by default

Starting Hardhat (2 tabs)

  1. Run npx hardhat node as per usual
  2. Run npx hardhat deploy --network development as per usual

At this point Blockscout will start picking up the transactions

Todo:

Currently, contract verification is not working. This is as far as I've gotten:

>> npx hardhat verify --network development 0x777760996135F0791E2e1a74aFAa060711197777  --contract contracts/common/EtherRouter.sol:EtherRouter        
Successfully submitted source code for contract
contracts/common/EtherRouter.sol:EtherRouter at 0x777760996135F0791E2e1a74aFAa060711197777
for verification on the block explorer. Waiting for verification result...

We tried verifying your contract EtherRouter without including any unrelated one, but it failed.
Trying again with the full solc input used to compile and deploy it.
This means that unrelated contracts may be displayed on Etherscan...

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

Etherscan:
A network request failed. This is an error from the block explorer, not Hardhat. Error: Unexpected token '<', "<html>
<h"... is not valid JSON

I've debugged enough to confirm that the API is live, but for some reason the 2nd step (verifying with the full solc input) returns an HTML response, which breaks the verifier.

Resources:

https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify

https://docs.blockscout.com/devs/verification/hardhat-verification-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explore chain visualizers
1 participant