Skip to content

Commit ea21739

Browse files
committed
fix: transfer payments contracts ownership to governor in migrate script
Signed-off-by: Tomás Migone <[email protected]>
1 parent 07aa0a2 commit ea21739

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

packages/horizon/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ yarn build
2929

3030
## Deploy
3131

32+
Note that this instructions will help you deploy Graph Horizon contracts, but no data service will be deployed. If you want to deploy the Subgraph Service please refer to the [Subgraph Service README](../subgraph-service/README.md) for deploy instructions.
33+
3234
### New deployment
3335
To deploy Graph Horizon from scratch run the following command:
3436

3537
```bash
3638
npx hardhat run scripts/deploy.ts --network hardhat
3739
```
3840

39-
Note that this will deploy a standalone version of Graph Horizon contracts, meaning the Subgraph Service or any other data service will not be deployed. If you want to deploy the Subgraph Service please refer to the [Subgraph Service README](../subgraph-service/README.md) for deploy instructions.
40-
4141
### Upgrade deployment
4242
To upgrade an existing deployment of the original Graph Protocol to Graph Horizon, run the following command:
4343

4444
```bash
45-
npx hardhat run scripts/migrate.ts --network hardhat
45+
npx hardhat run scripts/migrate.ts --network localhost
4646
```
4747

48-
Note that this will deploy a standalone version of Graph Horizon contracts, meaning the Subgraph Service or any other data service will not be deployed. If you want to deploy the Subgraph Service please refer to the [Subgraph Service README](../subgraph-service/README.md) for deploy instructions.
48+
Usually you would run this against a network (or a fork) where the original Graph Protocol was previously deployed.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const MigrateGraphPaymentsModule = buildModule('GraphPayments', (m) => {
4040
const { GraphPaymentsProxyAdmin, GraphPaymentsProxy } = m.useModule(MigrateHorizonProxiesModule)
4141
const { Controller } = m.useModule(MigratePeripheryModule)
4242

43+
const governor = m.getAccount(1)
4344
const protocolPaymentCut = m.getParameter('protocolPaymentCut')
4445

4546
// Deploy GraphPayments implementation
@@ -59,5 +60,7 @@ export const MigrateGraphPaymentsModule = buildModule('GraphPayments', (m) => {
5960
initArgs: [],
6061
})
6162

63+
m.call(GraphPaymentsProxyAdmin, 'transferOwnership', [governor], { after: [GraphPayments] })
64+
6265
return { GraphPayments, GraphPaymentsProxyAdmin }
6366
})

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const MigratePaymentsEscrowModule = buildModule('PaymentsEscrow', (m) =>
4040
const { PaymentsEscrowProxyAdmin, PaymentsEscrowProxy } = m.useModule(MigrateHorizonProxiesModule)
4141
const { Controller } = m.useModule(MigratePeripheryModule)
4242

43+
const governor = m.getAccount(1)
4344
const withdrawEscrowThawingPeriod = m.getParameter('withdrawEscrowThawingPeriod')
4445

4546
// Deploy PaymentsEscrow implementation
@@ -59,5 +60,7 @@ export const MigratePaymentsEscrowModule = buildModule('PaymentsEscrow', (m) =>
5960
initArgs: [],
6061
})
6162

63+
m.call(PaymentsEscrowProxyAdmin, 'transferOwnership', [governor], { after: [PaymentsEscrow] })
64+
6265
return { PaymentsEscrow, PaymentsEscrowProxyAdmin }
6366
})

packages/horizon/ignition/modules/migrate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default buildModule('GraphHorizon_Migrate', (m) => {
1313
GraphToken,
1414
GraphTokenGateway,
1515
} = m.useModule(MigratePeripheryModule)
16+
1617
const {
1718
HorizonStaking,
1819
GraphPayments,

0 commit comments

Comments
 (0)