From ba40a741832f591fba21c16ccd8f7fbe183a9abe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1s=20Migone?= <tomas@edgeandnode.com>
Date: Thu, 14 Nov 2024 15:10:15 -0300
Subject: [PATCH] chore: bump ignition version to 0.15.7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
---
 packages/horizon/README.md                    |  8 ++--
 ...zon.hardhat.json => horizon.hardhat.json5} | 24 +++-------
 packages/horizon/package.json                 |  2 +-
 packages/horizon/scripts/deploy.ts            | 16 -------
 packages/subgraph-service/README.md           | 22 ++++++----
 ...at.json => subgraph-service.hardhat.json5} |  4 +-
 packages/subgraph-service/scripts/deploy.ts   |  4 +-
 yarn.lock                                     | 44 ++++++++++++++++++-
 8 files changed, 74 insertions(+), 50 deletions(-)
 rename packages/horizon/ignition/configs/{horizon.hardhat.json => horizon.hardhat.json5} (59%)
 delete mode 100644 packages/horizon/scripts/deploy.ts
 rename packages/subgraph-service/ignition/configs/{subgraph-service.hardhat.json => subgraph-service.hardhat.json5} (79%)

diff --git a/packages/horizon/README.md b/packages/horizon/README.md
index 4b0954953..76ddbf9b9 100644
--- a/packages/horizon/README.md
+++ b/packages/horizon/README.md
@@ -4,14 +4,16 @@ Graph Horizon is the next evolution of the Graph Protocol.
 
 ## Deployment 
 
-We use Hardhat Ignition to deploy the contracts. To build and deploy the contracts run the following commands:
+We use Hardhat Ignition to deploy the contracts. To build and deploy Graph Horizon run the following commands:
 
 ```bash
 yarn install
 yarn build
 npx hardhat ignition deploy ./ignition/modules/horizon.ts \
-  --parameters ./ignition/configs/horizon.hardhat.json \
+  --parameters ./ignition/configs/horizon.hardhat.json5 \
   --network hardhat
 ```
 
-You can use any network defined in `hardhat.config.ts` by replacing `hardhat` with the network name.
\ No newline at end of file
+You can use any network defined in `hardhat.config.ts` by replacing `hardhat` with the network name.
+
+Note that this will deploy a standalone version of Graph Horizon contracts, meaning the Subgraph Service will not be deployed. If you want to deploy both please refer to the [Subgraph Service README](../subgraph-service/README.md) for deploy instructions.
\ No newline at end of file
diff --git a/packages/horizon/ignition/configs/horizon.hardhat.json b/packages/horizon/ignition/configs/horizon.hardhat.json5
similarity index 59%
rename from packages/horizon/ignition/configs/horizon.hardhat.json
rename to packages/horizon/ignition/configs/horizon.hardhat.json5
index ef16c8136..a0dcc4aee 100644
--- a/packages/horizon/ignition/configs/horizon.hardhat.json
+++ b/packages/horizon/ignition/configs/horizon.hardhat.json5
@@ -1,37 +1,27 @@
 {
-  "GraphProxyAdmin": {
-    "governor": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"
-  },
-  "Controller": {
+  "$global": {
     "governor": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0",
-    "pauseGuardian": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC"
-  },
-  "RewardsManager": {
+    "pauseGuardian": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC",
     "subgraphAvailabilityOracle": "0xd03ea8624C8C5987235048901fB614fDcA89b117",
-    "issuancePerBlock": "114155251141552511415n",
+    // Placeholder address for a standalone Horizon deployment, see README.md for more detals
     "subgraphServiceAddress": "0x0000000000000000000000000000000000000000"
   },
+  "RewardsManager": {
+    "issuancePerBlock": "114155251141552511415n"
+  },
   "EpochManager": {
     "epochLength": 60
   },
-  "GraphTokenGateway": {
-    "pauseGuardian": "0x95cED938F7991cd0dFcb48F0a06a40FA1aF46EBC"
-  },
   "Curation": {
     "curationTaxPercentage": 10000,
     "minimumCurationDeposit": 1
   },
   "GraphToken": {
-    "initialSupply": "10000000000000000000000000000n",
-    "governor": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"
+    "initialSupply": "10000000000000000000000000000n"
   },
   "HorizonStaking": {
-    "subgraphServiceAddress": "0x0000000000000000000000000000000000000000",
     "maxThawingPeriod": 2419200
   },
-  "HorizonStakingExtension": {
-    "subgraphServiceAddress": "0x0000000000000000000000000000000000000000"
-  },
   "GraphPayments": {
     "protocolPaymentCut": 10000
   },
diff --git a/packages/horizon/package.json b/packages/horizon/package.json
index 4c6624051..a43bf3f72 100644
--- a/packages/horizon/package.json
+++ b/packages/horizon/package.json
@@ -17,7 +17,7 @@
     "@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
     "@nomicfoundation/hardhat-ethers": "^3.0.8",
     "@nomicfoundation/hardhat-foundry": "^1.1.1",
-    "@nomicfoundation/hardhat-ignition": "^0.15.5",
+    "@nomicfoundation/hardhat-ignition": "^0.15.7",
     "@nomicfoundation/hardhat-ignition-ethers": "^0.15.5",
     "@nomicfoundation/hardhat-network-helpers": "^1.0.0",
     "@nomicfoundation/hardhat-toolbox": "^4.0.0",
diff --git a/packages/horizon/scripts/deploy.ts b/packages/horizon/scripts/deploy.ts
deleted file mode 100644
index 5a94398d2..000000000
--- a/packages/horizon/scripts/deploy.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ignition } from 'hardhat'
-
-import Parameters from '../ignition/configs/horizon.hardhat.json'
-import PeripheryModule from '../ignition/modules/periphery'
-
-async function main() {
-  await ignition.deploy(PeripheryModule, {
-    parameters: Parameters,
-  })
-}
-
-main()
-  .catch((error) => {
-    console.error(error)
-    process.exit(1)
-  })
diff --git a/packages/subgraph-service/README.md b/packages/subgraph-service/README.md
index 7be82e5d6..dbd580740 100644
--- a/packages/subgraph-service/README.md
+++ b/packages/subgraph-service/README.md
@@ -1,13 +1,17 @@
-# Sample Hardhat Project
+# 🌅 Subgraph Service 🌅
 
-This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.
+The Subgraph Service is a data service designed to work with Graph Horizon that supports indexing subgraphs and serving queries to consumers.
 
-Try running some of the following tasks:
+## Deployment 
 
-```shell
-npx hardhat help
-npx hardhat test
-REPORT_GAS=true npx hardhat test
-npx hardhat node
-npx hardhat run scripts/deploy.ts
+We use Hardhat Ignition to deploy the contracts. To build and deploy the Subgraph Service run the following commands:
+
+```bash
+yarn install
+yarn build
+npx hardhat run scripts/deploy.ts --network hardhat
 ```
+
+You can use any network defined in `hardhat.config.ts` by replacing `hardhat` with the network name.
+
+Note that this will deploy and configure Graph Horizon contracts as well as the Subgraph Service.
\ No newline at end of file
diff --git a/packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json b/packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json5
similarity index 79%
rename from packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json
rename to packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json5
index c1a248448..12db4cf12 100644
--- a/packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json
+++ b/packages/subgraph-service/ignition/configs/subgraph-service.hardhat.json5
@@ -1,6 +1,8 @@
 {
+  "$global": {
+    "arbitrator": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0"
+  },
   "DisputeManager": {
-    "arbitrator": "0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0",
     "disputePeriod": 2419200,
     "disputeDeposit": "10000000000000000000000n",
     "fishermanRewardCut": 500000,
diff --git a/packages/subgraph-service/scripts/deploy.ts b/packages/subgraph-service/scripts/deploy.ts
index 17ff2feb2..32f798d6e 100644
--- a/packages/subgraph-service/scripts/deploy.ts
+++ b/packages/subgraph-service/scripts/deploy.ts
@@ -17,8 +17,8 @@ import SubgraphServiceProxiesModule from '../ignition/modules/Proxies'
 // - Deploy SubgraphService and DisputeManager implementations
 async function main() {
   // TODO: Dynamically load config file based on the hardhat --network value
-  const HorizonConfig = removeNFromBigInts(require('@graphprotocol/horizon/ignition/configs/horizon.hardhat.json'))
-  const SubgraphServiceConfig = removeNFromBigInts(require('../ignition/configs/subgraph-service.hardhat.json'))
+  const HorizonConfig = removeNFromBigInts(require('@graphprotocol/horizon/ignition/configs/horizon.hardhat.json5'))
+  const SubgraphServiceConfig = removeNFromBigInts(require('../ignition/configs/subgraph-service.hardhat.json5'))
 
   // Deploy proxies
   const { DisputeManagerProxy, DisputeManagerProxyAdmin, SubgraphServiceProxy, SubgraphServiceProxyAdmin } = await ignition.deploy(SubgraphServiceProxiesModule)
diff --git a/yarn.lock b/yarn.lock
index 4cfd396f1..b92bb282d 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2933,7 +2933,7 @@ __metadata:
     "@nomicfoundation/hardhat-chai-matchers": "npm:^2.0.0"
     "@nomicfoundation/hardhat-ethers": "npm:^3.0.8"
     "@nomicfoundation/hardhat-foundry": "npm:^1.1.1"
-    "@nomicfoundation/hardhat-ignition": "npm:^0.15.5"
+    "@nomicfoundation/hardhat-ignition": "npm:^0.15.7"
     "@nomicfoundation/hardhat-ignition-ethers": "npm:^0.15.5"
     "@nomicfoundation/hardhat-network-helpers": "npm:^1.0.0"
     "@nomicfoundation/hardhat-toolbox": "npm:^4.0.0"
@@ -4707,6 +4707,24 @@ __metadata:
   languageName: node
   linkType: hard
 
+"@nomicfoundation/hardhat-ignition@npm:^0.15.7":
+  version: 0.15.7
+  resolution: "@nomicfoundation/hardhat-ignition@npm:0.15.7"
+  dependencies:
+    "@nomicfoundation/ignition-core": "npm:^0.15.7"
+    "@nomicfoundation/ignition-ui": "npm:^0.15.7"
+    chalk: "npm:^4.0.0"
+    debug: "npm:^4.3.2"
+    fs-extra: "npm:^10.0.0"
+    json5: "npm:^2.2.3"
+    prompts: "npm:^2.4.2"
+  peerDependencies:
+    "@nomicfoundation/hardhat-verify": ^2.0.1
+    hardhat: ^2.18.0
+  checksum: a5ed2b4fb862185d25c7b718faacafb23b818bc22c4c80c9bab6baaa228cf430196058a9374649de99dd831b98b9088b7b337ef44e4cadbf370d75a8a325ced9
+  languageName: node
+  linkType: hard
+
 "@nomicfoundation/hardhat-network-helpers@npm:^1.0.0, @nomicfoundation/hardhat-network-helpers@npm:^1.0.9":
   version: 1.0.10
   resolution: "@nomicfoundation/hardhat-network-helpers@npm:1.0.10"
@@ -4779,6 +4797,23 @@ __metadata:
   languageName: node
   linkType: hard
 
+"@nomicfoundation/ignition-core@npm:^0.15.7":
+  version: 0.15.7
+  resolution: "@nomicfoundation/ignition-core@npm:0.15.7"
+  dependencies:
+    "@ethersproject/address": "npm:5.6.1"
+    "@nomicfoundation/solidity-analyzer": "npm:^0.1.1"
+    cbor: "npm:^9.0.0"
+    debug: "npm:^4.3.2"
+    ethers: "npm:^6.7.0"
+    fs-extra: "npm:^10.0.0"
+    immer: "npm:10.0.2"
+    lodash: "npm:4.17.21"
+    ndjson: "npm:2.0.0"
+  checksum: b0d5717e7835da76595886e2729a0ee34536699091ad509b63fe2ec96b186495886c313c1c748dcc658524a5f409840031186f3af76975250be424248369c495
+  languageName: node
+  linkType: hard
+
 "@nomicfoundation/ignition-ui@npm:^0.15.5":
   version: 0.15.5
   resolution: "@nomicfoundation/ignition-ui@npm:0.15.5"
@@ -4786,6 +4821,13 @@ __metadata:
   languageName: node
   linkType: hard
 
+"@nomicfoundation/ignition-ui@npm:^0.15.7":
+  version: 0.15.7
+  resolution: "@nomicfoundation/ignition-ui@npm:0.15.7"
+  checksum: 4e53ff1e5267e9882ee3f7bae3d39c0e0552e9600fd2ff12ccc49f22436e1b97e9cec215999fda0ebcfbdf6db054a1ad8c0d940641d97de5998dbb4c864ce649
+  languageName: node
+  linkType: hard
+
 "@nomicfoundation/solidity-analyzer-darwin-arm64@npm:0.1.1":
   version: 0.1.1
   resolution: "@nomicfoundation/solidity-analyzer-darwin-arm64@npm:0.1.1"