@@ -3,9 +3,19 @@ import fs from 'fs';
33import { BaseContract , getCreateAddress } from 'ethers' ;
44import { HardhatRuntimeEnvironment } from 'hardhat/types' ;
55import { verifyOnCustomEtherscan } from './scripts/customContractVerifier' ;
6+ import { CHAIN_IDS } from './config/chainIds' ;
67
78const 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 < Record < number , {
13+ confirmationBlocks : number ;
14+ maxRetries : number ;
15+ } > > = {
16+ [ CHAIN_IDS . HOODETH ] : { confirmationBlocks : 2 , maxRetries : 2 }
17+ } ;
18+
919// Balance check configuration
1020/**
1121 * Safety multiplier for balance checks.
@@ -461,11 +471,16 @@ export async function waitAndVerify(
461471 throw new Error ( errorMsg ) ;
462472 }
463473
474+ const chainId = hre . network . config . chainId ;
475+ const override = chainId ? CHAIN_VERIFICATION_OVERRIDES [ chainId ] : undefined ;
476+ const confirmationBlocks = override ?. confirmationBlocks ?? VERIFICATION_CONFIG . CONFIRMATION_BLOCKS ;
477+ const maxRetries = override ?. maxRetries ?? VERIFICATION_CONFIG . MAX_RETRIES ;
478+
464479 // Wait for block confirmations
465- const contractAddress = await waitForConfirmations ( contract , contractName ) ;
480+ const contractAddress = await waitForConfirmations ( contract , contractName , confirmationBlocks ) ;
466481
467482 // Perform verification with retry logic
468- for ( let attempt = 1 ; attempt <= VERIFICATION_CONFIG . MAX_RETRIES ; attempt ++ ) {
483+ for ( let attempt = 1 ; attempt <= maxRetries ; attempt ++ ) {
469484 logger . info ( `Verification attempt #${ attempt } for ${ contractName } ...` ) ;
470485
471486 try {
0 commit comments