| 41 | * Load genesis.json file based on network name |
| 42 | */ |
| 43 | const loadGenesisFile = (networkName: string): Record<string, GenesisAccountAlloc> => { |
| 44 | const genesisPath = path.join(__dirname, `../../../assets/${networkName}/genesis.json`) |
| 45 | const genesisData = fs.readFileSync(genesisPath, 'utf-8') |
| 46 | const genesis = JSON.parse(genesisData) as { alloc?: Record<string, GenesisAccountAlloc> } |
| 47 | |
| 48 | if (!genesis.alloc || typeof genesis.alloc !== 'object') { |
| 49 | throw new Error('Invalid genesis file format: missing or invalid alloc section') |
| 50 | } |
| 51 | return genesis.alloc |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Common helper to get implementation address from proxy storage |