Run etherscan validation during the deployment process#1722
Run etherscan validation during the deployment process#1722maurelian merged 2 commits intoregenesis/0.5.0from
Conversation
refactor(contracts): Rename deployAndPostDeploy to deployAndVerifyAndThen
🦋 Changeset detectedLatest commit: c55c4cb The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
cac45aa to
31f5c80
Compare
Codecov Report
@@ Coverage Diff @@
## regenesis/0.5.0 #1722 +/- ##
===================================================
- Coverage 72.64% 72.12% -0.52%
===================================================
Files 69 67 -2
Lines 2274 2167 -107
Branches 337 324 -13
===================================================
- Hits 1652 1563 -89
+ Misses 622 604 -18
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Is it possible to check for an existing verification before performing another one? |
There was a problem hiding this comment.
Usually this, which happens on Kovan because the identical source code has already been verified.
NomicLabsHardhatPluginError: The Etherscan API responded with a failure status.
The verification may still succeed but should be checked manually.
Reason: Already Verified
I could detect that particular error and throw on everything else, but IMO halting the deployment based on an external failure from the Etherscan API would be an overreaction. Catching any errors on this call seems like the best approach, as we can always go back and manually verify a single contract quite easily vs. restarting the process mid-deployment which feels more distuptive to me.
There was a problem hiding this comment.
Yeah that's fine. I'll just request that we open up an issue on GH to make this more robust in the future.
31f5c80 to
c55c4cb
Compare
|
I know that @mslipper is working on replacing hardhat with geth in clique mode, we may need to make additional changes based on that eventually since geth in clique uses a chainid of 1337 |
|
@tynes That sounds great. It should be easy to rename and modify |
Description
Adds a
try/catchwrapped attempt to verify each contract on etherscan immediately after deployment.Testing instructions
Download and apply the patch file attached:
0001-TEMP-commit-for-testing-eng-1632.patch.txt
Set and source the appropriate values in your
.envfile.Open
./scripts/deploy-scripts/kovan.shand modify according to the instructions therein.Run that script.
Expected results
I think that on Kovan, all verification attempts will just give an "error", since identical source code has already been verified on Kovan, but that's OK.
You could try testing on another testnet for a more representative simulation of mainnet.