MCPcopy Create free account
hub / github.com/circlefin/arc-node / loadGenesisFile

Function loadGenesisFile

scripts/hardhat/tasks/query-state.ts:43–52  ·  view source on GitHub ↗
(networkName: string)

Source from the content-addressed store, hash-verified

41 * Load genesis.json file based on network name
42 */
43const 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

Callers 1

query-state.tsFile · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected