-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathdeploy.ts
46 lines (40 loc) · 1.45 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
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,
GraphProxyAdmin,
L2GraphTokenGateway,
L2GraphToken,
RewardsManager,
L2Curation,
} = m.useModule(GraphPeripheryModule)
const {
HorizonStaking,
GraphPayments,
PaymentsEscrow,
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,
L2Curation,
EpochManager,
GraphProxyAdmin,
L2GraphTokenGateway,
L2GraphToken,
RewardsManager,
HorizonStaking,
GraphPayments,
PaymentsEscrow,
GraphTallyCollector,
}
})