Skip to content

Commit 07aa0a2

Browse files
committed
chore: move ownership calls for payments contract to their modules
Signed-off-by: Tomás Migone <[email protected]>
1 parent e7b02ae commit 07aa0a2

File tree

5 files changed

+26
-12
lines changed

5 files changed

+26
-12
lines changed

packages/horizon/ignition/modules/core/GraphPayments.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default buildModule('GraphPayments', (m) => {
1111
const { Controller } = m.useModule(GraphPeripheryModule)
1212
const { GraphPaymentsProxyAdmin, GraphPaymentsProxy } = m.useModule(HorizonProxiesModule)
1313

14+
const governor = m.getAccount(1)
1415
const protocolPaymentCut = m.getParameter('protocolPaymentCut')
1516

1617
// Deploy GraphPayments implementation - requires periphery and proxies to be registered in the controller
@@ -30,6 +31,8 @@ export default buildModule('GraphPayments', (m) => {
3031
initArgs: [],
3132
})
3233

34+
m.call(GraphPaymentsProxyAdmin, 'transferOwnership', [governor], { after: [GraphPayments] })
35+
3336
return { GraphPayments, GraphPaymentsProxyAdmin }
3437
})
3538

packages/horizon/ignition/modules/core/PaymentsEscrow.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default buildModule('PaymentsEscrow', (m) => {
1111
const { Controller } = m.useModule(GraphPeripheryModule)
1212
const { PaymentsEscrowProxyAdmin, PaymentsEscrowProxy } = m.useModule(HorizonProxiesModule)
1313

14+
const governor = m.getAccount(1)
1415
const withdrawEscrowThawingPeriod = m.getParameter('withdrawEscrowThawingPeriod')
1516

1617
// Deploy PaymentsEscrow implementation - requires periphery and proxies to be registered in the controller
@@ -30,6 +31,8 @@ export default buildModule('PaymentsEscrow', (m) => {
3031
initArgs: [],
3132
})
3233

34+
m.call(PaymentsEscrowProxyAdmin, 'transferOwnership', [governor], { after: [PaymentsEscrow] })
35+
3336
return { PaymentsEscrow, PaymentsEscrowProxyAdmin }
3437
})
3538

packages/horizon/ignition/modules/core/core.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import TAPCollectorModule, { MigrateTAPCollectorModule } from './TAPCollector'
77

88
export default buildModule('GraphHorizon_Core', (m) => {
99
const { HorizonStaking } = m.useModule(HorizonStakingModule)
10-
const { GraphPayments, GraphPaymentsProxyAdmin } = m.useModule(GraphPaymentsModule)
11-
const { PaymentsEscrow, PaymentsEscrowProxyAdmin } = m.useModule(PaymentsEscrowModule)
10+
const { GraphPayments } = m.useModule(GraphPaymentsModule)
11+
const { PaymentsEscrow } = m.useModule(PaymentsEscrowModule)
1212
const { TAPCollector } = m.useModule(TAPCollectorModule)
1313

14-
return { HorizonStaking, GraphPayments, PaymentsEscrow, TAPCollector, GraphPaymentsProxyAdmin, PaymentsEscrowProxyAdmin }
14+
return { HorizonStaking, GraphPayments, PaymentsEscrow, TAPCollector }
1515
})
1616

1717
export const MigrateHorizonCoreModule = buildModule('GraphHorizon_Core', (m) => {

packages/horizon/ignition/modules/deploy.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,18 @@ export default buildModule('GraphHorizon_Deploy', (m) => {
1818
GraphPayments,
1919
PaymentsEscrow,
2020
TAPCollector,
21-
GraphPaymentsProxyAdmin,
22-
PaymentsEscrowProxyAdmin,
2321
} = m.useModule(GraphHorizonCoreModule)
2422

2523
const governor = m.getAccount(1)
2624

27-
// Accept ownership of Graph Governed based contracts
2825
// BUG?: acceptOwnership should be called after everything in GraphHorizonCoreModule and GraphPeripheryModule is resolved
2926
// but it seems that it's not waiting for interal calls. Waiting on HorizonStaking seems to fix the issue for some reason
3027
// Removing HorizonStaking from the after list will trigger the bug
28+
29+
// Accept ownership of Graph Governed based contracts
3130
m.call(Controller, 'acceptOwnership', [], { from: governor, after: [GraphPeripheryModule, GraphHorizonCoreModule, HorizonStaking] })
3231
m.call(GraphProxyAdmin, 'acceptOwnership', [], { from: governor, after: [GraphPeripheryModule, GraphHorizonCoreModule, HorizonStaking] })
3332

34-
// Transfer ownership of TransparentUpgradeableProxy based contracts
35-
m.call(GraphPaymentsProxyAdmin, 'transferOwnership', [governor], { after: [GraphHorizonCoreModule, HorizonStaking] })
36-
m.call(PaymentsEscrowProxyAdmin, 'transferOwnership', [governor], { after: [GraphHorizonCoreModule, HorizonStaking] })
37-
3833
return {
3934
Controller,
4035
L2Curation,

packages/horizon/ignition/modules/migrate.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,21 @@ import { MigrateHorizonCoreModule } from './core/core'
44
import { MigratePeripheryModule } from './periphery/periphery'
55

66
export default buildModule('GraphHorizon_Migrate', (m) => {
7-
const { L2Curation, RewardsManager, Controller, GraphProxyAdmin, EpochManager, GraphToken, GraphTokenGateway } = m.useModule(MigratePeripheryModule)
8-
const { HorizonStaking, GraphPayments, PaymentsEscrow, TAPCollector } = m.useModule(MigrateHorizonCoreModule)
7+
const {
8+
L2Curation,
9+
RewardsManager,
10+
Controller,
11+
GraphProxyAdmin,
12+
EpochManager,
13+
GraphToken,
14+
GraphTokenGateway,
15+
} = m.useModule(MigratePeripheryModule)
16+
const {
17+
HorizonStaking,
18+
GraphPayments,
19+
PaymentsEscrow,
20+
TAPCollector,
21+
} = m.useModule(MigrateHorizonCoreModule)
922

1023
return {
1124
L2Curation,

0 commit comments

Comments
 (0)