Contract 0xF95034a99F06676313Aa10f7e67a5d1C253a1687

Contract Overview

Balance:
0 Ether
Txn Hash
Method
Block
From
To
Value
0x4dc69621d642c26b322c01843e1eb6b2f15572440d60c7192cfb2cbe9318f46d0x6060604016506912018-01-24 21:41:291767 days 22 hrs ago0x8b29a9eb2347d52d89f0678dde0ed033febdf4a7 IN  Create: CopyRight0 Ether0.0151008620
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CopyRight

Compiler Version
v0.4.20-nightly.2018.1.24+commit.b177352a

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-01-24
*/

pragma solidity ^0.4.11;


/**
 * @title Generic owned destroyable contract
 */
contract Object {
    address public owner;

    function  Object() public {
        owner = msg.sender;
    }

    /**
    * @dev Delegate contract to another person
    * @param _owner New owner address
    */
    function setOwner(address _owner) onlyOwner public {
        owner = _owner;
    }

    /**
     * @dev Destroy contract and scrub a data
     * @notice Only hammer can call it
     */
    function destroy() onlyOwner public {
        selfdestruct(msg.sender);
    }

    /**
     * @dev Owner check modifier
     */
    modifier onlyOwner {
        if (msg.sender != owner) revert();
        _;
    }
}

/**
*  TODO
*/
contract CopyRight is Object {
    struct Asset {
        address owner;
        bytes32 checksum;
        bytes32 description;
        uint createDate;
    }

    struct Owner {
        bytes32 name;
        uint createDate;
    }

    uint constant OK = 1;
    uint constant ALREADY_EXISTS = 1001;
    uint constant DOES_NOT_EXIST = 1002;
    uint constant NEW_OWNER_NO_NAME = 1003;
    uint constant ASSET_NOT_FOUND = 999;

    mapping (bytes32 => Asset) public assets;
    mapping (address => Owner) public owners;

    event AssetCreated(address indexed owner, bytes32 indexed _checksum, uint _createDate);
    event Error(address indexed sender, uint errorCode);
    event OwnerCreated(address indexed owner,bytes32 owner_name);
    event Log(string message);
        

    /**
    *  TODO
    */
     function createAsset(
         bytes32 _checksum,
         bytes32 _ownerName, 
         bytes32 _description, 
         uint _createDate) public
         
         returns (uint) {
             
        require(_checksum != 0x0);
        require(_description !=0);
        require(_createDate != 0);

        Log("Start CreateAsset");

        /** if owner is not yet stored, at least a name of the owner must be submitted */
        if (owners[msg.sender].name == 0x0) {
            if (_ownerName == 0x0) {
            Error(msg.sender, NEW_OWNER_NO_NAME);
            return NEW_OWNER_NO_NAME;
            }
        }

        /** create new owner, if not yet existing */
        if (owners[msg.sender].name == 0x0) {
            owners[msg.sender] = Owner(_ownerName,_createDate);
            OwnerCreated(msg.sender,_ownerName);
        }

        assets[_checksum] = Asset(msg.sender, _checksum, _description, _createDate);

        AssetCreated(msg.sender, _checksum, _createDate);

        return OK;
    }


    function getAssetbyHash(bytes32 _checksum) view returns (address,bytes32,uint, bytes32, bytes32, uint) {

        Asset storage asset = assets[_checksum];
     
        if (asset.owner == 0x0) {

            return (0x0,0x0,0x0,0x0,0x0,0);
        }
     
        Owner storage owner=owners[asset.owner];
        
        
        return (asset.owner,owner.name, owner.createDate, asset.checksum, asset.description, asset.createDate);
    }


   
    /**
    *  @notice If ether is sent to this address, send it back.
    */
    function () {
        throw;
    }
}

Contract ABI

[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"owners","outputs":[{"name":"name","type":"bytes32"},{"name":"createDate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"destroy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_checksum","type":"bytes32"}],"name":"getAssetbyHash","outputs":[{"name":"","type":"address"},{"name":"","type":"bytes32"},{"name":"","type":"uint256"},{"name":"","type":"bytes32"},{"name":"","type":"bytes32"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"assets","outputs":[{"name":"owner","type":"address"},{"name":"checksum","type":"bytes32"},{"name":"description","type":"bytes32"},{"name":"createDate","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_checksum","type":"bytes32"},{"name":"_ownerName","type":"bytes32"},{"name":"_description","type":"bytes32"},{"name":"_createDate","type":"uint256"}],"name":"createAsset","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"_checksum","type":"bytes32"},{"indexed":false,"name":"_createDate","type":"uint256"}],"name":"AssetCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sender","type":"address"},{"indexed":false,"name":"errorCode","type":"uint256"}],"name":"Error","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":false,"name":"owner_name","type":"bytes32"}],"name":"OwnerCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"message","type":"string"}],"name":"Log","type":"event"}]

6060604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a02806100536000396000f300606060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063022914a71461009357806313af4035146100ef57806383197ef0146101285780638da5cb5b1461013d57806394980cf9146101925780639fda5b6614610234578063c5b3d760146102c0575b341561008e57600080fd5b600080fd5b341561009e57600080fd5b6100ca600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061031e565b6040518083600019166000191681526020018281526020019250505060405180910390f35b34156100fa57600080fd5b610126600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610342565b005b341561013357600080fd5b61013b6103e0565b005b341561014857600080fd5b610150610454565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561019d57600080fd5b6101b7600480803560001916906020019091905050610479565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001866000191660001916815260200185815260200184600019166000191681526020018360001916600019168152602001828152602001965050505050505060405180910390f35b341561023f57600080fd5b6102596004808035600019169060200190919050506105d5565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018460001916600019168152602001836000191660001916815260200182815260200194505050505060405180910390f35b34156102cb57600080fd5b6103086004808035600019169060200190919080356000191690602001909190803560001916906020019091908035906020019091905050610625565b6040518082815260200191505060405180910390f35b60026020528060005260406000206000915090508060000154908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561039d57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561043b57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16ff5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600080600160008a60001916600019168152602001908152602001600020915060008260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561051a576000806000806000808595508460010294508393508260010292508160010291508090509750975097509750975097506105ca565b600260008360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16816000015482600101548460010154856002015486600301549750975097509750975097505b505091939550919395565b60016020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154905084565b60008060010285600019161415151561063d57600080fd5b600060010283600019161415151561065457600080fd5b6000821415151561066457600080fd5b7fcf34ef537ac33ee1ac626ca1587a0a7e8e51561e5514f8cb36afa1c5102b3bab6040518080602001828103825260118152602001807f537461727420437265617465417373657400000000000000000000000000000081525060200191505060405180910390a16000600102600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015460001916141561078957600060010284600019161415610788573373ffffffffffffffffffffffffffffffffffffffff167f9cf38cf2dbf9139f5c32639950507b10775fbbe0421f3e168bc2d1bb1ae3208c6103eb6040518082815260200191505060405180910390a26103eb90506109ce565b5b6000600102600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546000191614156108a75760408051908101604052808560001916815260200183815250600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000190600019169055602082015181600101559050503373ffffffffffffffffffffffffffffffffffffffff167f8a877d0b4aaa2c206992a6a8ffb3e139cecff80ff9f854802e6fd73ab33d5d3a8560405180826000191660001916815260200191505060405180910390a25b6080604051908101604052803373ffffffffffffffffffffffffffffffffffffffff16815260200186600019168152602001846000191681526020018381525060016000876000191660001916815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010190600019169055604082015181600201906000191690556060820151816003015590505084600019163373ffffffffffffffffffffffffffffffffffffffff167f6d73686504b99157ce795c816112d24406bf584ffee8b7b55a91bc198f647809846040518082815260200191505060405180910390a3600190505b9493505050505600a165627a7a723058203e79b6dd36ad9ed96a9d774a417b7e93288cc744de0d0ec2df82601795dd0ec80029

Swarm Source

bzzr://3e79b6dd36ad9ed96a9d774a417b7e93288cc744de0d0ec2df82601795dd0ec8
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading

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.