Remove ENS warning
This commit is contained in:
parent
6ae697f36a
commit
cc7dfbcc60
|
@ -15,12 +15,12 @@ interface ENS {
|
|||
event NewTTL(bytes32 indexed node, uint64 ttl);
|
||||
|
||||
|
||||
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) public;
|
||||
function setResolver(bytes32 node, address resolver) public;
|
||||
function setOwner(bytes32 node, address owner) public;
|
||||
function setTTL(bytes32 node, uint64 ttl) public;
|
||||
function owner(bytes32 node) public view returns (address);
|
||||
function resolver(bytes32 node) public view returns (address);
|
||||
function ttl(bytes32 node) public view returns (uint64);
|
||||
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external;
|
||||
function setResolver(bytes32 node, address resolver) external;
|
||||
function setOwner(bytes32 node, address owner) external;
|
||||
function setTTL(bytes32 node, uint64 ttl) external;
|
||||
function owner(bytes32 node) external view returns (address);
|
||||
function resolver(bytes32 node) external view returns (address);
|
||||
function ttl(bytes32 node) external view returns (uint64);
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ contract ENSRegistry is ENS {
|
|||
/**
|
||||
* @dev Constructs a new ENS registrar.
|
||||
*/
|
||||
function ENSRegistry() public {
|
||||
constructor() public {
|
||||
records[0x0].owner = msg.sender;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ contract ENSRegistry is ENS {
|
|||
* @param owner The address of the new owner.
|
||||
*/
|
||||
function setOwner(bytes32 node, address owner) public only_owner(node, owner) {
|
||||
Transfer(node, owner);
|
||||
emit Transfer(node, owner);
|
||||
records[node].owner = owner;
|
||||
}
|
||||
|
||||
|
@ -44,8 +44,8 @@ contract ENSRegistry is ENS {
|
|||
* @param owner The address of the new owner.
|
||||
*/
|
||||
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) public only_owner(node, owner) {
|
||||
var subnode = sha3(node, label);
|
||||
NewOwner(node, label, owner);
|
||||
bytes32 subnode = keccak256(abi.encodePacked(node, label));
|
||||
emit NewOwner(node, label, owner);
|
||||
records[subnode].owner = owner;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ contract ENSRegistry is ENS {
|
|||
* @param resolver The address of the resolver.
|
||||
*/
|
||||
function setResolver(bytes32 node, address resolver) public only_owner(node, 0x0) {
|
||||
NewResolver(node, resolver);
|
||||
emit NewResolver(node, resolver);
|
||||
records[node].resolver = resolver;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ contract ENSRegistry is ENS {
|
|||
* @param ttl The TTL in seconds.
|
||||
*/
|
||||
function setTTL(bytes32 node, uint64 ttl) public only_owner(node, 0x0) {
|
||||
NewTTL(node, ttl);
|
||||
emit NewTTL(node, ttl);
|
||||
records[node].ttl = ttl;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ contract FIFSRegistrar {
|
|||
bytes32 rootNode;
|
||||
|
||||
modifier only_owner(bytes32 subnode) {
|
||||
bytes32 node = sha3(rootNode, subnode);
|
||||
bytes32 node = keccak256(abi.encodePacked(rootNode, subnode));
|
||||
address currentOwner = ens.owner(node);
|
||||
require(currentOwner == 0 || currentOwner == msg.sender);
|
||||
_;
|
||||
|
@ -22,7 +22,7 @@ contract FIFSRegistrar {
|
|||
* @param ensAddr The address of the ENS registry.
|
||||
* @param node The node that this registrar administers.
|
||||
*/
|
||||
function FIFSRegistrar(ENS ensAddr, bytes32 node) public {
|
||||
constructor(ENS ensAddr, bytes32 node) public {
|
||||
ens = ensAddr;
|
||||
rootNode = node;
|
||||
}
|
||||
|
|
|
@ -15,12 +15,12 @@ interface ENS {
|
|||
event NewTTL(bytes32 indexed node, uint64 ttl);
|
||||
|
||||
|
||||
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) public;
|
||||
function setResolver(bytes32 node, address resolver) public;
|
||||
function setOwner(bytes32 node, address owner) public;
|
||||
function setTTL(bytes32 node, uint64 ttl) public;
|
||||
function owner(bytes32 node) public view returns (address);
|
||||
function resolver(bytes32 node) public view returns (address);
|
||||
function ttl(bytes32 node) public view returns (uint64);
|
||||
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) external;
|
||||
function setResolver(bytes32 node, address resolver) external;
|
||||
function setOwner(bytes32 node, address owner) external;
|
||||
function setTTL(bytes32 node, uint64 ttl) external;
|
||||
function owner(bytes32 node) external view returns (address);
|
||||
function resolver(bytes32 node) external view returns (address);
|
||||
function ttl(bytes32 node) external view returns (uint64);
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ contract ENSRegistry is ENS {
|
|||
/**
|
||||
* @dev Constructs a new ENS registrar.
|
||||
*/
|
||||
function ENSRegistry() public {
|
||||
constructor() public {
|
||||
records[0x0].owner = msg.sender;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ contract ENSRegistry is ENS {
|
|||
* @param owner The address of the new owner.
|
||||
*/
|
||||
function setOwner(bytes32 node, address owner) public only_owner(node, owner) {
|
||||
Transfer(node, owner);
|
||||
emit Transfer(node, owner);
|
||||
records[node].owner = owner;
|
||||
}
|
||||
|
||||
|
@ -44,8 +44,8 @@ contract ENSRegistry is ENS {
|
|||
* @param owner The address of the new owner.
|
||||
*/
|
||||
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) public only_owner(node, owner) {
|
||||
var subnode = keccak256(node, label);
|
||||
NewOwner(node, label, owner);
|
||||
bytes32 subnode = keccak256(abi.encodePacked(node, label));
|
||||
emit NewOwner(node, label, owner);
|
||||
records[subnode].owner = owner;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ contract ENSRegistry is ENS {
|
|||
* @param resolver The address of the resolver.
|
||||
*/
|
||||
function setResolver(bytes32 node, address resolver) public only_owner(node, 0x0) {
|
||||
NewResolver(node, resolver);
|
||||
emit NewResolver(node, resolver);
|
||||
records[node].resolver = resolver;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ contract ENSRegistry is ENS {
|
|||
* @param ttl The TTL in seconds.
|
||||
*/
|
||||
function setTTL(bytes32 node, uint64 ttl) public only_owner(node, 0x0) {
|
||||
NewTTL(node, ttl);
|
||||
emit NewTTL(node, ttl);
|
||||
records[node].ttl = ttl;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ contract FIFSRegistrar {
|
|||
bytes32 rootNode;
|
||||
|
||||
modifier only_owner(bytes32 subnode) {
|
||||
bytes32 node = sha3(rootNode, subnode);
|
||||
bytes32 node = keccak256(abi.encodePacked(rootNode, subnode));
|
||||
address currentOwner = ens.owner(node);
|
||||
require(currentOwner == 0 || currentOwner == msg.sender);
|
||||
_;
|
||||
|
@ -22,7 +22,7 @@ contract FIFSRegistrar {
|
|||
* @param ensAddr The address of the ENS registry.
|
||||
* @param node The node that this registrar administers.
|
||||
*/
|
||||
function FIFSRegistrar(ENS ensAddr, bytes32 node) public {
|
||||
constructor(ENS ensAddr, bytes32 node) public {
|
||||
ens = ensAddr;
|
||||
rootNode = node;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue