Skip to content

Commit b95a4c3

Browse files
committed
chore(ecdsa): migrate to hardhat-verify and add Sepolia network support
This commit updates the hardhat verification tooling and adds support for Sepolia testnet deployments: Changes: - Replace deprecated @nomiclabs/hardhat-etherscan with @nomicfoundation/hardhat-verify - Add Sepolia external artifacts directory for dependency resolution - Add allowlist weights configuration for Sepolia network - Include RandomBeacon, T token, and TokenStaking contract artifacts for Sepolia - Add deployment function IDs to all deploy scripts for better tracking - Remove unused mainnet OpenZeppelin deployment metadata - Update package dependencies and lockfiles These changes enable deployment and testing on Sepolia while modernizing the verification infrastructure to use the latest Hardhat tooling.
1 parent 03b8763 commit b95a4c3

15 files changed

+40426
-5969
lines changed

solidity/ecdsa/.openzeppelin/mainnet.json

Lines changed: 0 additions & 954 deletions
This file was deleted.

solidity/ecdsa/deploy/01_deploy_ecdsa_sortition_pool.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ func.tags = ["EcdsaSortitionPool"]
4444
// TokenStaking and T deployments are expected to be resolved from
4545
// @threshold-network/solidity-contracts
4646
func.dependencies = ["TokenStaking", "T"]
47+
func.id = "deploy_ecdsa_sortition_pool"

solidity/ecdsa/deploy/02_deploy_dkg_validator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ export default func
3030

3131
func.tags = ["EcdsaDkgValidator"]
3232
func.dependencies = ["EcdsaSortitionPool"]
33+
func.id = "deploy_ecdsa_dkg_validator"

solidity/ecdsa/deploy/03_deploy_wallet_registry.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
55
const { getNamedAccounts, deployments, ethers, helpers } = hre
66
const { deployer } = await getNamedAccounts()
77

8+
// Skip if WalletRegistry already deployed (for existing testnet deployments)
9+
const existingWalletRegistry = await deployments.getOrNull("WalletRegistry")
10+
if (existingWalletRegistry) {
11+
console.log(`using existing WalletRegistry at ${existingWalletRegistry.address}`)
12+
return true
13+
}
14+
815
const EcdsaSortitionPool = await deployments.get("EcdsaSortitionPool")
916
const TokenStaking = await deployments.get("TokenStaking")
1017
const ReimbursementPool = await deployments.get("ReimbursementPool")
@@ -79,3 +86,4 @@ func.dependencies = [
7986
"TokenStaking",
8087
"EcdsaDkgValidator",
8188
]
89+
func.id = "deploy_wallet_registry"

solidity/ecdsa/deploy/16_initialize_allowlist_weights.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
4646

4747
// Load pre-calculated weights from JSON
4848
// These weights include accumulated stakes from consolidated beta stakers
49-
const weightsPath = path.join(__dirname, "data/allowlist-weights.json")
49+
// Use network-specific file if available
50+
const networkSpecificPath = path.join(__dirname, `data/allowlist-weights-${hre.network.name}.json`)
51+
const defaultPath = path.join(__dirname, "data/allowlist-weights.json")
52+
const weightsPath = fs.existsSync(networkSpecificPath) ? networkSpecificPath : defaultPath
5053

5154
if (!fs.existsSync(weightsPath)) {
5255
throw new Error(
@@ -309,6 +312,7 @@ export default func
309312

310313
func.tags = ["InitializeAllowlistWeights"]
311314
func.dependencies = ["Allowlist", "UpgradeWalletRegistryV2"]
315+
func.id = "initialize_allowlist_weights"
312316

313317
// Only run this script when explicitly requested
314318
func.skip = async () => !process.env.MIGRATE_ALLOWLIST_WEIGHTS

0 commit comments

Comments
 (0)