diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 99786e93..b279abc6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -144,10 +144,16 @@ jobs: - name: Test mappings run: npm test - - name: Render canonical deployment manifest + - name: Render canonical Testnet deployment manifest run: npm run render:deployment - - name: Build canonical deployment subgraph + - name: Build canonical Testnet deployment subgraph + run: npm run build + + - name: Render canonical Mainnet deployment manifest + run: npm run render:mainnet + + - name: Build canonical Mainnet deployment subgraph run: npm run build publish-docker: diff --git a/contracts/deployments/dos-mainnet-7979.json b/contracts/deployments/dos-mainnet-7979.json new file mode 100644 index 00000000..be0db51b --- /dev/null +++ b/contracts/deployments/dos-mainnet-7979.json @@ -0,0 +1,35 @@ +{ + "environment": "dos-mainnet", + "chainId": 7979, + "deploymentBlock": 117, + "finalDeploymentBlock": 162, + "deployedAt": "2026-08-12T19:44:44Z", + "deployer": "0x99999e454138f6be73E2bE82c890bc5765749999", + "owner": "0x310Bc061214ee89aF5CfB28a6ebF96c5436fa3CD", + "beneficiary": "0x310Bc061214ee89aF5CfB28a6ebF96c5436fa3CD", + "smokeName": "bens-smoke.dos", + "smokeResolvedAddress": "0x99999e454138f6be73E2bE82c890bc5765749999", + "transactions": { + "first": "0xb2fc1d57f72439403e095a8ec1d319342069cf400d77c89b5a043d43eb301ffc", + "last": "0xd1860882db7b632405c6189b4dbad6804f37fc6b957e0558e13d37738170ccbb", + "count": 46 + }, + "contracts": { + "wrappedDOS": "0x1111111111111111111111111111111111111111", + "contractNamerImplementation": "0xc647ccf449dec38bb8b7272e60fc14b3548c9547", + "contractNamer": "0x069056B2Ae8fD8c071Efb827c5AF73a0996840E1", + "verifiableFactory": "0x030eec847cf5D9d1c4A0b4e0459d130D0B35577C", + "labelStore": "0xB86bb608E6Afd7a8Eb209510c01BB859A7c315f1", + "rootRegistry": "0x38FC582690c3F28099087A88520056afAb08ce5F", + "dosRegistry": "0xb17Fec6fe18aC0b7F3dd934495E84eC06Cf88564", + "reverseRegistry": "0x8A2730c903d93b2116Fab3d9110C7D585F7B5a91", + "priceOracle": "0x4fcD4427859fc657a5Ef3c181202728cc16c85cf", + "dosRegistrar": "0x1F31e05948769174dA256D0484b8f26cfD3d8c97", + "permissionedResolverImplementation": "0x72aB4bE8B13CF39F68c73bA1B409A1fdFc0448AD", + "userRegistryImplementation": "0xfa579733d7C5A21B5D3C4399D3d6Ef89fc3A3720", + "gatewayProvider": "0x8291F1C6aEf2acBC58F3fe11C9e4EC0d3D4aE904", + "universalResolver": "0xCB20A0C349f079b8bD403ea8F668FE3DA49E981f", + "reverseRegistrar": "0x5A34c9fB9806239Ed61f1570c51edb198333fbeA", + "smokeResolver": "0xDDeE50c9721807B8B7e8640D9E2bd0AEBB6AA4d4" + } +} diff --git a/subgraph/dos-names/package.json b/subgraph/dos-names/package.json index e91ea04d..439ab45e 100644 --- a/subgraph/dos-names/package.json +++ b/subgraph/dos-names/package.json @@ -9,6 +9,7 @@ "render": "node scripts/render-manifest.mjs", "render:test": "node scripts/render-manifest.mjs tests/fixtures/dos-testnet-3939.json subgraph.template.yaml subgraph.yaml", "render:deployment": "node scripts/render-manifest.mjs ../../contracts/deployments/dos-testnet-3939.json subgraph.template.yaml subgraph.yaml", + "render:mainnet": "node scripts/render-manifest.mjs ../../contracts/deployments/dos-mainnet-7979.json subgraph.template.yaml subgraph.yaml", "test": "graph test", "test:render": "node --test tests/render-manifest.test.mjs" }, diff --git a/subgraph/dos-names/scripts/render-manifest.mjs b/subgraph/dos-names/scripts/render-manifest.mjs index 72c7b6c6..fdc5e05c 100644 --- a/subgraph/dos-names/scripts/render-manifest.mjs +++ b/subgraph/dos-names/scripts/render-manifest.mjs @@ -2,7 +2,11 @@ import fs from "node:fs"; import path from "node:path"; import { pathToFileURL } from "node:url"; -const EXPECTED_CHAIN_ID = 3939; +const EXPECTED_CHAIN_IDS = new Set([3939, 7979]); +const NETWORKS = new Map([ + [3939, "dos-testnet"], + [7979, "dos-mainnet"], +]); const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"; const ADDRESS_PATTERN = /^0x[0-9a-fA-F]{40}$/; @@ -16,8 +20,8 @@ const CONTRACT_PLACEHOLDERS = [ ]; export function validateDeployment(deployment) { - if (deployment?.chainId !== EXPECTED_CHAIN_ID) { - throw new Error(`chainId must be ${EXPECTED_CHAIN_ID}`); + if (!EXPECTED_CHAIN_IDS.has(deployment?.chainId)) { + throw new Error("chainId must be one of 3939, 7979"); } if ( @@ -61,6 +65,13 @@ export function renderManifest(template, deployment) { validateDeployment(deployment); let rendered = template; + if (!rendered.includes("__NETWORK__")) { + throw new Error("template is missing __NETWORK__"); + } + rendered = rendered.replaceAll( + "__NETWORK__", + NETWORKS.get(deployment.chainId), + ); for (const [contractName, placeholder] of CONTRACT_PLACEHOLDERS) { if (!rendered.includes(placeholder)) { throw new Error(`template is missing ${placeholder}`); diff --git a/subgraph/dos-names/subgraph.template.yaml b/subgraph/dos-names/subgraph.template.yaml index 5aadae94..c8aa31f1 100644 --- a/subgraph/dos-names/subgraph.template.yaml +++ b/subgraph/dos-names/subgraph.template.yaml @@ -7,7 +7,7 @@ dataSources: # Emits: NameRegistered, ResolverUpdated, ExpiryUpdated, SubregistryUpdated, ERC1155 transfers - kind: ethereum/contract name: DOSTLDRegistry - network: dos-testnet + network: __NETWORK__ source: abi: PermissionedRegistry address: "__DOS_REGISTRY_ADDRESS__" @@ -49,7 +49,7 @@ dataSources: # Emits: NameRegistered (with cost info), NameRenewed - kind: ethereum/contract name: DOSRegistrar - network: dos-testnet + network: __NETWORK__ source: abi: DOSRegistrar address: "__DOS_REGISTRAR_ADDRESS__" @@ -76,7 +76,7 @@ dataSources: # Emits: AddrChanged, AddressChanged, TextChanged, ContenthashChanged, etc. - kind: ethereum/contract name: Resolver - network: dos-testnet + network: __NETWORK__ source: abi: PermissionedResolver address: "__PERMISSIONED_RESOLVER_IMPLEMENTATION_ADDRESS__" @@ -116,7 +116,7 @@ dataSources: templates: - kind: ethereum/contract name: UserRegistryTemplate - network: dos-testnet + network: __NETWORK__ source: abi: PermissionedRegistry mapping: @@ -155,7 +155,7 @@ templates: - kind: ethereum/contract name: ResolverTemplate - network: dos-testnet + network: __NETWORK__ source: abi: PermissionedResolver mapping: diff --git a/subgraph/dos-names/tests/render-manifest.test.mjs b/subgraph/dos-names/tests/render-manifest.test.mjs index af4d0332..9e47ac35 100644 --- a/subgraph/dos-names/tests/render-manifest.test.mjs +++ b/subgraph/dos-names/tests/render-manifest.test.mjs @@ -18,6 +18,7 @@ const VALID_DEPLOYMENT = { }; const TEMPLATE = ` +network: __NETWORK__ registry: __DOS_REGISTRY_ADDRESS__ registrar: __DOS_REGISTRAR_ADDRESS__ resolver: __PERMISSIONED_RESOLVER_IMPLEMENTATION_ADDRESS__ @@ -31,13 +32,24 @@ test("renders every contract address and deployment block", () => { assert.match(rendered, /0x2222222222222222222222222222222222222222/); assert.match(rendered, /0x3333333333333333333333333333333333333333/); assert.match(rendered, /startBlock: 68/); + assert.match(rendered, /network: dos-testnet/); assert.doesNotMatch(rendered, /__[A-Z0-9_]+__/); }); -test("rejects a deployment for another chain", () => { +test("accepts the canonical DOS Mainnet deployment", () => { + const deployment = { + ...VALID_DEPLOYMENT, + chainId: 7979, + }; + + assert.doesNotThrow(() => validateDeployment(deployment)); + assert.match(renderManifest(TEMPLATE, deployment), /network: dos-mainnet/); +}); + +test("rejects a deployment for an unsupported chain", () => { assert.throws( - () => validateDeployment({ ...VALID_DEPLOYMENT, chainId: 7979 }), - /chainId must be 3939/, + () => validateDeployment({ ...VALID_DEPLOYMENT, chainId: 1 }), + /chainId must be one of 3939, 7979/, ); }); @@ -102,7 +114,11 @@ test("rejects a zero contract address", () => { test("rejects a template missing a required placeholder", () => { assert.throws( - () => renderManifest("startBlock: __START_BLOCK__", VALID_DEPLOYMENT), + () => + renderManifest( + "network: __NETWORK__\nstartBlock: __START_BLOCK__", + VALID_DEPLOYMENT, + ), /template is missing __DOS_REGISTRY_ADDRESS__/, ); });