@@ -3,9 +3,24 @@ 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 <
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 {
0 commit comments