[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Contract Source Code Verified (Exact Match)
Contract Name: CaseReport
Compiler Version: v0.5.2+commit.1df8f40c
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity >=0.4.22 <0.6.0;

contract CaseReport {

    address owner;

    struct Case {
        bytes32 hash;
        uint time;
        uint8 updateCount;
    }
    mapping (bytes5 => Case) caseList;
    /*
    caseID: 32 bytes
    0: reserved for hash value update (default: 0)
    1: Year (ex: 106)
    2~3: serial number (ex: 300)
    */

    constructor() public {
        owner = msg.sender;
    }

    function createCase(bytes5 caseID, bytes32 hash) public {
        require(msg.sender == owner, "Permission Denied.");
        require(bytes1(caseID) == 0, 'The first byte must be zero');
        if (caseList[caseID].hash == 0x0 && caseList[caseID].time == 0) {
            caseList[caseID].hash = hash;
            caseList[caseID].time = now;
        } else {
            require(caseList[caseID].updateCount < 255, "Update count limit reached.");
            caseList[caseID].updateCount += 1;
            caseList[caseID | bytes1(caseList[caseID].updateCount)].hash = hash;
            caseList[caseID | bytes1(caseList[caseID].updateCount)].time = now;
        }
    }

    function getCase(bytes5 caseID) public view returns (bytes32, uint, uint8) {
        return (caseList[caseID].hash, caseList[caseID].time, caseList[caseID].updateCount);
    }

}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"caseID","type":"bytes5"}],"name":"getCase","outputs":[{"name":"","type":"bytes32"},{"name":"","type":"uint256"},{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"caseID","type":"bytes5"},{"name":"hash","type":"bytes32"}],"name":"createCase","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]

  Contract Creation Code Switch To Opcodes View
608060405234801561001057600080fd5b5060008054600160a060020a031916331790556103e1806100326000396000f3fe608060405234801561001057600080fd5b5060043610610052577c010000000000000000000000000000000000000000000000000000000060003504630f9b096c81146100575780636799784e1461009f575b600080fd5b61007e6004803603602081101561006d57600080fd5b5035600160d860020a0319166100ce565b60408051938452602084019290925260ff1682820152519081900360600190f35b6100cc600480360360408110156100b557600080fd5b50600160d860020a031981351690602001356100ff565b005b600160d860020a03191660009081526001602081905260409091208054918101546002909101549192909160ff1690565b60005473ffffffffffffffffffffffffffffffffffffffff16331461018557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f5065726d697373696f6e2044656e6965642e0000000000000000000000000000604482015290519081900360640190fd5b7fff0000000000000000000000000000000000000000000000000000000000000082161561021457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f5468652066697273742062797465206d757374206265207a65726f0000000000604482015290519081900360640190fd5b600160d860020a031982166000908152600160205260409020541580156102565750600160d860020a0319821660009081526001602081905260409091200154155b1561028357600160d860020a031982166000908152600160208190526040909120828155429101556103b1565b600160d860020a0319821660009081526001602052604090206002015460ff9081161061031157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f55706461746520636f756e74206c696d697420726561636865642e0000000000604482015290519081900360640190fd5b600160d860020a03198281166000908152600160208190526040808320600201805460ff19811660ff918216850182161780835581167f01000000000000000000000000000000000000000000000000000000000000009081027fff000000000000000000000000000000000000000000000000000000000000009081168a17881687528487208990559254909116021686179093168252919020429101555b505056fea165627a7a723058202da727e8741859f51df044ff1cf680bc2248b6bf0057c7bffcfd402f18d4e59a0029

   Swarm Source:
bzzr://2da727e8741859f51df044ff1cf680bc2248b6bf0057c7bffcfd402f18d4e59a

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward