First, I wasn't able to install the dependencies with yarn@1.22.19. However, I realized that yarn installdid work if I bumped the declared Node version to v18.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 specify customChains in the hardhat.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 d05a496789079b60125a24f386d1a152e1479f4f. (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 both RealityModuleETH and RealityModuleERC20.
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.
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 d05a496789079b60125a24f386d1a152e1479f4f. (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.