Skip to content

Instantly share code, notes, and snippets.

@laurentsenta
Created September 12, 2021 16:06
Show Gist options
  • Save laurentsenta/82988d353d42079c15198634953c1ef9 to your computer and use it in GitHub Desktop.
Save laurentsenta/82988d353d42079c15198634953c1ef9 to your computer and use it in GitHub Desktop.
Timestamp Smart Contract
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