Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Dec 2, 2024
1 parent 001f849 commit cb24348
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
17 changes: 7 additions & 10 deletions deploy/00_deploy_bulk_renewal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,31 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
await root.write.setSubnodeOwner([labelhash('eth')], owner)

console.log('Set default resolver for eth tld to public resolver')
const tx111 = await registry.write.setResolver([namehash('eth'), resolver.address])
await registry.write.setResolver([namehash('eth'), resolver.address])

console.log('Set interface implementor of eth tld for bulk renewal')
const tx2 = await resolver.write.setInterface([
await resolver.write.setInterface([
namehash('eth'),
createInterfaceId(bulkRenewal.abi),
bulkRenewal.address,
])

console.log('Set interface implementor of eth tld for registrar controller')
const tx3 = await resolver.setInterface(
await resolver.write.setInterface([
namehash('eth'),
createInterfaceId(controllerArtifact.abi),
controller.address,
)
await tx3.wait()
])

console.log('Set interface implementor of eth tld for name wrapper')
const tx4 = await resolver.setInterface(
await resolver.write.setInterface([
namehash('eth'),
createInterfaceId(wrapper.interface),
wrapper.address,
)
await tx4.wait()
])

console.log('Set owner of eth tld back to registrar')
const tx11 = await root.setSubnodeOwner(labelhash('eth'), registrar.address)
await tx11.wait()
await root.write.setSubnodeOwner([labelhash('eth')], registrar.address)

return true
}
Expand Down
13 changes: 7 additions & 6 deletions deploy/00_get_registration_gas_values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@
/* eslint-disable no-await-in-loop */
import fs from 'fs/promises'

import { ethers } from 'hardhat'
import { DeployFunction } from 'hardhat-deploy/types'
import { HardhatRuntimeEnvironment } from 'hardhat/types'
import { namehash } from 'viem'

import { getContract } from './utils/viem-hardhat'

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
if (!hre.network.tags.generate) {
return true
}
const { getUnnamedAccounts, network } = hre
const allUnnamedAccts = await getUnnamedAccounts()

const controller = await ethers.getContract('ETHRegistrarController')
const publicResolver = await ethers.getContract('PublicResolver')
const controller = (await getContract(hre)('ETHRegistrarController'))!
const publicResolver = (await getContract(hre)('PublicResolver'))!

let i = 0
let errored = false
Expand Down Expand Up @@ -80,7 +81,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
}: ReturnType<ReturnType<typeof makeData>>,
index: number,
) => {
const commitment = await controller.makeCommitment(
const commitment = await controller.write.makeCommitment([
label,
owner,
duration,
Expand All @@ -90,7 +91,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
reverseRecord,
fuses,
wrapperExpiry,
)
])

const _controller = controller.connect(await ethers.getSigner(owner))
const commitTx = await _controller.commit(commitment, { nonce: nonce + index })
Expand All @@ -115,7 +116,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
index: number,
) => {
try {
const [price] = await controller.rentPrice(label, duration)
const [price] = await controller.read.rentPrice([label, duration])

const _controller = controller.connect(await ethers.getSigner(owner))
const estimatedTx = await _controller.estimateGas.register(
Expand Down
2 changes: 1 addition & 1 deletion deploy/00_register_legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
{ label, registrant, secret, resolver, addr, duration }: ReturnType<typeof makeData>,
index: number,
) => {
const price = await controller.read.rentPrice(label, duration)
const price = await controller.read.rentPrice([label, duration])

const _controller = controller.connect(await ethers.getSigner(registrant))

Expand Down

0 comments on commit cb24348

Please sign in to comment.