Skip to content

Commit 75fd540

Browse files
Merge pull request #356 from BitGo/CGD-976-hoodeth
feat: add Robinhood Chain (hoodeth) mainnet contract deployment config
2 parents bc99e46 + 17d11f8 commit 75fd540

4 files changed

Lines changed: 39 additions & 8 deletions

File tree

config/chainIds.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const CHAIN_IDS = {
6060
HPP: 190415,
6161
XTZEVM: 42793,
6262
H: 6985385,
63-
HOODETH: 999999, //TODO: update with correct mainnet chain ID when available
63+
HOODETH: 4663,
6464
INKETH: 57073,
6565
HEMIETH: 43111,
6666
ABSTRACTETH: 2741,

deployUtils.ts

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,24 @@ import fs from 'fs';
33
import { BaseContract, getCreateAddress } from 'ethers';
44
import { HardhatRuntimeEnvironment } from 'hardhat/types';
55
import { verifyOnCustomEtherscan } from './scripts/customContractVerifier';
6+
import { CHAIN_IDS } from './config/chainIds';
67

78
const OUTPUT_FILE = 'output.json';
89

10+
// Per-chain verification overrides for chains with slow block times or restricted explorers.
11+
// All other chains use the defaults in VERIFICATION_CONFIG.
12+
const CHAIN_VERIFICATION_OVERRIDES: Partial<
13+
Record<
14+
number,
15+
{
16+
confirmationBlocks: number;
17+
maxRetries: number;
18+
}
19+
>
20+
> = {
21+
[CHAIN_IDS.HOODETH]: { confirmationBlocks: 2, maxRetries: 2 }
22+
};
23+
924
// Balance check configuration
1025
/**
1126
* Safety multiplier for balance checks.
@@ -461,11 +476,21 @@ export async function waitAndVerify(
461476
throw new Error(errorMsg);
462477
}
463478

479+
const chainId = hre.network?.config?.chainId;
480+
const override = chainId ? CHAIN_VERIFICATION_OVERRIDES[chainId] : undefined;
481+
const confirmationBlocks =
482+
override?.confirmationBlocks ?? VERIFICATION_CONFIG.CONFIRMATION_BLOCKS;
483+
const maxRetries = override?.maxRetries ?? VERIFICATION_CONFIG.MAX_RETRIES;
484+
464485
// Wait for block confirmations
465-
const contractAddress = await waitForConfirmations(contract, contractName);
486+
const contractAddress = await waitForConfirmations(
487+
contract,
488+
contractName,
489+
confirmationBlocks
490+
);
466491

467492
// Perform verification with retry logic
468-
for (let attempt = 1; attempt <= VERIFICATION_CONFIG.MAX_RETRIES; attempt++) {
493+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
469494
logger.info(`Verification attempt #${attempt} for ${contractName}...`);
470495

471496
try {
@@ -490,7 +515,7 @@ export async function waitAndVerify(
490515
}
491516

492517
// If we get here, verification failed and we should retry
493-
if (attempt < VERIFICATION_CONFIG.MAX_RETRIES) {
518+
if (attempt < maxRetries) {
494519
const delaySeconds = VERIFICATION_CONFIG.RETRY_DELAY_MS / 1000;
495520
logger.info(`Waiting ${delaySeconds} seconds before retrying...`);
496521
await delay(VERIFICATION_CONFIG.RETRY_DELAY_MS);

hardhat.config.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,8 @@ const config: HardhatUserConfig = {
931931
]
932932
},
933933
hoodeth: {
934-
url: 'https://rpc.testnet.chain.robinhood.com', // TODO: update to mainnet RPC when available
934+
url: 'https://ac23019b22f1ae5a.offchainlabs.com/rpc/a6186cb065b52ca24da0d197e33b303c',
935+
chainId: CHAIN_IDS.HOODETH,
935936
accounts: [
936937
`${PRIVATE_KEY_FOR_V4_CONTRACT_DEPLOYMENT}`,
937938
`${PLACEHOLDER_KEY}`,
@@ -1977,8 +1978,8 @@ const config: HardhatUserConfig = {
19771978
network: 'hoodethMainnet',
19781979
chainId: CHAIN_IDS.HOODETH,
19791980
urls: {
1980-
apiURL: 'https://explorer.testnet.chain.robinhood.com/api', // TODO: update to mainnet explorer API when available
1981-
browserURL: 'https://explorer.testnet.chain.robinhood.com' // TODO: update to mainnet explorer when available
1981+
apiURL: 'https://8crv4vmq6tiu1yqr.blockscout.com/api',
1982+
browserURL: 'https://8crv4vmq6tiu1yqr.blockscout.com'
19821983
}
19831984
},
19841985
{

scripts/chainConfig.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,14 +363,19 @@ export async function getChainConfig(chainId: number): Promise<ChainConfig> {
363363
case CHAIN_IDS.UNICHAIN_TESTNET:
364364
case CHAIN_IDS.HPP:
365365
case CHAIN_IDS.HPP_TESTNET:
366-
case CHAIN_IDS.HOODETH:
367366
case CHAIN_IDS.HOODETH_TESTNET:
368367
case CHAIN_IDS.INKETH:
369368
case CHAIN_IDS.INKETH_TESTNET:
370369
forwarderContractName = 'ForwarderV4';
371370
forwarderFactoryContractName = 'ForwarderFactoryV4';
372371
break;
373372

373+
case CHAIN_IDS.HOODETH:
374+
gasParams = { ...gasParams, gasLimit: 50_000_000 };
375+
forwarderContractName = 'ForwarderV4';
376+
forwarderFactoryContractName = 'ForwarderFactoryV4';
377+
break;
378+
374379
case CHAIN_IDS.H:
375380
case CHAIN_IDS.H_TESTNET:
376381
forwarderContractName = 'ForwarderV4';

0 commit comments

Comments
 (0)