Repository navigation
chore(deploy): migrate to Hardhat v3 + hardhat-deploy v2 (rocketh) - #14
Merged
Merged
Conversation
Replaces the Hardhat v2 + hardhat-deploy v0.14 (ethers v5) deploy toolchain with Hardhat v3 + hardhat-deploy v2 built on rocketh (viem), matching the parallel-parallelizer setup. Foundation: - package.json: "type": "module"; swap hardhat-deploy@0.14 -> hardhat-deploy@^2, hardhat@^3, rocketh + @rocketh/* (0.19.x), viem, @nomicfoundation/hardhat-viem; drop hardhat-foundry/contract-sizer; scripts: verify -> "rocketh-verify etherscan", add "size". - tsconfig.json: ESM (esnext/bundler), @rocketh and @generated aliases. - hardhat.config.ts: v3 plugins array, networks with type:"http", PRIVATE_KEY accounts, solc 0.8.25/cancun. Hardhat sources pinned to contracts/ with tests redirected so Foundry tests under test/ are not compiled by Hardhat. remappings.txt gains contracts/=contracts/. - rocketh.ts: typed config + deploy/read-execute/proxy/viem extensions, setupDeployScripts, re-exports generated artifacts. - commitlint.config.js -> .cjs (CommonJS under ESM). Deploy scripts (sPRL1/sPRL2/sPRL2V2, MainFeeDistributor, SideChainFeeCollector, RewardMerkleDistributor): - rewritten to the deployScript(env) API: env.deploy({account, artifact, args}); network name via env.name; uint args as BigInt. - deploy/utils switched from ethers v5 to viem (isAddress/zeroAddress); removed the obsolete sPRL2V2 recover script and utils/getVerifyConfig. Verification now uses @rocketh/verifier (ETHERSCAN_API_KEY env); .env.example updated. Validated: tsc --noEmit clean, forge build + hardhat compile generate generated/ artifacts, and an end-to-end deploy dry-run of sPRL1 on an in-memory network succeeds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
Migrates the deployment toolchain from Hardhat v2 + hardhat-deploy v0.14 (ethers v5) to Hardhat v3 + hardhat-deploy v2 built on rocketh (viem), mirroring the
parallel-parallelizersetup. Smart contracts and Foundry tests are unchanged.Motivation: the old
hardhat-deployis unmaintained for Hardhat v3, and its ethers v5 path is what caused the post-deployto:""crash on the recent sPRL2V2 mainnet deploy.Stack
hardhat@3,hardhat-deploy@2,rocketh+@rocketh/*(0.19.x),viem,@nomicfoundation/hardhat-viem. ESM ("type": "module").Changes
Foundation
package.json:"type": "module"; deps swapped; scripts (verify→rocketh-verify etherscan, addsize); droppedhardhat-foundry/hardhat-contract-sizer.tsconfig.json: ESM (esnext/bundler),@rocketh+@generated/*path aliases.hardhat.config.ts: v3pluginsarray, networkstype: "http",PRIVATE_KEYaccounts, solc 0.8.25/cancun. Hardhat sources pinned tocontracts/and its test dir redirected so Foundry tests undertest/are not compiled by Hardhat.remappings.txtgainscontracts/=contracts/.rocketh.ts(new): typed config +deploy/read-execute/proxy/viemextensions,setupDeployScripts, re-exports generated artifacts.commitlint.config.js→.cjs(CommonJS under ESM).Deploy scripts (
sPRL1/sPRL2/sPRL2V2,MainFeeDistributor,SideChainFeeCollector,RewardMerkleDistributor)deployScript(env)API:env.deploy({ account, artifact, args }), network name viaenv.name, uint args asBigInt.deploy/utilsswitched from ethers v5 to viem (isAddress/zeroAddress).sPRL2V2.recover.tsandutils/getVerifyConfig.ts.Verification now uses
@rocketh/verifier(ETHERSCAN_API_KEYenv, Etherscan V2);.env.exampleupdated.Validation (CI green locally)
tsc --noEmitclean.forge fmt --check,solhint,prettier:checkpass.forge build --sizes+hardhat compilegenerategenerated/artifacts.forge test: 188 passed, 0 failed.sPRL1on an in-memory network succeeds (arg encoding + bytecode broadcast + deploy).Notes
parallel-parallelizercommittedrocketh.tsis stale vs its installed rocketh 0.19 (uses the removedsetupAPI); this PR uses the correct 0.19setupDeployScriptsAPI.ETHERSCAN_API_KEY(unified V2 key) in.envfor verification.