Verified contractExactMIT
OriginStamp
Address0xcb9ce35a9731f4c40e1d63062f680ff0f4f0ca6f
- Balance
0 ETH
- Transactions
3
- Compiler
solc 0.8.30
- Same code
Only this contract
Details
- Compiler
- solc 0.8.30+commit.73712a01
- Language
- solidity
- Optimization
- No
- EVM version
- prague
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 24,867,475
- Creation transaction
- 0x911a4e6460…24c6c84566
src/OriginStamp.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.30;
/**
* @title OriginStamp
* @notice Proof of creation, register a hash to prove authorship at a point in time.
*/
contract OriginStamp {
struct Stamp {
address creator;
uint96 timestamp;
}
mapping(bytes32 => Stamp) public stamps;
event Stamped(bytes32 indexed hash, address indexed creator, uint96 timestamp);
error AlreadyStamped(bytes32 hash);
// @notice Register the content hash. First caller wins, the hash cannot be overwritten.
function stamp(bytes32 hash) external {
if (stamps[hash].creator != address(0)) revert AlreadyStamped(hash);
stamps[hash] = Stamp({creator: msg.sender, timestamp: uint96(block.timestamp)});
emit Stamped(hash, msg.sender, uint96(block.timestamp));
}
// @notice Check whether a given hash has been registered.
function verify(bytes32 hash) external view returns (address creator, uint96 timestamp) {
Stamp memory s = stamps[hash];
return (s.creator, s.timestamp);
}
}
Compiler settingsShow
{
"viaIR": false,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"runs": 200,
"enabled": false
},
"evmVersion": "prague",
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.