From 03a174ab474d6ac91cef820d74a94a9c783192ee Mon Sep 17 00:00:00 2001 From: Brandon Kramer Date: Fri, 17 Jul 2026 21:09:39 +0000 Subject: [PATCH 1/3] Source protocol contracts page from @graphprotocol/address-book Drive the Arbitrum One and Arbitrum Sepolia contract tables from the @graphprotocol/address-book package (horizon, subgraph-service, issuance) so Horizon-era deployments stay current with each release bump. Ethereum Mainnet and Sepolia continue to be sourced from @graphprotocol/contracts. Page is organized network-first with per-product sub-tables on Arbitrum. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01TTTzmumskQuqnV1PoaTnpV --- website/package.json | 1 + website/src/contracts.tsx | 56 +++++++++++++++++++++++++++--- website/src/pages/en/contracts.mdx | 36 ++++++++++++++----- 3 files changed, 80 insertions(+), 13 deletions(-) diff --git a/website/package.json b/website/package.json index 4bef115036d8..577db38d2d1f 100644 --- a/website/package.json +++ b/website/package.json @@ -22,6 +22,7 @@ "@edgeandnode/gds": "^6.9.0", "@edgeandnode/go": "^10.5.1", "@emotion/react": "^11.14.0", + "@graphprotocol/address-book": "^1.2.0", "@graphprotocol/contracts": "^7.3.0", "@pinax/graph-networks-registry": "^0.7.1", "@react-hookz/web": "^25.2.0", diff --git a/website/src/contracts.tsx b/website/src/contracts.tsx index 6db3c4f2f04b..c71fba7b86e0 100644 --- a/website/src/contracts.tsx +++ b/website/src/contracts.tsx @@ -1,4 +1,7 @@ import ContractAddresses from '@graphprotocol/contracts/addresses.json' +import HorizonAddresses from '@graphprotocol/address-book/horizon/addresses.json' +import IssuanceAddresses from '@graphprotocol/address-book/issuance/addresses.json' +import SubgraphServiceAddresses from '@graphprotocol/address-book/subgraph-service/addresses.json' import { getAddressLink } from '@edgeandnode/common' import { ExperimentalLink } from '@edgeandnode/gds' @@ -7,14 +10,38 @@ import { Table } from '@/components' import { useI18n } from '@/i18n' type ValueOf = T[keyof T] + +/** + * Legacy protocol contracts (Ethereum Mainnet, Sepolia) sourced from `@graphprotocol/contracts`. + * The new Horizon deployments on Arbitrum live in `@graphprotocol/address-book` (see below). + */ const contractsByNetworkId = ContractAddresses as Record> -export function ProtocolContractsTable({ networkId }: { networkId: number }) { +/** + * Horizon-era contracts (Arbitrum One, Arbitrum Sepolia) sourced from `@graphprotocol/address-book`. + * Each package file is keyed by chain ID, then by contract name. Reading straight from the package + * means new deployments are picked up automatically whenever the dependency is bumped. + */ +type AddressBookEntry = { address: string } +type AddressBook = Record> + +export const addressBookPackages = { + horizon: HorizonAddresses as AddressBook, + 'subgraph-service': SubgraphServiceAddresses as AddressBook, + issuance: IssuanceAddresses as AddressBook, +} + +export type AddressBookPackage = keyof typeof addressBookPackages + +/** Shared name + address table used by both the legacy and address-book sources. */ +function ContractsTable({ + networkId, + contracts, +}: { + networkId: number + contracts: { name: string; address: string }[] +}) { const { t } = useI18n() - const contracts = Object.entries(contractsByNetworkId[`${networkId}`] ?? {}).map(([name, contract]) => ({ - ...contract, - name, - })) return ( @@ -34,3 +61,22 @@ export function ProtocolContractsTable({ networkId }: { networkId: number }) {
) } + +/** Legacy protocol contracts for a given network, from `@graphprotocol/contracts`. */ +export function ProtocolContractsTable({ networkId }: { networkId: number }) { + const contracts = Object.entries(contractsByNetworkId[`${networkId}`] ?? {}).map(([name, contract]) => ({ + name, + address: contract.address, + })) + return +} + +/** Horizon-era contracts for a given network and package, from `@graphprotocol/address-book`. */ +export function HorizonContractsTable({ networkId, product }: { networkId: number; product: AddressBookPackage }) { + const contracts = Object.entries(addressBookPackages[product][`${networkId}`] ?? {}).map(([name, contract]) => ({ + name, + address: contract.address, + })) + if (contracts.length === 0) return null + return +} diff --git a/website/src/pages/en/contracts.mdx b/website/src/pages/en/contracts.mdx index d9b51ac8b3cb..c0cdb9a55630 100644 --- a/website/src/pages/en/contracts.mdx +++ b/website/src/pages/en/contracts.mdx @@ -2,28 +2,48 @@ title: Protocol Contracts --- -import { ProtocolContractsTable } from '@/contracts' +import { HorizonContractsTable, ProtocolContractsTable } from '@/contracts' -Below are the deployed contracts which power The Graph Network. Visit the official [contracts repository](https://github.com/graphprotocol/contracts) to learn more. +Below are the deployed contracts which power The Graph Network. The Arbitrum contracts are sourced directly from the [`@graphprotocol/address-book`](https://www.npmjs.com/package/@graphprotocol/address-book) package, so they stay current with each release. Visit the official [contracts repository](https://github.com/graphprotocol/contracts) to learn more. ## Arbitrum One This is the principal deployment of The Graph Network. - +### Horizon -## Ethereum Mainnet + -This was the original deployment of The Graph Network. Learn more about The Graph's scaling with Arbitrum. +### Subgraph Service - + + +### Issuance + + ## Arbitrum Sepolia This is the primary testnet for The Graph Network. Testnet is predominantly used by core developers and ecosystem participants for testing purposes. There are no guarantees of service or availability on The Graph's testnets. - +### Horizon + + + +### Subgraph Service + + + +### Issuance + + + +## Ethereum Mainnet + +This was the original deployment of The Graph Network. Learn more about The Graph's scaling with Arbitrum. + + -## Sepolia +## Ethereum Sepolia From 86706be1fd9ac011fda4770bfb19041a4b6874bb Mon Sep 17 00:00:00 2001 From: Brandon Kramer Date: Fri, 17 Jul 2026 16:31:27 -0500 Subject: [PATCH 2/3] updating horizon contracts page and dependent table component --- pnpm-lock.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b63b8228359a..65590028360b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -116,6 +116,9 @@ importers: '@emotion/react': specifier: ^11.14.0 version: 11.14.0(@types/react@18.3.28)(react@18.3.1) + '@graphprotocol/address-book': + specifier: ^1.2.0 + version: 1.2.0 '@graphprotocol/contracts': specifier: ^7.3.0 version: 7.3.0 @@ -1408,6 +1411,9 @@ packages: '@formatjs/intl-localematcher@0.5.10': resolution: {integrity: sha512-af3qATX+m4Rnd9+wHcjJ4w2ijq+rAVP3CCinJQvFv1kgSu1W6jypUmvleJxcewdxmutM8dmIRZFxO/IQBZmP2Q==} + '@graphprotocol/address-book@1.2.0': + resolution: {integrity: sha512-eJgZ0b/BSe3tzXRbrIImjh63NfGwZ3BA71TESvDWE6tB84D6PqbZ7/E4cA1VLPQi3ge1DQ8I+LpypjDOjhKp2A==} + '@graphprotocol/contracts@7.3.0': resolution: {integrity: sha512-uEjgrBN4WCkJhSrUi5O64cNbU5OWI7iwy/03Er9n+J7o3WEspizpLJvSGXql8E0XtI0ygBaHBTwJfPo7SUphkg==} @@ -9086,6 +9092,8 @@ snapshots: dependencies: tslib: 2.8.1 + '@graphprotocol/address-book@1.2.0': {} + '@graphprotocol/contracts@7.3.0': {} '@graphql-typed-document-node/core@3.2.0(graphql@16.14.0)': @@ -10238,7 +10246,7 @@ snapshots: '@scure/bip32@1.7.0': dependencies: - '@noble/curves': 1.9.1 + '@noble/curves': 1.9.7 '@noble/hashes': 1.8.0 '@scure/base': 1.2.6 @@ -11075,6 +11083,11 @@ snapshots: typescript: 5.9.3 zod: 3.25.76 + abitype@1.2.4(typescript@5.9.3)(zod@3.25.76): + optionalDependencies: + typescript: 5.9.3 + zod: 3.25.76 + abitype@1.2.4(typescript@5.9.3)(zod@4.4.3): optionalDependencies: typescript: 5.9.3 @@ -14571,7 +14584,7 @@ snapshots: '@noble/hashes': 1.8.0 '@scure/bip32': 1.7.0 '@scure/bip39': 1.6.0 - abitype: 1.2.3(typescript@5.9.3)(zod@3.25.76) + abitype: 1.2.4(typescript@5.9.3)(zod@3.25.76) eventemitter3: 5.0.1 optionalDependencies: typescript: 5.9.3 From a09693547ebb2621149d21eb95f4afd4ea4a9774 Mon Sep 17 00:00:00 2001 From: Brandon Kramer Date: Fri, 17 Jul 2026 16:42:56 -0500 Subject: [PATCH 3/3] fixed linting issue --- website/src/contracts.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/contracts.tsx b/website/src/contracts.tsx index c71fba7b86e0..59a45e01fca4 100644 --- a/website/src/contracts.tsx +++ b/website/src/contracts.tsx @@ -1,7 +1,7 @@ -import ContractAddresses from '@graphprotocol/contracts/addresses.json' import HorizonAddresses from '@graphprotocol/address-book/horizon/addresses.json' import IssuanceAddresses from '@graphprotocol/address-book/issuance/addresses.json' import SubgraphServiceAddresses from '@graphprotocol/address-book/subgraph-service/addresses.json' +import ContractAddresses from '@graphprotocol/contracts/addresses.json' import { getAddressLink } from '@edgeandnode/common' import { ExperimentalLink } from '@edgeandnode/gds'