very wip working register
This commit is contained in:
parent
36ae882a26
commit
7d52c29f96
|
@ -10,7 +10,8 @@ contract FIFSRegistrar {
|
||||||
bytes32 rootNode;
|
bytes32 rootNode;
|
||||||
|
|
||||||
modifier only_owner(bytes32 subnode) {
|
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);
|
require(currentOwner == 0 || currentOwner == msg.sender);
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +31,11 @@ contract FIFSRegistrar {
|
||||||
* @param subnode The hash of the label to register.
|
* @param subnode The hash of the label to register.
|
||||||
* @param owner The address of the new owner.
|
* @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) {
|
function register(bytes32 subnode, address owner) public only_owner(subnode) {
|
||||||
ens.setSubnodeOwner(rootNode, subnode, owner);
|
ens.setSubnodeOwner(rootNode, subnode, owner);
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ class ENS {
|
||||||
"FIFSRegistrar": {
|
"FIFSRegistrar": {
|
||||||
"deploy": true,
|
"deploy": true,
|
||||||
"args": ["$ENSRegistry", rootNode],
|
"args": ["$ENSRegistry", rootNode],
|
||||||
"onDeploy": ["ENSRegistry.methods.setOwner(0, FIFSRegistrar.options.address).send()"]
|
"onDeploy": ["ENSRegistry.methods.setOwner('"+rootNode+"', web3.eth.defaultAccount).send()"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue