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 --sourcify to hardhat ignition verify and deploy #785

Closed
wants to merge 2 commits into from

Conversation

CedarMist
Copy link

@CedarMist CedarMist commented Jun 19, 2024

Closes: #736

This adds the --sourcify and --etherscan flags to the verify and deploy tasks.

The backward compatible --verify option selects both.

sourcify is already supported by hardhat-verify, so pnpm-lock.yaml didn't need modifying.

The hardhat documentation states that you have to set sourcify.enabled = true in your hardhat.config.js file, but given that no API key is required it is available by default.

Example deployment:

$ pnpm hardhat ignition deploy --network sepolia --etherscan  --sourcify ignition/modules/Lock.js 
✔ Confirm deploy to network sepolia (11155111)? … yes

Deployed Addresses

LockModule#Lock - 0x1D0cd93efFfBb44C94b7909cD9B7B02F14098063

Verifying deployed contracts...

 https://sepolia.etherscan.io/address/0x1D0cd93efFfBb44C94b7909cD9B7B02F14098063#code

 https://repo.sourcify.dev/contracts/full_match/11155111/0x1D0cd93efFfBb44C94b7909cD9B7B02F14098063/

Existing deployed contracts can be also be verified with sourcify:

$ pnpm hardhat ignition verify --network sepolia --sourcify  chain-11155111

Verifying deployed contracts...

 https://repo.sourcify.dev/contracts/full_match/11155111/0x1D0cd93efFfBb44C94b7909cD9B7B02F14098063/

@kanej
Copy link
Member

kanej commented Jun 19, 2024

Thanks @CedarMist we will take a look.

@CedarMist
Copy link
Author

After merging I need to do update docs at:

@CedarMist
Copy link
Author

@zoeyTM Can we re-run the workflow? I fixed the minor lint bug, and test error where it would fail if etherscan is not configured (such as when testing sourcify alone)

@HarryR
Copy link

HarryR commented Aug 19, 2024

@kanej Any update? It's been a while

@kanej
Copy link
Member

kanej commented Aug 23, 2024

We massively appreciate the work put in here, but I am afraid we don't intend to merge this PR.

Hardhat is currently in the process of a large upgrade as part of V3, the underlying hardhat-verify plugin is being overhauled including the sourcify support. At that point Ignition, with its own verify support, will be converted over to the new architecture. We want to tackle sourcify support in that context.

@kanej kanej closed this Aug 23, 2024
@CedarMist
Copy link
Author

Ok, that's understandable.

Disappointing as we intended to recommend the projects we support should migrate to or begin with hardhat-ignition, but without sourcify support we can't do that yet.

Thanks for your participation, I'll be keeping an eye on this, and will keep it in our testing matrix.

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

Successfully merging this pull request may close these issues.

Support for verification with sourcify.dev
3 participants