Skip to content

Instantly share code, notes, and snippets.

@okstaticzero
Created February 26, 2018 03:09
Show Gist options
  • Save okstaticzero/f601872e82e29d1e7afc99f17ca016ae to your computer and use it in GitHub Desktop.
Save okstaticzero/f601872e82e29d1e7afc99f17ca016ae to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.18;
contract MyDetails {
mapping (address => string) ipfsHashes;
mapping (address => uint) timestamp;
function setHash(string ipfsHash) public {
ipfsHashes[msg.sender] = ipfsHash;
timestamp[msg.sender] = now;
}
function getHash(address account) public view returns(string, uint) {
return (ipfsHashes[account], timestamp[account]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment