gnosisguild / zodiac-module-reality

A Zodiac module that uses Reality.eth as an oracle for triggering execution on a Safe.
GNU Lesser General Public License v3.0
101 stars 52 forks source link

Bump hardhat-etherscan to verify canonical deployments on Sepolia #80

Closed adamgall closed 6 days ago

adamgall commented 5 months ago

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 that yarn install did 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.

github-actions[bot] commented 5 months ago

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

adamgall commented 5 months ago

I have read the CLA Document and I hereby sign the CLA

adamgall commented 5 months ago

recheck

juliopavila commented 6 days ago

tracked https://github.com/gnosisguild/zodiac-module-reality/pull/81