Skip to content

Commit

Permalink
Make dnsregistrar dependent on root being setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jefflau committed Jul 18, 2023
1 parent bba823d commit b15f236
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 40 deletions.
8 changes: 7 additions & 1 deletion deploy/dnsregistrar/10_deploy_dnsregistrar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
}

func.tags = ['DNSRegistrar']
func.dependencies = ['registry', 'dnssec-oracle', 'OffchainDNSResolver', 'Root']
func.dependencies = [
'registry',
'dnssec-oracle',
'OffchainDNSResolver',
'Root',
'setupRoot',
]

export default func
39 changes: 0 additions & 39 deletions deploy/root/00_deploy_root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import { ethers } from 'hardhat'
import { DeployFunction } from 'hardhat-deploy/types'
import { HardhatRuntimeEnvironment } from 'hardhat/types'

const ZERO_HASH =
'0x0000000000000000000000000000000000000000000000000000000000000000'

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { getNamedAccounts, deployments, network } = hre
const { deploy } = deployments
Expand All @@ -22,42 +19,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
log: true,
})

const root = await ethers.getContract('Root')

// const tx1 = await registry.setOwner(ZERO_HASH, root.address)
// console.log(
// `Setting owner of root node to root contract (tx: ${tx1.hash})...`,
// )
// await tx1.wait()

// const rootOwner = await root.owner()

// switch (rootOwner) {
// case deployer:
// const tx2 = await root
// .connect(await ethers.getSigner(deployer))
// .transferOwnership(owner)
// console.log(
// `Transferring root ownership to final owner (tx: ${tx2.hash})...`,
// )
// await tx2.wait()
// case owner:
// if (!(await root.controllers(owner))) {
// const tx2 = await root
// .connect(await ethers.getSigner(owner))
// .setController(owner, true)
// console.log(
// `Setting final owner as controller on root contract (tx: ${tx2.hash})...`,
// )
// await tx2.wait()
// }
// break
// default:
// console.log(
// `WARNING: Root is owned by ${rootOwner}; cannot transfer to owner account`,
// )
// }

return true
}

Expand Down

0 comments on commit b15f236

Please sign in to comment.