11import * as fs from 'fs' ;
22import { deployments , ethers } from 'hardhat' ;
33import * as path from 'path' ;
4- import config from '../../utils/config' ;
5-
6- // Get the absolute path to the config file
7- const configPath = path . resolve ( 'config/config.json' ) ;
4+ import localConfig from '../../utils/config' ;
85
96async function main ( ) : Promise < void > {
7+ // Get the absolute path to the config file
8+ const configPath = path . resolve ( 'config/config.json' ) ;
109 // Get network info from ethers
1110 const network = await ethers . provider . getNetwork ( ) ;
1211 const networkName = network . name ;
1312 const chainId = network . chainId . toString ( ) ;
1413
1514 console . log ( `Working with network: ${ networkName } (Chain ID: ${ chainId } )` ) ;
16- const deployment = await deployments . get ( 'DiamondProxy ' ) ;
15+ const deployment = await deployments . get ( 'Diamond ' ) ;
1716 const contractAddress = deployment . address ;
1817
1918 if ( ! contractAddress || contractAddress === 'null' ) {
20- console . error ( `Failed to extract a valid DiamondProxy address from deployment file ` ) ;
19+ console . error ( `Failed to extract a valid Diamond proxy address from Hardhat deployment ` ) ;
2120 process . exit ( 1 ) ;
2221 }
23-
24- console . log ( `Found DiamondProxy address: ${ contractAddress } ` ) ;
25- const localConfig = config ;
22+ console . log ( `Diamond proxy address to save: ${ contractAddress } ` ) ;
2623
2724 // Ensure the chain structure exists
2825 if ( ! localConfig . chains ) {
@@ -31,7 +28,7 @@ async function main(): Promise<void> {
3128
3229 if ( ! localConfig . chains [ chainId ] ) {
3330 localConfig . chains [ chainId ] = {
34- _comment : `Chain ${ chainId } (${ networkName } )` ,
31+ _comment : `Chain ${ networkName } (${ chainId } )` ,
3532 asset : 'Token' , // Default value, update as needed
3633 v3 : {
3734 Hub : null ,
0 commit comments