Bump hardhat-etherscan to verify canonical deployments on Sepolia #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intention
My goal was to verify both of the RealityModuleERC20.sol and RealityModuleETH.sol contracts on Etherscan's Sepolia instance.
Steps taken
First, I wasn't able to install the dependencies with
yarn@1.22.19
. However, I realized thatyarn install
did work if I bumped the declared Node version tov18.20.0
. All hardhat tests still pass, and the repo seems to work fine using this updated Node version.Next, Sepolia wasn't supported by the installed
@nomadiclabs/hardhat-etherscan
package. I bumped it just enough to be able to specifycustomChains
in thehardhat.config etherscan
key, and included support for Sepolia.In order to use the hardhat script
yarn hardhat verify --network sepolia <address>
, I had to checkout and compile from commit d05a496. (The branch of this PR comes off of that commit). Otherwise, hardhat complained that the deployed bytecode at the given addresses don't match the bytecode of any local contracts. It seems that there were changes to the contracts since the latest canonical deployments.Next, I had to determine the constructor args used. Unfortunately, the constructor args in the deployment script weren't yielding a successful verification. This kind of makes sense, because those canonical deployments happen from the https://github.com/gnosisguild/zodiac repository, not this one.
Thankfully, I was able to go to the verified contracts on mainnet, and check the values of the given variables which were set by the constructor args.
From there, I was able to successfully run the
yarn hardhat verify --network sepolia [address] [constructor args]
scripts for verifying bothRealityModuleETH
andRealityModuleERC20
.This PR is mostly just meant a paper trail for others, and includes the minimal updates to the repo that allowed me to perform these Etherscan contract verifications.