-
Notifications
You must be signed in to change notification settings - Fork 41
/
IRecordStorage.sol
60 lines (49 loc) · 1.98 KB
/
IRecordStorage.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
// @author Unstoppable Domains, Inc.
// @date June 16th, 2021
pragma solidity ^0.8.0;
import './IRecordReader.sol';
interface IRecordStorage is IRecordReader {
event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value);
event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key);
event ResetRecords(uint256 indexed tokenId);
/**
* @dev Set record by key
* @param key The key set the value of
* @param value The value to set key to
* @param tokenId ERC-721 token id to set
*/
function set(string calldata key, string calldata value, uint256 tokenId) external;
/**
* @dev Set records by keys
* @param keys The keys set the values of
* @param values Records values
* @param tokenId ERC-721 token id of the domain
*/
function setMany(string[] memory keys, string[] memory values, uint256 tokenId) external;
/**
* @dev Set record by key hash
* @param keyHash The key hash set the value of
* @param value The value to set key to
* @param tokenId ERC-721 token id to set
*/
function setByHash(uint256 keyHash, string calldata value, uint256 tokenId) external;
/**
* @dev Set records by key hashes
* @param keyHashes The key hashes set the values of
* @param values Records values
* @param tokenId ERC-721 token id of the domain
*/
function setManyByHash(uint256[] calldata keyHashes, string[] calldata values, uint256 tokenId) external;
/**
* @dev Reset all domain records and set new ones
* @param keys New record keys
* @param values New record values
* @param tokenId ERC-721 token id of the domain
*/
function reconfigure(string[] memory keys, string[] memory values, uint256 tokenId) external;
/**
* @dev Function to reset all existing records on a domain.
* @param tokenId ERC-721 token id to set.
*/
function reset(uint256 tokenId) external;
}