1- import { EVMChains , EtherscanConfig , Networks } from "./types" ;
2- import configData from "./config.json" ;
31import * as envEnc from "@chainlink/env-enc" ;
42envEnc . config ( ) ;
53
@@ -9,47 +7,96 @@ const accounts: string[] = [];
97if ( PRIVATE_KEY ) accounts . push ( PRIVATE_KEY ) ;
108if ( PRIVATE_KEY_2 ) accounts . push ( PRIVATE_KEY_2 ) ;
119
12- const networks : Networks = {
13- [ EVMChains . avalancheFuji ] : {
14- type : "http" ,
15- ...configData . avalancheFuji ,
16- url : process . env . AVALANCHE_FUJI_RPC_URL || "https://UNSET-PLEASE-SET-AVALANCHE_FUJI_RPC_URL" ,
17- gasPrice : undefined ,
18- nonce : undefined ,
19- accounts,
10+ export const configData = {
11+ avalancheFuji : {
12+ chainId : 43113 ,
13+ chainSelector : "14767482510784806043" ,
14+ router : "0xF694E193200268f9a4868e4Aa017A0118C9a8177" ,
15+ rmnProxy : "0xAc8CFc3762a979628334a0E4C1026244498E821b" ,
16+ tokenAdminRegistry : "0xA92053a4a3922084d992fD2835bdBa4caC6877e6" ,
17+ registryModuleOwnerCustom : "0x97300785aF1edE1343DB6d90706A35CF14aA3d81" ,
18+ link : "0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846" ,
19+ confirmations : 2 ,
20+ nativeCurrencySymbol : "AVAX" ,
21+ chainType : "l1" ,
22+ chainFamily : "evm"
2023 } ,
21- [ EVMChains . arbitrumSepolia ] : {
22- type : "http" ,
23- ...configData . arbitrumSepolia ,
24- url : process . env . ARBITRUM_SEPOLIA_RPC_URL || "https://UNSET-PLEASE-SET-ARBITRUM_SEPOLIA_RPC_URL" ,
25- gasPrice : undefined ,
26- nonce : undefined ,
27- accounts,
24+ arbitrumSepolia : {
25+ chainId : 421614 ,
26+ chainSelector : "3478487238524512106" ,
27+ router : "0x2a9C5afB0d0e4BAb2BCdaE109EC4b0c4Be15a165" ,
28+ rmnProxy : "0x9527E2d01A3064ef6b50c1Da1C0cC523803BCFF2" ,
29+ tokenAdminRegistry : "0x8126bE56454B628a88C17849B9ED99dd5a11Bd2f" ,
30+ registryModuleOwnerCustom : "0xE625f0b8b0Ac86946035a7729Aba124c8A64cf69" ,
31+ link : "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E" ,
32+ confirmations : 2 ,
33+ nativeCurrencySymbol : "ETH" ,
34+ chainType : "l1" ,
35+ chainFamily : "evm"
2836 } ,
29- [ EVMChains . ethereumSepolia ] : {
30- type : "http" ,
31- ...configData . ethereumSepolia ,
32- url : process . env . ETHEREUM_SEPOLIA_RPC_URL || "https://UNSET-PLEASE-SET-ETHEREUM_SEPOLIA_RPC_URL" ,
33- gasPrice : undefined ,
34- nonce : undefined ,
35- accounts,
37+ ethereumSepolia : {
38+ chainId : 11155111 ,
39+ chainSelector : "16015286601757825753" ,
40+ router : "0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59" ,
41+ rmnProxy : "0xba3f6251de62dED61Ff98590cB2fDf6871FbB991" ,
42+ tokenAdminRegistry : "0x95F29FEE11c5C55d26cCcf1DB6772DE953B37B82" ,
43+ registryModuleOwnerCustom : "0x62e731218d0D47305aba2BE3751E7EE9E5520790" ,
44+ link : "0x779877A7B0D9E8603169DdbD7836e478b4624789" ,
45+ confirmations : 3 ,
46+ nativeCurrencySymbol : "ETH" ,
47+ chainType : "l1" ,
48+ chainFamily : "evm"
3649 } ,
37- [ EVMChains . baseSepolia ] : {
38- type : "http" ,
39- ...configData . baseSepolia ,
40- url : process . env . BASE_SEPOLIA_RPC_URL || "https://UNSET-PLEASE-SET-BASE_SEPOLIA_RPC_URL" ,
41- gasPrice : undefined ,
42- nonce : undefined ,
43- accounts,
50+ baseSepolia : {
51+ chainId : 84532 ,
52+ chainSelector : "10344971235874465080" ,
53+ router : "0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93" ,
54+ rmnProxy : "0x99360767a4705f68CcCb9533195B761648d6d807" ,
55+ tokenAdminRegistry : "0x736D0bBb318c1B27Ff686cd19804094E66250e17" ,
56+ registryModuleOwnerCustom : "0x8A55C61227f26a3e2f217842eCF20b52007bAaBe" ,
57+ link : "0xE4aB69C077896252FAFBD49EFD26B5D171A32410" ,
58+ confirmations : 2 ,
59+ nativeCurrencySymbol : "ETH" ,
60+ chainType : "op" ,
61+ chainFamily : "evm"
4462 } ,
45- [ EVMChains . polygonAmoy ] : {
46- type : "http" ,
47- ...configData . polygonAmoy ,
48- url : process . env . POLYGON_AMOY_RPC_URL || "https://UNSET-PLEASE-SET-POLYGON_AMOY_RPC_URL" ,
49- gasPrice : undefined ,
50- nonce : undefined ,
51- accounts,
63+ polygonAmoy : {
64+ chainId : 80002 ,
65+ chainSelector : "16281711391670634445" ,
66+ router : "0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2" ,
67+ rmnProxy : "0x7c1e545A40750Ee8761282382D51E017BAC68CBB" ,
68+ tokenAdminRegistry : "0x1e73f6842d7afDD78957ac143d1f315404Dd9e5B" ,
69+ registryModuleOwnerCustom : "0x84ad5890A63957C960e0F19b0448A038a574936B" ,
70+ link : "0x0Fd9e8d3aF1aaee056EB9e802c3A762a667b1904" ,
71+ confirmations : 3 ,
72+ nativeCurrencySymbol : "POL" ,
73+ chainType : "l1" ,
74+ chainFamily : "evm"
5275 } ,
76+ solanaDevnet : {
77+ chainId : "EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG" ,
78+ chainSelector : "16423721717087811551" ,
79+ chainType : "generic" ,
80+ chainFamily : "svm"
81+ }
5382} ;
5483
55- export { networks , configData } ;
84+ // Generate Hardhat networks from configData (EVM only)
85+ const networks : Record < string , any > = { } ;
86+
87+ for ( const [ name , config ] of Object . entries ( configData ) ) {
88+ if ( config . chainFamily === "evm" ) {
89+ const envVarName = `${ name . replace ( / ( [ a - z ] ) ( [ A - Z ] ) / g, '$1_$2' ) . toUpperCase ( ) } _RPC_URL` ;
90+ networks [ name ] = {
91+ type : "http" as const ,
92+ ...config ,
93+ url : process . env [ envVarName ] || `https://UNSET-PLEASE-SET-${ envVarName } ` ,
94+ gasPrice : undefined ,
95+ nonce : undefined ,
96+ accounts,
97+ } ;
98+ }
99+ }
100+
101+ export { networks } ;
102+
0 commit comments