-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
4,697 additions
and
1,127 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+39.4 KB
.yarn/cache/hardhat-deploy-ethers-npm-0.3.0-beta.13-98c7c1196f-45206bf8d0.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
|
@@ -20,6 +20,9 @@ | |
"ts-node": "^10.7.0", | ||
"typescript": "^4.6.2" | ||
}, | ||
"resolutions": { | ||
"@nomiclabs/hardhat-ethers": "npm:[email protected]" | ||
}, | ||
"dependencies": { | ||
"ethers": "^5.6.1" | ||
} | ||
|
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,3 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >0.0.0; | ||
import 'ens-contracts-main/contracts/registry/ReverseRegistrar.sol'; |
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,65 @@ | ||
import { namehash, solidityKeccak256 } from 'ethers/lib/utils' | ||
import { ethers } from 'hardhat' | ||
import { DeployFunction } from 'hardhat-deploy/types' | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types' | ||
import { ENSRegistry__factory } from '../src/generated/factories/ENSRegistry__factory' | ||
import { Root__factory } from '../src/generated/factories/Root__factory' | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const { deployments, getNamedAccounts } = hre | ||
const { deploy } = deployments | ||
|
||
const { deployer } = await getNamedAccounts() | ||
|
||
const registryAddress = '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e' | ||
|
||
ethers.provider = new ethers.providers.JsonRpcProvider( | ||
'http://localhost:8545', | ||
) | ||
|
||
const root = Root__factory.connect( | ||
'0x31e789Eb325aB116997942f7809731197a3dc059', | ||
ethers.provider.getSigner('0xa303ddC620aa7d1390BACcc8A495508B183fab59'), | ||
) | ||
|
||
const registry = ENSRegistry__factory.connect( | ||
registryAddress, | ||
ethers.provider.getSigner('0xa303ddC620aa7d1390BACcc8A495508B183fab59'), | ||
) | ||
|
||
await deploy('ReverseRegistrar', { | ||
from: deployer, | ||
args: [registryAddress], | ||
}) | ||
|
||
const reverseRegistrarAddress = (await deployments.get('ReverseRegistrar')) | ||
.address | ||
|
||
const tx1 = await root.setSubnodeOwner( | ||
solidityKeccak256(['string'], ['reverse']), | ||
'0xa303ddC620aa7d1390BACcc8A495508B183fab59', | ||
{ | ||
from: '0xa303ddC620aa7d1390BACcc8A495508B183fab59', | ||
}, | ||
) | ||
|
||
await tx1?.wait() | ||
|
||
const tx = await registry.setSubnodeOwner( | ||
namehash('reverse'), | ||
solidityKeccak256(['string'], ['addr']), | ||
reverseRegistrarAddress, | ||
{ | ||
from: '0xa303ddC620aa7d1390BACcc8A495508B183fab59', | ||
}, | ||
) | ||
|
||
await tx?.wait() | ||
|
||
console.log( | ||
'Deployed ReverseRegistrar, address:', | ||
(await deployments.get('ReverseRegistrar')).address, | ||
) | ||
} | ||
|
||
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
File renamed without changes.
File renamed without changes.
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
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
Oops, something went wrong.