Skip to content

Instantly share code, notes, and snippets.

@daniellehrner
Last active April 5, 2019 15:03
Show Gist options
  • Save daniellehrner/3edce3ab6297f5f8ca0007a68a0d1d7a to your computer and use it in GitHub Desktop.
Save daniellehrner/3edce3ab6297f5f8ca0007a68a0d1d7a to your computer and use it in GitHub Desktop.
Eternal storage for uint256
mapping(bytes32 => uint256) internal uInt256Storage;
function getUInt256(bytes32 _key) external view returns (uint256) {
return uInt256Storage[_key];
}
function setUInt256(bytes32 _key, uint256 _value) external {
uInt256Storage[_key] = _value;
}
function deleteUInt256(bytes32 _key) external {
delete uInt256Storage[_key];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment