mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-10 05:56:00 +00:00
fix lookup and also enable lookup for new subdomains
This commit is contained in:
parent
72cf9f2430
commit
9eb6e9a949
@ -34,13 +34,13 @@ 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, address _account) public only_owner(subnode) {
|
||||
function register(bytes32 subnode, address owner, address nodeAddress) public only_owner(subnode) {
|
||||
bytes32 subdomainHash = sha3(rootNode, subnode);
|
||||
ens.setSubnodeOwner(rootNode, subnode, owner);
|
||||
ens.setResolver(subdomainHash, resolver); //default resolver
|
||||
bool resolveAccount = _account != address(0);
|
||||
bool resolveAccount = nodeAddress != address(0);
|
||||
if (resolveAccount) {
|
||||
resolver.setAddr(subdomainHash, _account);
|
||||
resolver.setAddr(subdomainHash, nodeAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -236,6 +236,7 @@ __embarkENS.lookup = function (address, callback) {
|
||||
};
|
||||
|
||||
__embarkENS.registerSubDomain = function (name, address, callback) {
|
||||
const self = this;
|
||||
callback = callback || function () {};
|
||||
|
||||
if (this.env !== 'development' && this.env !== 'privatenet') {
|
||||
|
@ -350,7 +350,10 @@ class ENS {
|
||||
"onDeploy": [
|
||||
`ENSRegistry.methods.setOwner('${rootNode}', web3.eth.defaultAccount).send().then(() => {
|
||||
ENSRegistry.methods.setResolver('${rootNode}', "$Resolver").send();
|
||||
var reverseNode = web3.utils.sha3(web3.eth.defaultAccount.toLowerCase().substr(2) + '.addr.reverse');
|
||||
ENSRegistry.methods.setResolver(reverseNode, "$Resolver").send();
|
||||
Resolver.methods.setAddr('${rootNode}', web3.eth.defaultAccount).send();
|
||||
Resolver.methods.setName(reverseNode, '${this.registration.rootDomain}').send();
|
||||
})`
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user