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
7 changes: 5 additions & 2 deletions contracts/deploy/02_UnlockedMigrationController.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { artifacts, execute } from "@rocketh";
import { ROLES } from "../script/deploy-constants.js";
import { DEPLOYMENT_ROLES } from "../script/deploy-constants.js";

export default execute(
async ({ deploy, execute: write, get, namedAccounts: { deployer } }) => {
Expand All @@ -19,7 +19,10 @@ export default execute(
await write(ethRegistry, {
account: deployer,
functionName: "grantRootRoles",
args: [ROLES.REGISTRY.REGISTER_RESERVED, migrationController.address],
args: [
DEPLOYMENT_ROLES.MIGRATION_CONTROLLER_ROOT,
migrationController.address,
],
});
},
{
Expand Down
7 changes: 5 additions & 2 deletions contracts/deploy/04_LockedMigrationController.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { artifacts, execute } from "@rocketh";
import { ROLES } from "../script/deploy-constants.js";
import { DEPLOYMENT_ROLES } from "../script/deploy-constants.js";

export default execute(
async ({ deploy, execute: write, get, namedAccounts: { deployer } }) => {
Expand Down Expand Up @@ -31,7 +31,10 @@ export default execute(
await write(ethRegistry, {
account: deployer,
functionName: "grantRootRoles",
args: [ROLES.REGISTRY.REGISTER_RESERVED, migrationController.address],
args: [
DEPLOYMENT_ROLES.MIGRATION_CONTROLLER_ROOT,
migrationController.address,
],
});
},
{
Expand Down
17 changes: 9 additions & 8 deletions contracts/script/deploy-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export const ROLES = {
ADMIN,
} as const;

/** Role bitmaps for static deployment per README Static Deployment Permissions. */
// Role bitmaps for static deployment per README Static Deployment Permissions.
export const DEPLOYMENT_ROLES = {
/** RootRegistry root: REGISTRAR✓✓, REGISTER_RESERVED✓✓, SET_PARENT✓✓, RENEW✓✓ */
// RootRegistry root: REGISTRAR✓✓, REGISTER_RESERVED✓✓, SET_PARENT✓✓, RENEW✓✓
ROOT_REGISTRY_ROOT:
ROLES.REGISTRY.REGISTRAR |
ROLES.ADMIN.REGISTRY.REGISTRAR |
Expand All @@ -68,24 +68,25 @@ export const DEPLOYMENT_ROLES = {
ROLES.ADMIN.REGISTRY.SET_PARENT |
ROLES.REGISTRY.RENEW |
ROLES.ADMIN.REGISTRY.RENEW,
/** .eth token: SET_SUBREGISTRY AR, SET_RESOLVER AR */
// .eth token: SET_SUBREGISTRY AR, SET_RESOLVER AR
ETH_TOKEN:
ROLES.REGISTRY.SET_SUBREGISTRY |
ROLES.ADMIN.REGISTRY.SET_SUBREGISTRY |
ROLES.REGISTRY.SET_RESOLVER |
ROLES.ADMIN.REGISTRY.SET_RESOLVER,
/**
* Full registry role bitmap for ReverseRegistry root, .reverse token, and .addr token.
* Granting all roles is harmless; some (e.g. REGISTRAR) are root-only and don't apply to tokens.
*/
// Full registry role bitmap for ReverseRegistry root, .reverse token, and .addr token.
// Granting all roles is harmless; some (e.g. REGISTRAR) are root-only and don't apply to tokens.
REVERSE_AND_ADDR: FLAGS.ALL,
/** ETHRegistry root deployer: REGISTRAR✓, REGISTER_RESERVED✓, SET_PARENT✓✓, RENEW✓ */
// ETHRegistry root deployer: REGISTRAR✓, REGISTER_RESERVED✓, SET_PARENT✓✓, RENEW✓
ETH_REGISTRY_ROOT:
ROLES.ADMIN.REGISTRY.REGISTRAR |
ROLES.ADMIN.REGISTRY.REGISTER_RESERVED |
ROLES.REGISTRY.SET_PARENT |
ROLES.ADMIN.REGISTRY.SET_PARENT |
ROLES.ADMIN.REGISTRY.RENEW,
// UnlockedMigrationController and LockedMigrationController
// only need to register() pre-migrated reservations on ETHRegistry (see: "ENSv2 Migration Case Study")
MIGRATION_CONTROLLER_ROOT: ROLES.REGISTRY.REGISTER_RESERVED,
} as const;

// see: IPermissionedRegistry.sol
Expand Down
8 changes: 7 additions & 1 deletion contracts/script/runDevnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ process.once("uncaughtException", async (err) => {

console.log();
console.log("Available Named Accounts:");
console.table(env.accounts.map((x) => ({ Name: x.name, Address: x.address })));
console.table(
Object.values(env.namedAccounts).map((x) => ({
Name: x.name,
Address: x.address,
Resolver: x.resolver.address,
})),
);

console.table(
Object.entries(env.rocketh.deployments).map(([name, { address }]) => ({
Expand Down
Loading