Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Latest 25 from a total of 132 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Store Hash | 6782339 | 68 days ago | IN | 0 ETH | 0.03421002 | ||||
Store Hash | 6250912 | 155 days ago | IN | 0 ETH | 0.00307666 | ||||
Store Hash | 6210635 | 161 days ago | IN | 0 ETH | 0.00485481 | ||||
Store Hash | 6206298 | 161 days ago | IN | 0 ETH | 0.00449217 | ||||
Store Hash | 6206239 | 161 days ago | IN | 0 ETH | 0.00438809 | ||||
Store Hash | 6194103 | 163 days ago | IN | 0 ETH | 0.00395051 | ||||
Store Hash | 6193877 | 163 days ago | IN | 0 ETH | 0.00723147 | ||||
Store Hash | 6193857 | 163 days ago | IN | 0 ETH | 0.00096755 | ||||
Store Hash | 6193709 | 163 days ago | IN | 0 ETH | 0.01729525 | ||||
Store Hash | 6193235 | 163 days ago | IN | 0 ETH | 0.00334459 | ||||
Store Hash | 6193161 | 163 days ago | IN | 0 ETH | 0.00248419 | ||||
Store Hash | 6193155 | 163 days ago | IN | 0 ETH | 0.00220972 | ||||
Store Hash | 6193150 | 163 days ago | IN | 0 ETH | 0.00135328 | ||||
Store Hash | 6193148 | 163 days ago | IN | 0 ETH | 0.00034691 | ||||
Store Hash | 6192878 | 163 days ago | IN | 0 ETH | 0.00314054 | ||||
Store Hash | 6192729 | 163 days ago | IN | 0 ETH | 0.05137066 | ||||
Store Hash | 6192709 | 163 days ago | IN | 0 ETH | 0.0040286 | ||||
Store Hash | 6192681 | 163 days ago | IN | 0 ETH | 0.01316384 | ||||
Store Hash | 6192650 | 163 days ago | IN | 0 ETH | 0.05408721 | ||||
Store Hash | 6192415 | 163 days ago | IN | 0 ETH | 0.01440513 | ||||
Store Hash | 6192344 | 163 days ago | IN | 0 ETH | 0.008521 | ||||
Store Hash | 6188458 | 164 days ago | IN | 0 ETH | 0.00472254 | ||||
Store Hash | 6187499 | 164 days ago | IN | 0 ETH | 0.03415608 | ||||
Store Hash | 6187494 | 164 days ago | IN | 0 ETH | 0.02745042 | ||||
Store Hash | 6187487 | 164 days ago | IN | 0 ETH | 0.0562474 |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
HashStorage
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@thirdweb-dev/contracts/extension/ContractMetadata.sol"; contract HashStorage is ContractMetadata { struct HashData { string hash; string metadata; } address public owner; constructor() { owner = msg.sender; } mapping(uint256 => HashData) public hashData; uint256 public hashCount; event HashStored(uint256 indexed id, string hash, string metadata); function storeHash(string memory _hash, string memory _metadata) public { hashData[hashCount] = HashData(_hash, _metadata); emit HashStored(hashCount, _hash, _metadata); hashCount++; } function _canSetContractURI() internal view virtual override returns (bool){ return msg.sender == owner; } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb import "./interface/IContractMetadata.sol"; /** * @title Contract Metadata * @notice Thirdweb's `ContractMetadata` is a contract extension for any base contracts. It lets you set a metadata URI * for you contract. * Additionally, `ContractMetadata` is necessary for NFT contracts that want royalties to get distributed on OpenSea. */ abstract contract ContractMetadata is IContractMetadata { /// @dev The sender is not authorized to perform the action error ContractMetadataUnauthorized(); /// @notice Returns the contract metadata URI. string public override contractURI; /** * @notice Lets a contract admin set the URI for contract-level metadata. * @dev Caller should be authorized to setup contractURI, e.g. contract admin. * See {_canSetContractURI}. * Emits {ContractURIUpdated Event}. * * @param _uri keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") */ function setContractURI(string memory _uri) external override { if (!_canSetContractURI()) { revert ContractMetadataUnauthorized(); } _setupContractURI(_uri); } /// @dev Lets a contract admin set the URI for contract-level metadata. function _setupContractURI(string memory _uri) internal { string memory prevURI = contractURI; contractURI = _uri; emit ContractURIUpdated(prevURI, _uri); } /// @dev Returns whether contract metadata can be set in the given execution context. function _canSetContractURI() internal view virtual returns (bool); }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; /// @author thirdweb /** * Thirdweb's `ContractMetadata` is a contract extension for any base contracts. It lets you set a metadata URI * for you contract. * * Additionally, `ContractMetadata` is necessary for NFT contracts that want royalties to get distributed on OpenSea. */ interface IContractMetadata { /// @dev Returns the metadata URI of the contract. function contractURI() external view returns (string memory); /** * @dev Sets contract URI for the storefront-level metadata of the contract. * Only module admin can call this function. */ function setContractURI(string calldata _uri) external; /// @dev Emitted when the contract URI is updated. event ContractURIUpdated(string prevURI, string newURI); }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "remappings": [ ":@thirdweb-dev/=node_modules/@thirdweb-dev/", ":forge-std/=lib/forge-std/src/" ], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ContractMetadataUnauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"prevURI","type":"string"},{"indexed":false,"internalType":"string","name":"newURI","type":"string"}],"name":"ContractURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"string","name":"hash","type":"string"},{"indexed":false,"internalType":"string","name":"metadata","type":"string"}],"name":"HashStored","type":"event"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hashCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"hashData","outputs":[{"internalType":"string","name":"hash","type":"string"},{"internalType":"string","name":"metadata","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_hash","type":"string"},{"internalType":"string","name":"_metadata","type":"string"}],"name":"storeHash","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052348015600f57600080fd5b50600180546001600160a01b03191633179055610810806100316000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80635bebd9d7146100675780636f28ee09146100835780638da5cb5b14610098578063938e3d7b146100c35780639512182e146100d6578063e8a3d485146100f7575b600080fd5b61007060035481565b6040519081526020015b60405180910390f35b61009661009136600461051e565b61010c565b005b6001546100ab906001600160a01b031681565b6040516001600160a01b03909116815260200161007a565b6100966100d1366004610587565b6101ad565b6100e96100e43660046105c4565b6101e4565b60405161007a929190610623565b6100ff610310565b60405161007a9190610651565b604080518082018252838152602080820184905260035460009081526002909152919091208151819061013f90826106f4565b506020820151600182019061015490826106f4565b509050506003547f962fb7a924159dc0966b10da109020686f23e058ede690e3b46058d486099dee838360405161018c929190610623565b60405180910390a2600380549060006101a4836107b3565b91905055505050565b6001546001600160a01b031633146101d857604051639f7f092560e01b815260040160405180910390fd5b6101e18161039e565b50565b6002602052600090815260409020805481906101ff9061066b565b80601f016020809104026020016040519081016040528092919081815260200182805461022b9061066b565b80156102785780601f1061024d57610100808354040283529160200191610278565b820191906000526020600020905b81548152906001019060200180831161025b57829003601f168201915b50505050509080600101805461028d9061066b565b80601f01602080910402602001604051908101604052809291908181526020018280546102b99061066b565b80156103065780601f106102db57610100808354040283529160200191610306565b820191906000526020600020905b8154815290600101906020018083116102e957829003601f168201915b5050505050905082565b6000805461031d9061066b565b80601f01602080910402602001604051908101604052809291908181526020018280546103499061066b565b80156103965780601f1061036b57610100808354040283529160200191610396565b820191906000526020600020905b81548152906001019060200180831161037957829003601f168201915b505050505081565b60008080546103ac9061066b565b80601f01602080910402602001604051908101604052809291908181526020018280546103d89061066b565b80156104255780601f106103fa57610100808354040283529160200191610425565b820191906000526020600020905b81548152906001019060200180831161040857829003601f168201915b50505050509050816000908161043b91906106f4565b507fc9c7c3fe08b88b4df9d4d47ef47d2c43d55c025a0ba88ca442580ed9e7348a16818360405161046d929190610623565b60405180910390a15050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126104a057600080fd5b813567ffffffffffffffff8111156104ba576104ba610479565b604051601f8201601f19908116603f0116810167ffffffffffffffff811182821017156104e9576104e9610479565b60405281815283820160200185101561050157600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561053157600080fd5b823567ffffffffffffffff81111561054857600080fd5b6105548582860161048f565b925050602083013567ffffffffffffffff81111561057157600080fd5b61057d8582860161048f565b9150509250929050565b60006020828403121561059957600080fd5b813567ffffffffffffffff8111156105b057600080fd5b6105bc8482850161048f565b949350505050565b6000602082840312156105d657600080fd5b5035919050565b6000815180845260005b81811015610603576020818501810151868301820152016105e7565b506000602082860101526020601f19601f83011685010191505092915050565b60408152600061063660408301856105dd565b828103602084015261064881856105dd565b95945050505050565b60208152600061066460208301846105dd565b9392505050565b600181811c9082168061067f57607f821691505b60208210810361069f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156106ef57806000526020600020601f840160051c810160208510156106cc5750805b601f840160051c820191505b818110156106ec57600081556001016106d8565b50505b505050565b815167ffffffffffffffff81111561070e5761070e610479565b6107228161071c845461066b565b846106a5565b6020601f821160018114610756576000831561073e5750848201515b600019600385901b1c1916600184901b1784556106ec565b600084815260208120601f198516915b828110156107865787850151825560209485019460019092019101610766565b50848210156107a45786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6000600182016107d357634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220dfa1c0c5927be5b28578bb539538b82b10bf868298c9c73698e5968a53ba1c4764736f6c634300081a0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80635bebd9d7146100675780636f28ee09146100835780638da5cb5b14610098578063938e3d7b146100c35780639512182e146100d6578063e8a3d485146100f7575b600080fd5b61007060035481565b6040519081526020015b60405180910390f35b61009661009136600461051e565b61010c565b005b6001546100ab906001600160a01b031681565b6040516001600160a01b03909116815260200161007a565b6100966100d1366004610587565b6101ad565b6100e96100e43660046105c4565b6101e4565b60405161007a929190610623565b6100ff610310565b60405161007a9190610651565b604080518082018252838152602080820184905260035460009081526002909152919091208151819061013f90826106f4565b506020820151600182019061015490826106f4565b509050506003547f962fb7a924159dc0966b10da109020686f23e058ede690e3b46058d486099dee838360405161018c929190610623565b60405180910390a2600380549060006101a4836107b3565b91905055505050565b6001546001600160a01b031633146101d857604051639f7f092560e01b815260040160405180910390fd5b6101e18161039e565b50565b6002602052600090815260409020805481906101ff9061066b565b80601f016020809104026020016040519081016040528092919081815260200182805461022b9061066b565b80156102785780601f1061024d57610100808354040283529160200191610278565b820191906000526020600020905b81548152906001019060200180831161025b57829003601f168201915b50505050509080600101805461028d9061066b565b80601f01602080910402602001604051908101604052809291908181526020018280546102b99061066b565b80156103065780601f106102db57610100808354040283529160200191610306565b820191906000526020600020905b8154815290600101906020018083116102e957829003601f168201915b5050505050905082565b6000805461031d9061066b565b80601f01602080910402602001604051908101604052809291908181526020018280546103499061066b565b80156103965780601f1061036b57610100808354040283529160200191610396565b820191906000526020600020905b81548152906001019060200180831161037957829003601f168201915b505050505081565b60008080546103ac9061066b565b80601f01602080910402602001604051908101604052809291908181526020018280546103d89061066b565b80156104255780601f106103fa57610100808354040283529160200191610425565b820191906000526020600020905b81548152906001019060200180831161040857829003601f168201915b50505050509050816000908161043b91906106f4565b507fc9c7c3fe08b88b4df9d4d47ef47d2c43d55c025a0ba88ca442580ed9e7348a16818360405161046d929190610623565b60405180910390a15050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126104a057600080fd5b813567ffffffffffffffff8111156104ba576104ba610479565b604051601f8201601f19908116603f0116810167ffffffffffffffff811182821017156104e9576104e9610479565b60405281815283820160200185101561050157600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561053157600080fd5b823567ffffffffffffffff81111561054857600080fd5b6105548582860161048f565b925050602083013567ffffffffffffffff81111561057157600080fd5b61057d8582860161048f565b9150509250929050565b60006020828403121561059957600080fd5b813567ffffffffffffffff8111156105b057600080fd5b6105bc8482850161048f565b949350505050565b6000602082840312156105d657600080fd5b5035919050565b6000815180845260005b81811015610603576020818501810151868301820152016105e7565b506000602082860101526020601f19601f83011685010191505092915050565b60408152600061063660408301856105dd565b828103602084015261064881856105dd565b95945050505050565b60208152600061066460208301846105dd565b9392505050565b600181811c9082168061067f57607f821691505b60208210810361069f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156106ef57806000526020600020601f840160051c810160208510156106cc5750805b601f840160051c820191505b818110156106ec57600081556001016106d8565b50505b505050565b815167ffffffffffffffff81111561070e5761070e610479565b6107228161071c845461066b565b846106a5565b6020601f821160018114610756576000831561073e5750848201515b600019600385901b1c1916600184901b1784556106ec565b600084815260208120601f198516915b828110156107865787850151825560209485019460019092019101610766565b50848210156107a45786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b6000600182016107d357634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220dfa1c0c5927be5b28578bb539538b82b10bf868298c9c73698e5968a53ba1c4764736f6c634300081a0033
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.