-
-
Save shreyvijayvargiya/a6d08701dec6f162b92a38346cea21ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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