Skip to content

Commit 4266a81

Browse files
committed
chore: update ignition to v0.15.9
Signed-off-by: Tomás Migone <[email protected]>
1 parent 9556549 commit 4266a81

File tree

12 files changed

+213
-468
lines changed

12 files changed

+213
-468
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import GraphPaymentsArtifact from '../../../build/contracts/contracts/payments/G
77

88
// TODO: transfer ownership of ProxyAdmin???
99
export default buildModule('GraphPayments', (m) => {
10-
const { Controller, PeripheryRegistered } = m.useModule(GraphPeripheryModule)
11-
const { GraphPaymentsProxyAdmin, GraphPaymentsProxy, HorizonRegistered } = m.useModule(HorizonProxiesModule)
10+
const { Controller } = m.useModule(GraphPeripheryModule)
11+
const { GraphPaymentsProxyAdmin, GraphPaymentsProxy } = m.useModule(HorizonProxiesModule)
1212

1313
const protocolPaymentCut = m.getParameter('protocolPaymentCut')
1414

@@ -17,7 +17,7 @@ export default buildModule('GraphPayments', (m) => {
1717
GraphPaymentsArtifact,
1818
[Controller, protocolPaymentCut],
1919
{
20-
after: [PeripheryRegistered, HorizonRegistered],
20+
after: [GraphPeripheryModule, HorizonProxiesModule],
2121
},
2222
)
2323

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

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ import { ethers } from 'ethers'
55
import GraphPeripheryModule from '../periphery'
66
import GraphProxyAdminModule from '../periphery/GraphProxyAdmin'
77

8-
import DummyArtifact from '../../../build/contracts/contracts/mocks/Dummy.sol/Dummy.json'
98
import GraphProxyArtifact from '@graphprotocol/contracts/build/contracts/contracts/upgrades/GraphProxy.sol/GraphProxy.json'
109

1110
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
1211

1312
// HorizonStaking, GraphPayments and PaymentsEscrow use GraphDirectory but they also in the directory.
1413
// So we need to deploy their proxies, register them in the controller before being able to deploy the implementations
1514
export default buildModule('HorizonProxies', (m) => {
16-
const { Controller, PeripheryRegistered } = m.useModule(GraphPeripheryModule)
15+
const { Controller } = m.useModule(GraphPeripheryModule)
1716
const { GraphProxyAdmin } = m.useModule(GraphProxyAdminModule)
1817

1918
const isMigrate = m.getParameter('isMigrate', false)
@@ -25,7 +24,7 @@ export default buildModule('HorizonProxies', (m) => {
2524
HorizonStakingProxy = m.contractAt('GraphProxy', GraphProxyArtifact, horizonStakingProxyAddress, { id: 'GraphProxy_HorizonStaking' })
2625
setProxyHorizonStaking = HorizonStakingProxy
2726
} else {
28-
HorizonStakingProxy = m.contract('GraphProxy', GraphProxyArtifact, [ZERO_ADDRESS, GraphProxyAdmin], { after: [PeripheryRegistered], id: 'GraphProxy_HorizonStaking' })
27+
HorizonStakingProxy = m.contract('GraphProxy', GraphProxyArtifact, [ZERO_ADDRESS, GraphProxyAdmin], { id: 'GraphProxy_HorizonStaking' })
2928
setProxyHorizonStaking = m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('Staking')), HorizonStakingProxy], { id: 'setContractProxy_HorizonStaking' })
3029
}
3130

@@ -36,18 +35,8 @@ export default buildModule('HorizonProxies', (m) => {
3635
// Register the proxies in the controller
3736
// if isMigrate then use from: governor
3837
const options = isMigrate ? { from: m.getAccount(1) } : {}
39-
const setProxyGraphPayments = m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphPayments')), GraphPaymentsProxy], { ...options, id: 'setContractProxy_GraphPayments' })
40-
const setProxyPaymentsEscrow = m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('PaymentsEscrow')), PaymentsEscrowProxy], { ...options, id: 'setContractProxy_PaymentsEscrow' })
41-
42-
// Deploy dummy contract to signal that all periphery contracts are registered
43-
const HorizonRegistered = m.contract('Dummy', DummyArtifact, [], {
44-
id: 'RegisteredDummy',
45-
after: [
46-
setProxyHorizonStaking,
47-
setProxyGraphPayments,
48-
setProxyPaymentsEscrow,
49-
],
50-
})
51-
52-
return { HorizonStakingProxy, GraphPaymentsProxy, PaymentsEscrowProxy, HorizonRegistered, GraphPaymentsProxyAdmin, PaymentsEscrowProxyAdmin }
38+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphPayments')), GraphPaymentsProxy], { ...options, id: 'setContractProxy_GraphPayments' })
39+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('PaymentsEscrow')), PaymentsEscrowProxy], { ...options, id: 'setContractProxy_PaymentsEscrow' })
40+
41+
return { HorizonStakingProxy, GraphPaymentsProxy, PaymentsEscrowProxy, GraphPaymentsProxyAdmin, PaymentsEscrowProxyAdmin }
5342
})

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import HorizonStakingExtensionModule from './HorizonStakingExtension'
77
import HorizonStakingArtifact from '../../../build/contracts/contracts/staking/HorizonStaking.sol/HorizonStaking.json'
88

99
export default buildModule('HorizonStaking', (m) => {
10-
const { Controller, GraphProxyAdmin, PeripheryRegistered } = m.useModule(GraphPeripheryModule)
11-
const { HorizonStakingProxy, HorizonRegistered } = m.useModule(HorizonProxiesModule)
10+
const { Controller, GraphProxyAdmin } = m.useModule(GraphPeripheryModule)
11+
const { HorizonStakingProxy } = m.useModule(HorizonProxiesModule)
1212
const { HorizonStakingExtension } = m.useModule(HorizonStakingExtensionModule)
1313

1414
const subgraphServiceAddress = m.getParameter('subgraphServiceAddress')
@@ -22,7 +22,7 @@ export default buildModule('HorizonStaking', (m) => {
2222
subgraphServiceAddress,
2323
],
2424
{
25-
after: [PeripheryRegistered, HorizonRegistered],
25+
after: [GraphPeripheryModule, HorizonProxiesModule],
2626
},
2727
)
2828

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import ExponentialRebatesArtifact from '../../../build/contracts/contracts/staki
77
import HorizonStakingExtensionArtifact from '../../../build/contracts/contracts/staking/HorizonStakingExtension.sol/HorizonStakingExtension.json'
88

99
export default buildModule('HorizonStakingExtension', (m) => {
10-
const { Controller, PeripheryRegistered } = m.useModule(GraphPeripheryModule)
11-
const { HorizonRegistered } = m.useModule(HorizonProxiesModule)
10+
const { Controller } = m.useModule(GraphPeripheryModule)
1211

1312
const subgraphServiceAddress = m.getParameter('subgraphServiceAddress')
1413

@@ -19,7 +18,7 @@ export default buildModule('HorizonStakingExtension', (m) => {
1918
libraries: {
2019
ExponentialRebates: ExponentialRebates,
2120
},
22-
after: [PeripheryRegistered, HorizonRegistered],
21+
after: [GraphPeripheryModule, HorizonProxiesModule],
2322
})
2423

2524
return { HorizonStakingExtension }

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import PaymentsEscrowArtifact from '../../../build/contracts/contracts/payments/
77

88
// TODO: transfer ownership of ProxyAdmin???
99
export default buildModule('PaymentsEscrow', (m) => {
10-
const { Controller, PeripheryRegistered } = m.useModule(GraphPeripheryModule)
11-
const { PaymentsEscrowProxyAdmin, PaymentsEscrowProxy, HorizonRegistered } = m.useModule(HorizonProxiesModule)
10+
const { Controller } = m.useModule(GraphPeripheryModule)
11+
const { PaymentsEscrowProxyAdmin, PaymentsEscrowProxy } = m.useModule(HorizonProxiesModule)
1212

1313
const withdrawEscrowThawingPeriod = m.getParameter('withdrawEscrowThawingPeriod')
1414

@@ -17,7 +17,7 @@ export default buildModule('PaymentsEscrow', (m) => {
1717
PaymentsEscrowArtifact,
1818
[Controller, withdrawEscrowThawingPeriod],
1919
{
20-
after: [PeripheryRegistered, HorizonRegistered],
20+
after: [GraphPeripheryModule, HorizonProxiesModule],
2121
},
2222
)
2323

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ import HorizonProxiesModule from './HorizonProxies'
66
import TAPCollectorArtifact from '../../../build/contracts/contracts/payments/collectors/TAPCollector.sol/TAPCollector.json'
77

88
export default buildModule('TAPCollector', (m) => {
9-
const { Controller, PeripheryRegistered } = m.useModule(GraphPeripheryModule)
10-
const { HorizonRegistered } = m.useModule(HorizonProxiesModule)
9+
const { Controller } = m.useModule(GraphPeripheryModule)
1110

1211
const name = m.getParameter('eip712Name')
1312
const version = m.getParameter('eip712Version')
1413
const revokeSignerThawingPeriod = m.getParameter('revokeSignerThawingPeriod')
1514

16-
const TAPCollector = m.contract('TAPCollector', TAPCollectorArtifact, [name, version, Controller, revokeSignerThawingPeriod], { after: [PeripheryRegistered, HorizonRegistered] })
15+
const TAPCollector = m.contract(
16+
'TAPCollector',
17+
TAPCollectorArtifact,
18+
[name, version, Controller, revokeSignerThawingPeriod],
19+
{ after: [GraphPeripheryModule, HorizonProxiesModule] },
20+
)
1721

1822
return { TAPCollector }
1923
})

packages/horizon/ignition/modules/periphery.ts

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import GraphTokenGatewayModule from './periphery/GraphTokenGateway'
1010
import GraphTokenModule from './periphery/GraphToken'
1111
import RewardsManagerModule from './periphery/RewardsManager'
1212

13-
import DummyArtifact from '../../build/contracts/contracts/mocks/Dummy.sol/Dummy.json'
14-
1513
export default buildModule('GraphHorizon_Periphery', (m) => {
1614
const { BridgeEscrow } = m.useModule(BridgeEscrowModule)
1715
const { Controller } = m.useModule(ControllerModule)
@@ -25,34 +23,20 @@ export default buildModule('GraphHorizon_Periphery', (m) => {
2523

2624
const isMigrate = m.getParameter('isMigrate', false)
2725

28-
let PeripheryRegistered
2926
if (!isMigrate) {
3027
// Register contracts in the Controller
31-
const setProxyEpochManager = m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('EpochManager')), EpochManager], { id: 'setContractProxy_EpochManager' })
32-
const setProxyRewardsManager = m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('RewardsManager')), RewardsManager], { id: 'setContractProxy_RewardsManager' })
33-
const setProxyGraphToken = m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphToken')), GraphToken], { id: 'setContractProxy_GraphToken' })
34-
const setProxyGraphTokenGateway = m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphTokenGateway')), GraphTokenGateway], { id: 'setContractProxy_GraphTokenGateway' })
28+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('EpochManager')), EpochManager], { id: 'setContractProxy_EpochManager' })
29+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('RewardsManager')), RewardsManager], { id: 'setContractProxy_RewardsManager' })
30+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphToken')), GraphToken], { id: 'setContractProxy_GraphToken' })
31+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphTokenGateway')), GraphTokenGateway], { id: 'setContractProxy_GraphTokenGateway' })
3532
// eslint-disable-next-line no-secrets/no-secrets
36-
const setProxyGraphProxyAdmin = m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphProxyAdmin')), GraphProxyAdmin], { id: 'setContractProxy_GraphProxyAdmin' })
37-
const setProxyCuration = m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('Curation')), Curation], { id: 'setContractProxy_Curation' })
38-
39-
// Deploy dummy contract to signal that all periphery contracts are registered
40-
PeripheryRegistered = m.contract('Dummy', DummyArtifact, [], {
41-
after: [
42-
setProxyEpochManager,
43-
setProxyRewardsManager,
44-
setProxyGraphToken,
45-
setProxyGraphTokenGateway,
46-
setProxyGraphProxyAdmin,
47-
setProxyCuration,
48-
],
49-
})
33+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphProxyAdmin')), GraphProxyAdmin], { id: 'setContractProxy_GraphProxyAdmin' })
34+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('Curation')), Curation], { id: 'setContractProxy_Curation' })
5035
} else {
5136
// TODO: Remove if not needed
5237
const governor = m.getAccount(1)
5338
// eslint-disable-next-line no-secrets/no-secrets
54-
const setProxyGraphProxyAdmin = m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphProxyAdmin')), GraphProxyAdmin], { id: 'setContractProxy_GraphProxyAdmin', from: governor })
55-
PeripheryRegistered = m.contract('Dummy', DummyArtifact, [], { after: [setProxyGraphProxyAdmin] })
39+
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GraphProxyAdmin')), GraphProxyAdmin], { id: 'setContractProxy_GraphProxyAdmin', from: governor })
5640
}
5741

5842
return {
@@ -64,6 +48,5 @@ export default buildModule('GraphHorizon_Periphery', (m) => {
6448
GraphToken,
6549
GraphTokenGateway,
6650
RewardsManager,
67-
PeripheryRegistered,
6851
}
6952
})

packages/horizon/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
"@nomicfoundation/hardhat-ethers": "^3.0.8",
2525
"@nomicfoundation/hardhat-foundry": "^1.1.1",
2626
"@nomicfoundation/hardhat-ignition": "^0.15.9",
27-
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.8",
27+
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.9",
2828
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
2929
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
3030
"@nomicfoundation/hardhat-verify": "^2.0.10",
31-
"@nomicfoundation/ignition-core": "^0.15.8",
31+
"@nomicfoundation/ignition-core": "^0.15.9",
3232
"@openzeppelin/contracts": "^5.0.2",
3333
"@openzeppelin/contracts-upgradeable": "^5.0.2",
3434
"@typechain/ethers-v6": "^0.5.0",
@@ -40,7 +40,7 @@
4040
"eslint": "^8.56.0",
4141
"eslint-graph-config": "workspace:^0.0.1",
4242
"ethers": "^6.13.4",
43-
"hardhat": "^2.22.0",
43+
"hardhat": "^2.22.18",
4444
"hardhat-contract-sizer": "^2.10.0",
4545
"hardhat-gas-reporter": "^1.0.8",
4646
"hardhat-graph-protocol": "workspace:^0.0.1",

packages/horizon/scripts/deploy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ async function main() {
99

1010
// Deploy Horizon
1111
await ignition.deploy(HorizonModule, {
12+
displayUi: true,
1213
parameters: HorizonConfig,
1314
})
1415
}

packages/subgraph-service/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
2525
"@nomicfoundation/hardhat-ethers": "^3.0.8",
2626
"@nomicfoundation/hardhat-foundry": "^1.1.1",
27-
"@nomicfoundation/hardhat-ignition": "^0.15.8",
28-
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.8",
27+
"@nomicfoundation/hardhat-ignition": "^0.15.9",
28+
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.9",
2929
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
3030
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
3131
"@nomicfoundation/hardhat-verify": "^2.0.10",
32-
"@nomicfoundation/ignition-core": "^0.15.8",
32+
"@nomicfoundation/ignition-core": "^0.15.9",
3333
"@openzeppelin/contracts": "^5.0.2",
3434
"@openzeppelin/contracts-upgradeable": "^5.0.2",
3535
"@typechain/ethers-v6": "^0.5.0",
@@ -40,8 +40,8 @@
4040
"chai": "^4.2.0",
4141
"eslint": "^8.56.0",
4242
"eslint-graph-config": "workspace:^0.0.1",
43-
"ethers": "^6.13.2",
44-
"hardhat": "^2.20.1",
43+
"ethers": "^6.13.4",
44+
"hardhat": "^2.22.18",
4545
"hardhat-contract-sizer": "^2.10.0",
4646
"hardhat-gas-reporter": "^1.0.8",
4747
"hardhat-graph-protocol": "workspace:^0.0.1",

0 commit comments

Comments
 (0)