Skip to content

Instantly share code, notes, and snippets.

@shreyvijayvargiya
Created May 6, 2022 18:39
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 shreyvijayvargiya/a6d08701dec6f162b92a38346cea21ef to your computer and use it in GitHub Desktop.
Save shreyvijayvargiya/a6d08701dec6f162b92a38346cea21ef to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8;
contract DocumentRegistry {
mapping(string => uint256) documents;
address contractOwner = msg.sender;
function addDocument(string memory hash) public returns(uint256 timeStamp) {
require(contractOwner == address(this) , "Not a owner to store document");
documents[hash] = block.timestamp;
return block.timestamp;
}
function verifyDocument(string memory hash) public returns(uint256 dateAdded){
dateAdded = documents[hash];
return dateAdded;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment