forked from ensdomains/contracts-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: record ENSv2 mainnet deployment #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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"); | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+23
to
25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of checking
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| 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}`); | ||||||||||||||
|
|
||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maintaining both
EXPECTED_CHAIN_IDSandNETWORKSis redundant and can lead to out-of-sync configurations when adding new networks. We can simplify this by using only theNETWORKSmap and checking its keys.