Skip to content

Commit

Permalink
Add deploy script for MigrationHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
Arachnid committed Oct 4, 2024
1 parent 7cfb04c commit 6a2381f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions deploy/utils/10_deploy_migration_helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import type { DeployFunction } from 'hardhat-deploy/types.js'

const func: DeployFunction = async function (hre) {
const { deployments, viem } = hre
const { deploy } = deployments

const { deployer, owner } = await viem.getNamedClients()

const registrar = await viem.getContract('BaseRegistrarImplementation')
const wrapper = await viem.getContract('NameWrapper')

await viem.deploy('MigrationHelper', [registrar.address, wrapper.address])

if (owner !== undefined && owner.address !== deployer.address) {
const migrationHelper = await viem.getContract('MigrationHelper')
const hash = await migrationHelper.write.transferOwnership([owner.address])
console.log(`Transfer ownership to ${owner.address} (tx: ${hash})...`)
await viem.waitForTransactionSuccess(hash)
}
}

func.id = 'migration-helper'
func.tags = ['utils', 'MigrationHelper']
func.dependencies = ['BaseRegistrarImplementation', 'NameWrapper']

export default func
1 change: 1 addition & 0 deletions scripts/deploy-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ execSync('bun run hardhat --network localhost deploy', {
env: {
...process.env,
NODE_OPTIONS: '--experimental-loader ts-node/esm/transpile-only',
BATCH_GATEWAY_URLS: '["https://example.com/"]',
},
})

Expand Down

0 comments on commit 6a2381f

Please sign in to comment.