-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathIUNSRegistry.sol
150 lines (129 loc) · 4.71 KB
/
IUNSRegistry.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
// @author Unstoppable Domains, Inc.
// @date June 16th, 2021
pragma solidity ^0.8.0;
import '@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol';
import '@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol';
import './IERC1967.sol';
import './IRecordStorage.sol';
import './IReverseRegistry.sol';
import './IRootRegistry.sol';
import './@maticnetwork/IChildToken.sol';
interface IUNSRegistry is
IERC1967,
IERC721MetadataUpgradeable,
IERC721ReceiverUpgradeable,
IRecordStorage,
IReverseRegistry,
IRootRegistry,
IChildToken
{
event NewURI(uint256 indexed tokenId, string uri);
event NewURIPrefix(string prefix);
event SetExpiry(uint256 indexed tokenId, uint64 expiry);
/**
* @dev Function to set the token URI Prefix for all tokens.
* @param prefix string URI to assign
*/
function setTokenURIPrefix(string calldata prefix) external;
/**
* @dev Returns whether the given spender can transfer a given token ID.
* @param spender address of the spender to query
* @param tokenId uint256 ID of the token to be transferred
* @return bool whether the msg.sender is approved for the given token ID,
* is an operator of the owner, or is the owner of the token
*/
function isApprovedOrOwner(address spender, uint256 tokenId) external view returns (bool);
/**
* @dev Gets the resolver of the specified token ID.
* @param tokenId uint256 ID of the token to query the resolver of
* @return address currently marked as the resolver of the given token ID
*/
function resolverOf(uint256 tokenId) external view returns (address);
/**
* @dev Provides namehashe of the provided domain labels.
* @param labels array of domain labels splitted by '.' (for `aaa.bbb.crypto` it will be [`aaa`, `bbb`, `crypto`])
*/
function namehash(string[] calldata labels) external pure returns (uint256);
/**
* @dev Existence of token.
* @param tokenId uint256 ID of the token
*/
function exists(uint256 tokenId) external view override returns (bool);
/**
* @dev Expiry of the token.
* @param tokenId uint256 ID of the token
*/
function expiryOf(uint256 tokenId) external view returns (uint64);
/**
* @dev Returns whether token is expired.
* @param tokenId uint256 ID of the token.
*/
function isExpired(uint256 tokenId) external view returns (bool);
/**
* @dev Transfer domain ownership without resetting domain records.
* @param to address of new domain owner
* @param tokenId uint256 ID of the token to be transferred
*/
function setOwner(address to, uint256 tokenId) external;
/**
* @dev Burns `tokenId`. See {ERC721-_burn}.
*
* Requirements:
*
* - The caller must own `tokenId` or be an approved operator.
*/
function burn(uint256 tokenId) external;
/**
* @dev Mints root token.
* @param tokenId id of TLD token.
* @param uri TLD URI.
*/
function mintTLD(uint256 tokenId, string calldata uri) external;
/**
* @dev mints token with records
* @param to address to mint the new SLD or subdomain to
* @param labels array of SLD or subdomain name labels splitted by '.' to mint.
* @param keys New record keys
* @param values New record values
* @param withReverse Flag whether to install reverse resolution
*/
function mintWithRecords(
address to,
string[] calldata labels,
string[] calldata keys,
string[] calldata values,
bool withReverse
) external;
/**
* @dev unlock token
* @param to address to unlock the token to
* @param tokenId uint256 ID of the token
*/
function unlock(address to, uint256 tokenId) external;
/**
* @dev unlock token with records
* @param to address to unlock the token to
* @param labels array of domain labels splitted by '.' (for `aaa.bbb.crypto` it will be [`aaa`, `bbb`, `crypto`])
* @param keys New record keys
* @param values New record values
* @param withReverse Flag indicating whether to install reverse resolution
*/
function unlockWithRecords(
address to,
string[] calldata labels,
string[] calldata keys,
string[] calldata values,
bool withReverse
) external;
/**
* @dev Adds ProxyReader address
* @param addr address of ProxyReader
*/
function addProxyReader(address addr) external;
/**
* @dev Sets token expiry
* @param expiry Token expiry timestamp
* @param tokenId uint256 ID of the token
*/
function setExpiry(uint64 expiry, uint256 tokenId) external;
}