-
Notifications
You must be signed in to change notification settings - Fork 157
/
Copy pathdeploy.ts
66 lines (60 loc) · 2.63 KB
/
deploy.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { buildModule } from '@nomicfoundation/hardhat-ignition/modules'
import GraphHorizonCoreModule from './core/core'
import GraphPeripheryModule from './periphery/periphery'
export default buildModule('GraphHorizon_Deploy', (m) => {
const {
Controller,
EpochManager,
EpochManagerImplementation,
GraphProxyAdmin,
L2GraphTokenGateway,
L2GraphTokenGatewayImplementation,
L2GraphToken,
L2GraphTokenImplementation,
RewardsManager,
RewardsManagerImplementation,
L2Curation,
L2CurationImplementation,
} = m.useModule(GraphPeripheryModule)
const {
HorizonStaking,
HorizonStakingImplementation,
GraphPaymentsProxyAdmin,
GraphPayments,
GraphPaymentsImplementation,
PaymentsEscrowProxyAdmin,
PaymentsEscrow,
PaymentsEscrowImplementation,
GraphTallyCollector,
} = m.useModule(GraphHorizonCoreModule)
const governor = m.getAccount(1)
// BUG?: acceptOwnership should be called after everything in GraphHorizonCoreModule and GraphPeripheryModule is resolved
// but it seems that it's not waiting for interal calls. Waiting on HorizonStaking seems to fix the issue for some reason
// Removing HorizonStaking from the after list will trigger the bug
// Accept ownership of Graph Governed based contracts
m.call(Controller, 'acceptOwnership', [], { from: governor, after: [GraphPeripheryModule, GraphHorizonCoreModule, HorizonStaking] })
m.call(GraphProxyAdmin, 'acceptOwnership', [], { from: governor, after: [GraphPeripheryModule, GraphHorizonCoreModule, HorizonStaking] })
return {
Controller,
Graph_Proxy_EpochManager: EpochManager,
Implementation_EpochManager: EpochManagerImplementation,
Graph_Proxy_L2Curation: L2Curation,
Implementation_L2Curation: L2CurationImplementation,
Graph_Proxy_RewardsManager: RewardsManager,
Implementation_RewardsManager: RewardsManagerImplementation,
Graph_Proxy_L2GraphTokenGateway: L2GraphTokenGateway,
Implementation_L2GraphTokenGateway: L2GraphTokenGatewayImplementation,
Graph_Proxy_L2GraphToken: L2GraphToken,
Implementation_L2GraphToken: L2GraphTokenImplementation,
GraphProxyAdmin,
Graph_Proxy_HorizonStaking: HorizonStaking,
Implementation_HorizonStaking: HorizonStakingImplementation,
Transparent_ProxyAdmin_GraphPayments: GraphPaymentsProxyAdmin,
Transparent_Proxy_GraphPayments: GraphPayments,
Implementation_GraphPayments: GraphPaymentsImplementation,
Transparent_ProxyAdmin_PaymentsEscrow: PaymentsEscrowProxyAdmin,
Transparent_Proxy_PaymentsEscrow: PaymentsEscrow,
Implementation_PaymentsEscrow: PaymentsEscrowImplementation,
GraphTallyCollector,
}
})