Skip to content

Instantly share code, notes, and snippets.

@chfast
Created February 4, 2016 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chfast/c733ff5a18164a94ebcb to your computer and use it in GitHub Desktop.
Save chfast/c733ff5a18164a94ebcb to your computer and use it in GitHub Desktop.
contract Timestamping {
mapping(bytes32 => uint256) stamps;
function Timestamping() {
set_stamp("hello world");
}
function set_stamp(bytes32 hash) {
stamps[hash] = block.timestamp;
// FIXME: prevent reseting stamp
}
function get_stamp(bytes32 hash) returns (uint256) {
return stamps[hash];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment