Created
September 12, 2021 16:06
-
-
Save laurentsenta/82988d353d42079c15198634953c1ef9 to your computer and use it in GitHub Desktop.
Timestamp Smart Contract
This file contains hidden or 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
pragma solidity ^0.8.0; | |
import "hardhat/console.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract Timestamper is Ownable { | |
event Timestamp(uint256 indexed hash); | |
function timestamp(uint256 hash) public onlyOwner { | |
console.log("Timestamping:", hash); | |
emit Timestamp(hash); | |
} | |
function batchTimestamp(uint256[] memory hashes) public onlyOwner { | |
for (uint256 i = 0; i < hashes.length; i++) { | |
emit Timestamp(hashes[i]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment