From 7d52c29f9686d09b56630b819899f99cc8eddaf7 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 12 Jul 2018 16:31:00 -0400 Subject: [PATCH] very wip working register --- lib/modules/ens/contracts/FIFSRegistrar.sol | 8 +++++++- lib/modules/ens/index.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/modules/ens/contracts/FIFSRegistrar.sol b/lib/modules/ens/contracts/FIFSRegistrar.sol index 62b7f270b..2a739a29c 100644 --- a/lib/modules/ens/contracts/FIFSRegistrar.sol +++ b/lib/modules/ens/contracts/FIFSRegistrar.sol @@ -10,7 +10,8 @@ contract FIFSRegistrar { bytes32 rootNode; modifier only_owner(bytes32 subnode) { - address currentOwner = ens.owner(keccak256(rootNode, subnode)); + bytes32 node = sha3(rootNode, subnode); + address currentOwner = ens.owner(node); require(currentOwner == 0 || currentOwner == msg.sender); _; } @@ -30,6 +31,11 @@ contract FIFSRegistrar { * @param subnode The hash of the label to register. * @param owner The address of the new owner. */ + /* + function register(bytes32 subnode, address owner) public only_owner(subnode) { + ens.setSubnodeOwner(rootNode, subnode, owner); + } +*/ function register(bytes32 subnode, address owner) public only_owner(subnode) { ens.setSubnodeOwner(rootNode, subnode, owner); } diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js index fac81782a..53c67b9e8 100644 --- a/lib/modules/ens/index.js +++ b/lib/modules/ens/index.js @@ -104,7 +104,7 @@ class ENS { "FIFSRegistrar": { "deploy": true, "args": ["$ENSRegistry", rootNode], - "onDeploy": ["ENSRegistry.methods.setOwner(0, FIFSRegistrar.options.address).send()"] + "onDeploy": ["ENSRegistry.methods.setOwner('"+rootNode+"', web3.eth.defaultAccount).send()"] } } },