-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deploy script for MigrationHelper
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters