forked from PAY-IT-FORWARD/contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Registry.sol
42 lines (31 loc) · 1.43 KB
/
Registry.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Registry contract.
//! By Gav Wood (Ethcore), 2016.
//! Released under the Apache Licence 2.
pragma solidity ^0.4.0;
// From Owned.sol
contract Owned {
event NewOwner(address indexed old, address indexed current);
function setOwner(address _new) only_owner { NewOwner(owner, _new); owner = _new; }
modifier only_owner { if (msg.sender != owner) return; _; }
address public owner = msg.sender;
}
contract MetadataRegistry {
event DataChanged(bytes32 indexed name, string indexed key, string plainKey);
function getData(bytes32 _name, string _key) constant returns (bytes32);
function getAddress(bytes32 _name, string _key) constant returns (address);
function getUint(bytes32 _name, string _key) constant returns (uint);
}
contract OwnerRegistry {
event Reserved(bytes32 indexed name, address indexed owner);
event Transferred(bytes32 indexed name, address indexed oldOwner, address indexed newOwner);
event Dropped(bytes32 indexed name, address indexed owner);
function getOwner(bytes32 _name) constant returns (address);
}
contract ReversibleRegistry {
event ReverseConfirmed(string indexed name, address indexed reverse);
event ReverseRemoved(string indexed name, address indexed reverse);
function hasReverse(bytes32 _name) constant returns (bool);
function getReverse(bytes32 _name) constant returns (address);
function canReverse(address _data) constant returns (bool);
function reverse(address _data) constant returns (string);
}