Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
"horizonStakingImplementationAddress": "0x2AF6F51e119A79497C3A3FFf012B5889da489764",
"curationImplementationAddress": "0xbC8F4355f346e47eef8A0DBFF4a58616ACf7DaCA",
"rewardsManagerImplementationAddress": "0x856843F6409a8b3A0d4aaE67313037FED02bBBFf",

"disputeManagerAddress": "0x96e1b86b2739e8A3d59F40F2532caDF9cE8Da088",

// Must be set for step 5 of the migration
// Global parameters
"maxThawingPeriod": 2419200
},
Expand Down
1 change: 1 addition & 0 deletions packages/horizon/ignition/configs/migrate.default.json5
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"horizonStakingImplementationAddress": "",
"curationImplementationAddress": "",
"rewardsManagerImplementationAddress": "",
"disputeManagerAddress": "",

// Global parameters
"maxThawingPeriod": 2419200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"horizonStakingImplementationAddress": "",
"curationImplementationAddress": "",
"rewardsManagerImplementationAddress": "",
"disputeManagerAddress": "",

// Global parameters
"maxThawingPeriod": 2419200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"horizonStakingImplementationAddress": "",
"curationImplementationAddress": "",
"rewardsManagerImplementationAddress": "",
"disputeManagerAddress": "",

// Global parameters
"maxThawingPeriod": 2419200
Expand Down
1 change: 1 addition & 0 deletions packages/horizon/ignition/configs/protocol.default.json5
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

// Placeholder address for a standalone Horizon deployment, see README.md for more details
"subgraphServiceAddress": "0x0000000000000000000000000000000000000000",
"disputeManagerAddress": "0x0000000000000000000000000000000000000001",

// Global parameters
"maxThawingPeriod": 2419200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

// Placeholder address for a standalone Horizon deployment, see README.md for more details
"subgraphServiceAddress": "0x0000000000000000000000000000000000000000",
"disputeManagerAddress": "0x0000000000000000000000000000000000000001",

// Global parameters
"maxThawingPeriod": 2419200
Expand Down
10 changes: 10 additions & 0 deletions packages/horizon/ignition/modules/migrate/migrate-4.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import ControllerArtifact from '@graphprotocol/contracts/artifacts/contracts/governance/Controller.sol/Controller.json'
import { buildModule } from '@nomicfoundation/hardhat-ignition/modules'
import { ethers } from 'ethers'

import { MigrateHorizonStakingGovernorModule } from '../core/HorizonStaking'
import { MigrateCurationGovernorModule } from '../periphery/Curation'
Expand All @@ -9,5 +11,13 @@ export default buildModule('GraphHorizon_Migrate_4', (m) => {
m.useModule(MigrateRewardsManagerGovernorModule)
m.useModule(MigrateHorizonStakingGovernorModule)

// Patch controller to override old dispute manager address
const disputeManagerAddress = m.getParameter('disputeManagerAddress')
const controllerAddress = m.getParameter('controllerAddress')
const Controller = m.contractAt('Controller', ControllerArtifact, controllerAddress)
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('DisputeManager')), disputeManagerAddress], {
id: 'setContractProxy_DisputeManager',
})

return {}
})
5 changes: 5 additions & 0 deletions packages/horizon/ignition/modules/periphery/periphery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export default buildModule('GraphHorizon_Periphery', (m) => {
const { L2GraphTokenGateway, L2GraphTokenGatewayImplementation } = m.useModule(GraphTokenGatewayModule)
const { L2GraphToken, L2GraphTokenImplementation } = m.useModule(GraphTokenModule)

const disputeManagerAddress = m.getParameter('disputeManagerAddress')

m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('EpochManager')), EpochManager], {
id: 'setContractProxy_EpochManager',
})
Expand All @@ -45,6 +47,9 @@ export default buildModule('GraphHorizon_Periphery', (m) => {
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('GNS')), L2GNS], {
id: 'setContractProxy_L2GNS',
})
m.call(Controller, 'setContractProxy', [ethers.keccak256(ethers.toUtf8Bytes('DisputeManager')), disputeManagerAddress], {
id: 'setContractProxy_DisputeManager',
})

return {
Controller,
Expand Down
11 changes: 11 additions & 0 deletions packages/horizon/tasks/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,16 @@ function _patchStepConfig<ChainId extends number, ContractName extends string, H
return subgraphServiceAddressBook.getEntry('SubgraphService').address
}

// Get the dispute manager address
// Dispute manager address book might exist if we are running horizon + subgraph service
// or it might not exist if we are running horizon standalone
function getDisputeManagerAddress() {
if (subgraphServiceAddressBook === undefined || !subgraphServiceAddressBook.entryExists('DisputeManager') || standalone) {
return ZERO_ADDRESS
}
return subgraphServiceAddressBook.getEntry('DisputeManager').address ?? ZERO_ADDRESS
}

switch (step) {
case 2:
const GraphPayments = horizonAddressBook.getEntry('GraphPayments')
Expand All @@ -188,6 +198,7 @@ function _patchStepConfig<ChainId extends number, ContractName extends string, H
patchedConfig = patchConfig(patchedConfig, {
$global: {
subgraphServiceAddress: getSubgraphServiceAddress(),
disputeManagerAddress: getDisputeManagerAddress(),
horizonStakingImplementationAddress: HorizonStaking.implementation ?? ZERO_ADDRESS,
curationImplementationAddress: L2Curation.implementation ?? ZERO_ADDRESS,
rewardsManagerImplementationAddress: RewardsManager.implementation ?? ZERO_ADDRESS,
Expand Down
Loading