-
Notifications
You must be signed in to change notification settings - Fork 1
/
EternalStorage
68 lines (50 loc) · 1.59 KB
/
EternalStorage
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
contract EternalStorage{
mapping(bytes32 => uint) UIntStorage;
function getUIntValue(bytes32 record) constant returns (uint){
return UIntStorage[record];
}
function setUIntValue(bytes32 record, uint value)
{
UIntStorage[record] = value;
}
mapping(bytes32 => string) StringStorage;
function getStringValue(bytes32 record) constant returns (string){
return StringStorage[record];
}
function setStringValue(bytes32 record, string value)
{
StringStorage[record] = value;
}
mapping(bytes32 => address) AddressStorage;
function getAddressValue(bytes32 record) constant returns (address){
return AddressStorage[record];
}
function setAddressValue(bytes32 record, address value)
{
AddressStorage[record] = value;
}
mapping(bytes32 => bytes) BytesStorage;
function getBytesValue(bytes32 record) constant returns (bytes){
return BytesStorage[record];
}
function setBytesValue(bytes32 record, bytes value)
{
BytesStorage[record] = value;
}
mapping(bytes32 => bool) BooleanStorage;
function getBooleanValue(bytes32 record) constant returns (bool){
return BooleanStorage[record];
}
function setBooleanValue(bytes32 record, bool value)
{
BooleanStorage[record] = value;
}
mapping(bytes32 => int) IntStorage;
function getIntValue(bytes32 record) constant returns (int){
return IntStorage[record];
}
function setIntValue(bytes32 record, int value)
{
IntStorage[record] = value;
}
}