账户
0xa8...1e61
0xA8...1e61

0xA8...1e61

$500
此合同的源代码已经过验证!
合同元数据
编译器
0.7.0+commit.9e61f92b
语言
Solidity
合同源代码
文件 1 的 1:fsdafsdnotary.sol
pragma solidity ^0.7.0;

// "SPDX-License-Identifier: UNLICENSED"

contract Hashes {
    event HashAdded(address indexed sender, bytes32 hash, uint256 blockNumber);

    mapping (bytes32 => uint256) private hashes;
    
    function addHash (bytes32 _hash) public {
        require(hashes[_hash] == 0, "The hash was already added");
        
        hashes[_hash] = block.number;
        
        emit HashAdded(msg.sender, _hash, block.number);
    }
    
    function findHash (bytes32 _hash) public view returns(uint) {
        return hashes[_hash];
    }
}
设置
{
  "compilationTarget": {
    "browser/fsdafsdnotary.sol": "Hashes"
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": []
}
ABI
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"HashAdded","type":"event"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"addHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_hash","type":"bytes32"}],"name":"findHash","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]