Skip to content

Instantly share code, notes, and snippets.

@elenadimitrova
Last active February 3, 2024 07:54
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save elenadimitrova/cf845f85cea05c0c257ba08437f04dd0 to your computer and use it in GitHub Desktop.
Save elenadimitrova/cf845f85cea05c0c257ba08437f04dd0 to your computer and use it in GitHub Desktop.
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment