-
Notifications
You must be signed in to change notification settings - Fork 214
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
1 parent
85d662d
commit c2e213a
Showing
27 changed files
with
225 additions
and
286 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
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
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 |
---|---|---|
@@ -1,43 +1,41 @@ | ||
/* global artifacts */ | ||
|
||
global.web3 = web3; | ||
|
||
const ENS = artifacts.require("ENSRegistryWithFallback"); | ||
const ENSReverseRegistrar = artifacts.require("ReverseRegistrar"); | ||
|
||
const utils = require("../utils/utilities.js"); | ||
const DeployManager = require("../utils/deploy-manager.js"); | ||
const deployManager = require("../utils/deploy-manager.js"); | ||
|
||
const BYTES32_NULL = "0x0000000000000000000000000000000000000000000000000000000000000000"; | ||
|
||
async function deployENSReverseRegistrar(config, owner, overrides) { | ||
async function deployENSReverseRegistrar(config, owner) { | ||
const ENSRegistryWrapper = await ENS.at(config.ENS.ensRegistry); | ||
const ENSReverseRegistrarWrapper = await ENSReverseRegistrar.new(config.ENS.ensRegistry, config.contracts.ENSResolver); | ||
|
||
console.log("Create the reverse namespace"); | ||
await ENSRegistryWrapper.setSubnodeOwner(BYTES32_NULL, utils.sha3("reverse"), owner, overrides); | ||
await ENSRegistryWrapper.setSubnodeOwner(BYTES32_NULL, utils.sha3("reverse"), owner); | ||
|
||
console.log("Create the addr.reverse namespace and make the ENS reverse registrar the owner"); | ||
await ENSRegistryWrapper.setSubnodeOwner( | ||
utils.namehash("reverse"), | ||
utils.sha3("addr"), | ||
ENSReverseRegistrarWrapper.address, | ||
overrides, | ||
); | ||
ENSReverseRegistrarWrapper.address); | ||
} | ||
|
||
module.exports = async (callback) => { | ||
// TODO: Maybe get the signer account a better way? | ||
const accounts = await web3.eth.getAccounts(); | ||
const deploymentAccount = accounts[0]; | ||
|
||
const manager = new DeployManager(deploymentAccount); | ||
await manager.setup(); | ||
|
||
const { configurator } = manager; | ||
async function main() { | ||
const { deploymentAccount, configurator } = await deployManager.getProps(); | ||
const { config } = configurator; | ||
|
||
if (config.ENS.deployOwnRegistry) { | ||
await deployENSReverseRegistrar(config, deploymentAccount); | ||
} | ||
|
||
callback(); | ||
console.log("## completed deployment script 4 ##"); | ||
} | ||
|
||
// For truffle exec | ||
module.exports = function (callback) { | ||
main().then(() => callback()).catch((err) => callback(err)); | ||
}; |
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
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.