1
1
import * as fs from 'fs'
2
2
import * as mustache from 'mustache'
3
3
// Replace with proper imports once the packages are published
4
- import * as networkAddresses from '/opt/contracts.json'
4
+ import * as horizonAddresses from '/opt/horizon.json'
5
+ import * as subgraphServiceAddresses from '/opt/subgraph-service.json'
5
6
import { Addresses } from './addresses.template'
6
7
7
8
// mustache doesn't like numbered object keys
8
9
// eslint-disable-next-line @typescript-eslint/no-explicit-any
9
- let renameAddresses : any = networkAddresses
10
- renameAddresses [ 'localnetwork' ] = networkAddresses [ '1337' ]
10
+ let renameAddresses : any = {
11
+ horizon : horizonAddresses [ '1337' ] ,
12
+ subgraphService : subgraphServiceAddresses [ '1337' ] ,
13
+ }
11
14
12
15
export let addresses : Addresses = {
13
- controller : '{{localnetwork .Controller.address}}' ,
14
- graphToken : '{{localnetwork .L2GraphToken.address}}' ,
15
- epochManager : '{{localnetwork .EpochManager.address}}' ,
16
- disputeManager : '{{localnetwork .DisputeManager.address}}' ,
17
- staking : '{{localnetwork .HorizonStaking.address}}' ,
18
- stakingExtension : '{{localnetwork .HorizonStaking.address}}' ,
19
- curation : '{{localnetwork .L2Curation.address}}' ,
20
- rewardsManager : '{{localnetwork .RewardsManager.address}}' ,
16
+ controller : '{{horizon .Controller.address}}' ,
17
+ graphToken : '{{horizon .L2GraphToken.address}}' ,
18
+ epochManager : '{{horizon .EpochManager.address}}' ,
19
+ disputeManager : '{{subgraphService .DisputeManager.address}}' ,
20
+ staking : '{{horizon .HorizonStaking.address}}' ,
21
+ stakingExtension : '{{horizon .HorizonStaking.address}}' ,
22
+ curation : '{{horizon .L2Curation.address}}' ,
23
+ rewardsManager : '{{horizon .RewardsManager.address}}' ,
21
24
serviceRegistry : '0x0000000000000000000000000000000000000000' ,
22
- gns : '{{localnetwork .L2GNS.address}}' ,
23
- ens : '{{localnetwork .IENS.address}}' ,
24
- ensPublicResolver : '{{localnetwork .IPublicResolver.address}}' ,
25
+ gns : '{{horizon .L2GNS.address}}' ,
26
+ ens : '{{horizon .IENS.address}}' ,
27
+ ensPublicResolver : '{{horizon .IPublicResolver.address}}' ,
25
28
blockNumber : '' ,
26
29
bridgeBlockNumber : '' ,
27
30
network : '' ,
28
31
tokenLockManager : '' ,
29
- subgraphNFT : '{{localnetwork .SubgraphNFT.address}}' ,
32
+ subgraphNFT : '{{horizon .SubgraphNFT.address}}' ,
30
33
l1GraphTokenGateway : '' ,
31
- l2GraphTokenGateway : '{{localnetwork .L2GraphTokenGateway.address}}' ,
32
- ethereumDIDRegistry : '{{localnetwork .EthereumDIDRegistry.address}}' ,
33
- subgraphService : '{{localnetwork .SubgraphService.address}}' ,
34
- graphPayments : '{{localnetwork .GraphPayments.address}}' ,
34
+ l2GraphTokenGateway : '{{horizon .L2GraphTokenGateway.address}}' ,
35
+ ethereumDIDRegistry : '{{horizon .EthereumDIDRegistry.address}}' ,
36
+ subgraphService : '{{subgraphService .SubgraphService.address}}' ,
37
+ graphPayments : '{{horizon .GraphPayments.address}}' ,
35
38
isL1 : false ,
36
39
}
37
40
@@ -48,12 +51,12 @@ const main = (): void => {
48
51
if ( output . ethereumDIDRegistry == '' ) {
49
52
output . ethereumDIDRegistry = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config
50
53
}
51
- // remove once we have proper packages
52
- if ( output . subgraphService == '' ) {
53
- output . subgraphService = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config
54
+ // TODO: Remove this once subgraph service scripts deploy GNS and SubgraphNFT
55
+ if ( output . gns == '' ) {
56
+ output . gns = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config
54
57
}
55
- if ( output . graphPayments == '' ) {
56
- output . graphPayments = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config
58
+ if ( output . subgraphNFT == '' ) {
59
+ output . subgraphNFT = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config
57
60
}
58
61
fs . writeFileSync ( __dirname + '/generatedAddresses.json' , JSON . stringify ( output , null , 2 ) )
59
62
} catch ( e ) {
0 commit comments