very wip working register

This commit is contained in:
Jonathan Rainville 2018-07-12 16:31:00 -04:00 committed by Iuri Matias
parent 36ae882a26
commit 7d52c29f96
2 changed files with 8 additions and 2 deletions

View File

@ -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);
}

View File

@ -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()"]
}
}
},