Skip to content

Commit

Permalink
Add transfer of ownership of UR to owner on deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jefflau committed Jan 30, 2024
1 parent 29984e3 commit 3a42f54
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions deploy/utils/00_deploy_universal_resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { getNamedAccounts, deployments } = hre
const { deploy } = deployments
const { deployer } = await getNamedAccounts()
const { deployer, owner } = await getNamedAccounts()

const registry = await ethers.getContract('ENSRegistry')
const batchGatewayURLs = JSON.parse(process.env.BATCH_GATEWAY_URLS || '[]')
Expand All @@ -14,11 +14,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
throw new Error('UniversalResolver: No batch gateway URLs provided')
}

await deploy('UniversalResolver', {
from: deployer,
args: [registry.address, batchGatewayURLs],
log: true,
})
// await deploy('UniversalResolver', {
// from: deployer,
// args: [registry.address, batchGatewayURLs],
// log: true,
// })

const UR = await ethers.getContract('UniversalResolver')
const tx = await UR.transferOwnership(owner)
console.log(`Transfer ownership to ${owner} (tx: ${tx.hash})...`)
await tx.wait()
}

func.id = 'universal-resolver'
Expand Down

0 comments on commit 3a42f54

Please sign in to comment.