Contract 0x535cefd04b41556ef56503fca644bd11c8426420

Contract Overview

Balance:
0 Ether

Token:
TxHash Block Age From To Value [TxFee]
0x536f3761316b630c96e225435517ac8a13321308d376b876cc1bebd9aaa364e1367734567 days 15 hrs ago0xb94175da2f8a6be1ad9518d9dbde6230dd0e622a IN  0x535cefd04b41556ef56503fca644bd11c84264200 Ether0.00046506
0xb76f7f3d0a91096290fb37af49fdf96ad1332d07b7c930294589b65bebf02fd2367733867 days 15 hrs ago0xb94175da2f8a6be1ad9518d9dbde6230dd0e622a IN  0x535cefd04b41556ef56503fca644bd11c84264200 Ether0.00100119
0x4ade5ba8fa71bc84e92a6046da91accb5c9bddc2667490b39e8248f046f8665a367731867 days 15 hrs ago0xb94175da2f8a6be1ad9518d9dbde6230dd0e622a IN  0x535cefd04b41556ef56503fca644bd11c84264200 Ether0.000124685
0xd74ff12f4b6d837606810b4b55f212ea7a9b96650d858887a9cd545c29b29fe1367730967 days 15 hrs ago0xb94175da2f8a6be1ad9518d9dbde6230dd0e622a IN  0x535cefd04b41556ef56503fca644bd11c84264200 Ether0.0005036868
0x7dc3bc41d215795e19842b8cdccb31b6e7652cd5c8eac054f1ec691d9794961a367730067 days 15 hrs ago0xb94175da2f8a6be1ad9518d9dbde6230dd0e622a IN  0x535cefd04b41556ef56503fca644bd11c84264200 Ether0.0004909806
0x52f51604751d44fd9a7ef6f18b1dad0661e37dea291086795f0ca32786f1b8cf367727467 days 15 hrs ago0xb94175da2f8a6be1ad9518d9dbde6230dd0e622a IN  0x535cefd04b41556ef56503fca644bd11c84264200 Ether0.004174041
0xce8f860d39ef8670cc0b1e9d309c818672406dc3be7c5bfe707dc19241fb1e92367711767 days 16 hrs ago0xb94175da2f8a6be1ad9518d9dbde6230dd0e622a IN  0x535cefd04b41556ef56503fca644bd11c84264200 Ether0.0024937
0x4c3eeefa95d14363906bbbb717808f0274e0165d422cbf45cbf0edefb9b44449367703267 days 16 hrs ago0xb94175da2f8a6be1ad9518d9dbde6230dd0e622a IN  Contract Creation0 Ether0.04846046
[ Download CSV Export 

Latest 18 internal transactions Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
0xefd04478013b2991c24a6ff323745a5fbc4ccfbb584a1ef92030c1a1e55849ec367745367 days 14 hrs ago0x535cefd04b41556ef56503fca644bd11c84264200xceb158068523a1bcb4411a38d5660e1267ec7ac00 Ether
0xefd04478013b2991c24a6ff323745a5fbc4ccfbb584a1ef92030c1a1e55849ec367745367 days 14 hrs ago0xceb158068523a1bcb4411a38d5660e1267ec7ac00x535cefd04b41556ef56503fca644bd11c84264200 Ether
0xefd04478013b2991c24a6ff323745a5fbc4ccfbb584a1ef92030c1a1e55849ec367745367 days 14 hrs ago0xceb158068523a1bcb4411a38d5660e1267ec7ac00x535cefd04b41556ef56503fca644bd11c84264200 Ether
0xefd04478013b2991c24a6ff323745a5fbc4ccfbb584a1ef92030c1a1e55849ec367745367 days 14 hrs ago0xceb158068523a1bcb4411a38d5660e1267ec7ac00x535cefd04b41556ef56503fca644bd11c84264200 Ether
0xefd04478013b2991c24a6ff323745a5fbc4ccfbb584a1ef92030c1a1e55849ec367745367 days 14 hrs ago0xceb158068523a1bcb4411a38d5660e1267ec7ac00x535cefd04b41556ef56503fca644bd11c84264200 Ether
0xefd04478013b2991c24a6ff323745a5fbc4ccfbb584a1ef92030c1a1e55849ec367745367 days 14 hrs ago0xceb158068523a1bcb4411a38d5660e1267ec7ac00x535cefd04b41556ef56503fca644bd11c84264200 Ether
0x536f3761316b630c96e225435517ac8a13321308d376b876cc1bebd9aaa364e1367734567 days 15 hrs ago0x535cefd04b41556ef56503fca644bd11c84264200xceb158068523a1bcb4411a38d5660e1267ec7ac00 Ether
0xb76f7f3d0a91096290fb37af49fdf96ad1332d07b7c930294589b65bebf02fd2367733867 days 15 hrs ago0x535cefd04b41556ef56503fca644bd11c84264200xceb158068523a1bcb4411a38d5660e1267ec7ac00 Ether
0xb76f7f3d0a91096290fb37af49fdf96ad1332d07b7c930294589b65bebf02fd2367733867 days 15 hrs ago0x535cefd04b41556ef56503fca644bd11c84264200xceb158068523a1bcb4411a38d5660e1267ec7ac00 Ether
0x7dc3bc41d215795e19842b8cdccb31b6e7652cd5c8eac054f1ec691d9794961a367730067 days 15 hrs ago0x535cefd04b41556ef56503fca644bd11c84264200xceb158068523a1bcb4411a38d5660e1267ec7ac00 Ether
0x52f51604751d44fd9a7ef6f18b1dad0661e37dea291086795f0ca32786f1b8cf367727467 days 15 hrs ago0x535cefd04b41556ef56503fca644bd11c84264200xceb158068523a1bcb4411a38d5660e1267ec7ac00 Ether
0x52f51604751d44fd9a7ef6f18b1dad0661e37dea291086795f0ca32786f1b8cf367727467 days 15 hrs ago0x535cefd04b41556ef56503fca644bd11c84264200xceb158068523a1bcb4411a38d5660e1267ec7ac00 Ether
0x842d53de32aac6bb38ccefa600be197c3c1520f09ce413b290dad1788d8b6882367713967 days 16 hrs ago0x535cefd04b41556ef56503fca644bd11c84264200xceb158068523a1bcb4411a38d5660e1267ec7ac00 Ether
0x842d53de32aac6bb38ccefa600be197c3c1520f09ce413b290dad1788d8b6882367713967 days 16 hrs ago0xceb158068523a1bcb4411a38d5660e1267ec7ac00x535cefd04b41556ef56503fca644bd11c84264200 Ether
0x842d53de32aac6bb38ccefa600be197c3c1520f09ce413b290dad1788d8b6882367713967 days 16 hrs ago0xceb158068523a1bcb4411a38d5660e1267ec7ac00x535cefd04b41556ef56503fca644bd11c84264200 Ether
0x842d53de32aac6bb38ccefa600be197c3c1520f09ce413b290dad1788d8b6882367713967 days 16 hrs ago0xceb158068523a1bcb4411a38d5660e1267ec7ac00x535cefd04b41556ef56503fca644bd11c84264200 Ether
0x842d53de32aac6bb38ccefa600be197c3c1520f09ce413b290dad1788d8b6882367713967 days 16 hrs ago0xceb158068523a1bcb4411a38d5660e1267ec7ac00x535cefd04b41556ef56503fca644bd11c84264200 Ether
0x842d53de32aac6bb38ccefa600be197c3c1520f09ce413b290dad1788d8b6882367713967 days 16 hrs ago0xceb158068523a1bcb4411a38d5660e1267ec7ac00x535cefd04b41556ef56503fca644bd11c84264200 Ether
[ Download CSV Export 
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Exact Match)

Contract Name:
ArtChain

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes

Runs (Optimizer):
200

Contract Source Code

pragma solidity ^0.4.24;

//==============================================================================
// struct
//==============================================================================
library ArtChainData {
    struct ArtItem {
        uint256 id;
        uint256 price;
        uint256 lastTransPrice;
        address owner;
        bool isExist;
    }

    struct Player {
        uint256 id;     // player id
        address addr;   // player address
        bytes32 name;   // player name
        uint256 laffId;   // affiliate id

        uint256[] ownItemIds;
    }
}

contract ArtChainEvents {
    // event onNewPlayer
    // (
    //     uint256 indexed playerID,
    //     address indexed playerAddress,
    //     bytes32 indexed playerName,
    //     uint256 affiliateID,
    //     address affiliateAddress,
    //     uint256 timeStamp
    // );

    event onTransferItem
    (
        address from,
        address to,
        uint256 itemId,
        uint256 price,
        uint256 timeStamp
    );
}

contract ArtChain is ArtChainEvents {
    using SafeMath for *;
    using NameFilter for string;

    YibTokenInterface constant private YibTokenContract = YibTokenInterface(0xceB158068523A1bcB4411A38d5660E1267Ec7AC0);

    //****************
    // constant
    //****************
    address private ceo;
    
    string constant public name = "artChain";
    string constant public symbol = "artChain";  

    //****************
    // var
    //****************
    address private coo;

    bool public paused = false;

    uint256 public priceGainPercentPerYear = 8;  

    uint256 public affPercentCut = 3;  

    uint256 pIdCount = 0;

    //****************
    // DATA MAP
    //****************
    mapping(uint256 => ArtChainData.ArtItem) public artItemMap;
    uint256[] public itemIds;

    mapping (address => uint256) public pIDxAddr;          
    mapping (uint256 => ArtChainData.Player) public playerMap;    

    //==============================================================================
    // init
    //==============================================================================
    constructor() public {
        ceo = msg.sender;

        pIdCount++;
        playerMap[pIdCount].id = pIdCount;
        playerMap[pIdCount].addr = 0xe27c188521248a49adfc61090d3c8ab7c3754e0a;
        playerMap[pIdCount].name = "matt";
        pIDxAddr[0xe27c188521248a49adfc61090d3c8ab7c3754e0a] = pIdCount;
    }

    //==============================================================================
    // checks
    //==============================================================================
    modifier onlyCeo() {
        require(msg.sender == ceo,"msg sender is not ceo");
        _;
    }

    modifier onlyCoo() {
        require(msg.sender == coo,"msg sender is not coo");
        _;
    }

    modifier onlyCLevel() {
        require(
            msg.sender == coo || msg.sender == ceo
            ,"msg sender is not c level"
        );
        _;
    }

    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    modifier whenPaused {
        require(paused);
        _;
    }

    modifier isHuman() {
        address _addr = msg.sender;
        uint256 _codeLength;

        assembly {_codeLength := extcodesize(_addr)}
        require(_codeLength == 0, "sorry humans only");
        _;
    }

    //==============================================================================
    // admin
    //==============================================================================
    function pause() public onlyCLevel whenNotPaused {
        paused = true;
    }

    function unpause() public onlyCeo whenPaused {
        paused = false;
    }

    function setCoo(address _newCOO) public onlyCeo {
        require(_newCOO != address(0));
        coo = _newCOO;
    }

    function setPriceGainRate(uint256 _newRate) public onlyCLevel {
        priceGainPercentPerYear = _newRate;
    }

    function addNewItem(uint256 _tokenId, uint256 _price) public onlyCLevel {
        require(artItemMap[_tokenId].isExist == false);

        ArtChainData.ArtItem memory _item = ArtChainData.ArtItem({
            id: _tokenId,
            price: _price,
            lastTransPrice: 0,
            owner: this,
            isExist: true
        });
        itemIds.push(_tokenId);

        artItemMap[_tokenId] = _item;
    }

    function deleteItem(uint256 _tokenId) public onlyCLevel {
        require(artItemMap[_tokenId].isExist, "item not exist");

        for(uint256 i = 0; i < itemIds.length; i++) {
            if(itemIds[i] == _tokenId) {
                itemIds[i] = itemIds[itemIds.length - 1];
                break;
            }
        }
        itemIds.length --;
        delete artItemMap[_tokenId];
    }

    function setItemPrice(uint256 _tokenId, uint256 _price) public onlyCLevel {
        require(artItemMap[_tokenId].isExist == true);
        //require(isItemSell(_tokenId) == false);
        
        artItemMap[_tokenId].price = _price;
    }

    function updateSellItemPriceDaily() public onlyCLevel {
        for(uint256 i = 0; i < itemIds.length; i++) {
            if(isItemSell(itemIds[i])) {
                uint256 _price = artItemMap[itemIds[i]].price;
                artItemMap[itemIds[i]].price = _price.mul(priceGainPercentPerYear).div(365).add(_price);
            }
        }
    }

    //==============================================================================
    // query
    //==============================================================================
    function isPaused()
        public
        view
        returns (bool)
    {
        return paused;
    }

    function isItemExist(uint256 _tokenId)
        public
        view
        returns (bool)
    {
        return artItemMap[_tokenId].isExist;
    }

    function isItemSell(uint256 _tokenId) 
        public
        view
        returns (bool)
    {
        require(artItemMap[_tokenId].isExist == true, "item not exist");

        return artItemMap[_tokenId].owner != address(this);
    }

    function getItemPrice(uint256 _tokenId)
        public
        view
        returns (uint256)
    {
        require(artItemMap[_tokenId].isExist == true, "item not exist");

        return artItemMap[_tokenId].price;
    }

    //==============================================================================
    // public
    //==============================================================================
    function buyItem(address _buyer, uint256 _tokenId, uint256 _affCode)
        whenNotPaused()
        external
    {
        uint256 _pId = determinePID(_buyer, _affCode);

        require(artItemMap[_tokenId].isExist == true, "item not exist");
        require(isItemSell(_tokenId) == false, "item already sold");

        bool isSuccess = YibTokenContract.transferFrom(msg.sender, this, artItemMap[_tokenId].price);
        require(isSuccess, "yib transfer from failed");

        artItemMap[_tokenId].owner = _buyer;
        artItemMap[_tokenId].lastTransPrice = artItemMap[_tokenId].price;

        playerMap[_pId].ownItemIds.push(_tokenId);

        if(playerMap[_pId].laffId != 0) {
            uint256 _affCut = (artItemMap[_tokenId].price).mul(affPercentCut).div(100);
            address _affAddr = playerMap[playerMap[_pId].laffId].addr;
            YibTokenContract.transfer(_affAddr, _affCut);
        }
        
        emit ArtChainEvents.onTransferItem ({
            from: this,
            to: _buyer,
            itemId: _tokenId,
            price: artItemMap[_tokenId].price,
            timeStamp: now
        });
    }

    function sellItem(uint256 _tokenId) 
        whenNotPaused()
        isHuman()
        public
    {
        require(artItemMap[_tokenId].isExist == true, "item not exist");
        require(artItemMap[_tokenId].owner  == msg.sender,"player not own this item");

        bool isSuccess = YibTokenContract.transfer(msg.sender, artItemMap[_tokenId].price);
        require(isSuccess,"yib transfer failed");

        artItemMap[_tokenId].owner = this;
        artItemMap[_tokenId].lastTransPrice = artItemMap[_tokenId].price;

        uint256 _pId = pIDxAddr[msg.sender];
        uint _itemIndex;
        bool _isFound = false;
        for (uint i = 0; i < playerMap[_pId].ownItemIds.length; i++) {
            if(playerMap[_pId].ownItemIds[i] == _tokenId)
            {
                _itemIndex = i;
                _isFound = true;
                break;
            }
        }
        if(_isFound) {
            playerMap[_pId].ownItemIds[_itemIndex] = playerMap[_pId].ownItemIds[playerMap[_pId].ownItemIds.length - 1];
        }
        playerMap[_pId].ownItemIds.length--;

        emit ArtChainEvents.onTransferItem ({
            from: msg.sender,
            to: this,
            itemId: _tokenId,
            price: artItemMap[_tokenId].price,
            timeStamp: now
        });
    }

    function registerPlayer(string _nameString, uint256 _affCode) 
        whenNotPaused()
        isHuman()
        public
    {
        uint256 _pId = determinePID(msg.sender, _affCode);
        bytes32 _name = _nameString.nameFilter();
        playerMap[_pId].name = _name;
    }

    //==============================================================================
    // private
    //==============================================================================

    function determinePID(address _addr, uint256 _affCode)
        private
        returns(uint256)
    {
        if (pIDxAddr[_addr] == 0)
        {
            pIdCount++;
            pIDxAddr[_addr] = pIdCount;

            playerMap[pIdCount].id = pIdCount;
            playerMap[pIdCount].addr = _addr;
        } 
        uint256 _pId = pIDxAddr[_addr];
        playerMap[_pId].laffId = _affCode;
        return _pId;
    }

}

//==============================================================================
// interface
//==============================================================================
interface YibTokenInterface {
    function transferFrom(address from, address to, uint256 value) external returns (bool);
    function transfer(address to, uint256 value) external returns (bool);
    function balanceOf(address addr) external view returns (uint256);
}


library NameFilter {

    function nameFilter(string _input)
        internal
        pure
        returns(bytes32)
    {
        bytes memory _temp = bytes(_input);
        uint256 _length = _temp.length;

        //sorry limited to 32 characters
        require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters");
        // make sure it doesnt start with or end with space
        require(_temp[0] != 0x20 && _temp[_length-1] != 0x20, "string cannot start or end with space");
        // make sure first two characters are not 0x
        if (_temp[0] == 0x30)
        {
            require(_temp[1] != 0x78, "string cannot start with 0x");
            require(_temp[1] != 0x58, "string cannot start with 0X");
        }

        // create a bool to track if we have a non number character
        bool _hasNonNumber;

        // convert & check
        for (uint256 i = 0; i < _length; i++)
        {
            // if its uppercase A-Z
            if (_temp[i] > 0x40 && _temp[i] < 0x5b)
            {
                // convert to lower case a-z
                _temp[i] = byte(uint(_temp[i]) + 32);

                // we have a non number
                if (_hasNonNumber == false)
                    _hasNonNumber = true;
            } else {
                require
                (
                    // require character is a space
                    _temp[i] == 0x20 ||
                    // OR lowercase a-z
                    (_temp[i] > 0x60 && _temp[i] < 0x7b) ||
                    // or 0-9
                    (_temp[i] > 0x2f && _temp[i] < 0x3a),
                    "string contains invalid characters"
                );
                // make sure theres not 2x spaces in a row
                if (_temp[i] == 0x20)
                    require( _temp[i+1] != 0x20, "string cannot contain consecutive spaces");

                // see if we have a character other than a number
                if (_hasNonNumber == false && (_temp[i] < 0x30 || _temp[i] > 0x39))
                    _hasNonNumber = true;
            }
        }

        require(_hasNonNumber == true, "string cannot be only numbers");

        bytes32 _ret;
        assembly {
            _ret := mload(add(_temp, 32))
        }
        return (_ret);
    }
}

library SafeMath 
{
    /**
    * @dev Multiplies two numbers, reverts on overflow.
    */
    function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
        if (_a == 0) {
            return 0;
        }

        uint256 c = _a * _b;
        require(c / _a == _b);

        return c;
    }

    /**
    * @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
    */
    function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
        require(_b > 0); // Solidity only automatically asserts when dividing by 0
        uint256 c = _a / _b;
        // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold

        return c;
    }

    /**
    * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
    */
    function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
        require(_b <= _a);
        uint256 c = _a - _b;

        return c;
    }

    /**
    * @dev Adds two numbers, reverts on overflow.
    */
    function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
        uint256 c = _a + _b;
        require(c >= _a);

        return c;
    }

    /**
    * @dev Divides two numbers and returns the remainder (unsigned integer modulo),
    * reverts when dividing by zero.
    */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b != 0);
        return a % b;
    }
}

Contract ABI

[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"pIDxAddr","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newRate","type":"uint256"}],"name":"setPriceGainRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_nameString","type":"string"},{"name":"_affCode","type":"uint256"}],"name":"registerPlayer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"},{"name":"_price","type":"uint256"}],"name":"setItemPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"artItemMap","outputs":[{"name":"id","type":"uint256"},{"name":"price","type":"uint256"},{"name":"lastTransPrice","type":"uint256"},{"name":"owner","type":"address"},{"name":"isExist","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"getItemPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"affPercentCut","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"isItemSell","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"deleteItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"updateSellItemPriceDaily","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"},{"name":"_price","type":"uint256"}],"name":"addNewItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"sellItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"isItemExist","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newCOO","type":"address"}],"name":"setCoo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"priceGainPercentPerYear","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isPaused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"itemIds","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"playerMap","outputs":[{"name":"id","type":"uint256"},{"name":"addr","type":"address"},{"name":"name","type":"bytes32"},{"name":"laffId","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_buyer","type":"address"},{"name":"_tokenId","type":"uint256"},{"name":"_affCode","type":"uint256"}],"name":"buyItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"itemId","type":"uint256"},{"indexed":false,"name":"price","type":"uint256"},{"indexed":false,"name":"timeStamp","type":"uint256"}],"name":"onTransferItem","type":"event"}]

Contract Creation Code

60806040526001805460a060020a60ff0219169055600860025560038055600060045534801561002e57600080fd5b506000805433600160a060020a031991821617825560048054600190810180835580855260086020908152604080872092835591909201805473e27c188521248a49adfc61090d3c8ab7c3754e0a9516851790558254855284207f6d617474000000000000000000000000000000000000000000000000000000006002909101559054918352600790527f7c0b195f6f756050ac7a0eae36a5cdda8a7adcade07f3a0e39f6c546c2815cd4556120be9081906100ea90396000f30060806040526004361061013d5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663045dd93b811461014257806306fdde0314610175578063146c6092146101ff5780633f4ba83a146102195780634209a1ef1461022e5780634229c35e146102895780634c282c84146102a45780634c4df870146102f2578063544363031461030a5780635c975abb1461031f5780635dfa357214610348578063654fc8331461036057806379308bfc146103785780638456cb591461038d578063868171a8146103a257806391b6be9a146103bd57806395782d9b146103d557806395d89b41146101755780639986a0c6146103ed578063a73227e51461040e578063b187bd2614610423578063b3dc00fe14610438578063c74714d514610450578063f6b45c4614610496575b600080fd5b34801561014e57600080fd5b50610163600160a060020a03600435166104bd565b60408051918252519081900360200190f35b34801561018157600080fd5b5061018a6104cf565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c45781810151838201526020016101ac565b50505050905090810190601f1680156101f15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020b57600080fd5b50610217600435610506565b005b34801561022557600080fd5b50610217610572565b34801561023a57600080fd5b506040805160206004803580820135601f8101849004840285018401909552848452610217943694929360249392840191908190840183828082843750949750509335945061060c9350505050565b34801561029557600080fd5b506102176004356024356106b3565b3480156102b057600080fd5b506102bc600435610759565b60408051958652602086019490945284840192909252600160a060020a0316606084015215156080830152519081900360a00190f35b3480156102fe57600080fd5b50610163600435610795565b34801561031657600080fd5b5061016361080e565b34801561032b57600080fd5b50610334610814565b604080519115158252519081900360200190f35b34801561035457600080fd5b50610334600435610824565b34801561036c57600080fd5b506102176004356108ab565b34801561038457600080fd5b50610217610a3f565b34801561039957600080fd5b50610217610b8d565b3480156103ae57600080fd5b50610217600435602435610c31565b3480156103c957600080fd5b50610217600435610d9f565b3480156103e157600080fd5b5061033460043561119b565b3480156103f957600080fd5b50610217600160a060020a03600435166111ba565b34801561041a57600080fd5b50610163611260565b34801561042f57600080fd5b50610334611266565b34801561044457600080fd5b50610163600435611277565b34801561045c57600080fd5b50610468600435611296565b60408051948552600160a060020a039093166020850152838301919091526060830152519081900360800190f35b3480156104a257600080fd5b50610217600160a060020a03600435166024356044356112c7565b60076020526000908152604090205481565b60408051808201909152600881527f617274436861696e000000000000000000000000000000000000000000000000602082015281565b600154600160a060020a03163314806105295750600054600160a060020a031633145b151561056d576040805160e560020a62461bcd0281526020600482015260196024820152600080516020612053833981519152604482015290519081900360640190fd5b600255565b600054600160a060020a031633146105d4576040805160e560020a62461bcd02815260206004820152601560248201527f6d73672073656e646572206973206e6f742063656f0000000000000000000000604482015290519081900360640190fd5b60015460a060020a900460ff1615156105ec57600080fd5b6001805474ff000000000000000000000000000000000000000019169055565b600154600090819060a060020a900460ff161561062857600080fd5b33803b8015610681576040805160e560020a62461bcd02815260206004820152601160248201527f736f7272792068756d616e73206f6e6c79000000000000000000000000000000604482015290519081900360640190fd5b61068b33866116a1565b935061069686611753565b600094855260086020526040909420600201939093555050505050565b600154600160a060020a03163314806106d65750600054600160a060020a031633145b151561071a576040805160e560020a62461bcd0281526020600482015260196024820152600080516020612053833981519152604482015290519081900360640190fd5b60008281526005602052604090206003015460a060020a900460ff16151560011461074457600080fd5b60009182526005602052604090912060010155565b600560205260009081526040902080546001820154600283015460039093015491929091600160a060020a0381169060a060020a900460ff1685565b60008181526005602052604081206003015460a060020a900460ff1615156001146107f8576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020612073833981519152604482015290519081900360640190fd5b5060009081526005602052604090206001015490565b60035481565b60015460a060020a900460ff1681565b60008181526005602052604081206003015460a060020a900460ff161515600114610887576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020612073833981519152604482015290519081900360640190fd5b50600081815260056020526040902060030154600160a060020a0316301415919050565b600154600090600160a060020a03163314806108d15750600054600160a060020a031633145b1515610915576040805160e560020a62461bcd0281526020600482015260196024820152600080516020612053833981519152604482015290519081900360640190fd5b60008281526005602052604090206003015460a060020a900460ff161515610975576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020612073833981519152604482015290519081900360640190fd5b5060005b6006548110156109e9578160068281548110151561099357fe5b906000526020600020015414156109e1576006805460001981019081106109b657fe5b90600052602060002001546006828154811015156109d057fe5b6000918252602090912001556109e9565b600101610979565b60068054906109fc906000198301611fd0565b50506000908152600560205260408120818155600181018290556002810191909155600301805474ffffffffffffffffffffffffffffffffffffffffff19169055565b6001546000908190600160a060020a0316331480610a675750600054600160a060020a031633145b1515610aab576040805160e560020a62461bcd0281526020600482015260196024820152600080516020612053833981519152604482015290519081900360640190fd5b600091505b600654821015610b8957610adc600683815481101515610acc57fe5b9060005260206000200154610824565b15610b7e5760056000600684815481101515610af457fe5b90600052602060002001548152602001908152602001600020600101549050610b4a81610b3e61016d610b3260025486611f6690919063ffffffff16565b9063ffffffff611f9b16565b9063ffffffff611fbe16565b60056000600685815481101515610b5d57fe5b90600052602060002001548152602001908152602001600020600101819055505b600190910190610ab0565b5050565b600154600160a060020a0316331480610bb05750600054600160a060020a031633145b1515610bf4576040805160e560020a62461bcd0281526020600482015260196024820152600080516020612053833981519152604482015290519081900360640190fd5b60015460a060020a900460ff1615610c0b57600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a179055565b610c39611ff9565b600154600160a060020a0316331480610c5c5750600054600160a060020a031633145b1515610ca0576040805160e560020a62461bcd0281526020600482015260196024820152600080516020612053833981519152604482015290519081900360640190fd5b60008381526005602052604090206003015460a060020a900460ff1615610cc657600080fd5b506040805160a081018252838152602080820193845260008284018181523060608501908152600160808601818152600680548084019091557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f018a9055988452600590945294909120925183559351908201559151600283015551600390910180549251151560a060020a0274ff000000000000000000000000000000000000000019600160a060020a039390931673ffffffffffffffffffffffffffffffffffffffff199094169390931791909116919091179055565b6000806000806000600160149054906101000a900460ff16151515610dc357600080fd5b33803b8015610e1c576040805160e560020a62461bcd02815260206004820152601160248201527f736f7272792068756d616e73206f6e6c79000000000000000000000000000000604482015290519081900360640190fd5b60008881526005602052604090206003015460a060020a900460ff161515600114610e7f576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020612073833981519152604482015290519081900360640190fd5b600088815260056020526040902060030154600160a060020a03163314610ef0576040805160e560020a62461bcd02815260206004820152601860248201527f706c61796572206e6f74206f776e2074686973206974656d0000000000000000604482015290519081900360640190fd5b60008881526005602090815260408083206001015481517fa9059cbb0000000000000000000000000000000000000000000000000000000081523360048201526024810191909152905173ceb158068523a1bcb4411a38d5660e1267ec7ac09363a9059cbb93604480850194919392918390030190829087803b158015610f7657600080fd5b505af1158015610f8a573d6000803e3d6000fd5b505050506040513d6020811015610fa057600080fd5b50519650861515610ffb576040805160e560020a62461bcd02815260206004820152601360248201527f796962207472616e73666572206661696c656400000000000000000000000000604482015290519081900360640190fd5b600088815260056020908152604080832060038101805473ffffffffffffffffffffffffffffffffffffffff19163017905560018101546002909101553383526007909152812054965093508392505b6000868152600860205260409020600401548310156110ac57600086815260086020526040902060040180548991908590811061108457fe5b906000526020600020015414156110a157829450600193506110ac565b60019092019161104b565b831561110e576000868152600860205260409020600401805460001981019081106110d357fe5b9060005260206000200154600860008881526020019081526020016000206004018681548110151561110157fe5b6000918252602090912001555b6000868152600860205260409020600401805490611130906000198301611fd0565b5060008881526005602090815260409182902060010154825133815230928101929092528183018b9052606082015242608082015290517f153e69120acfee9fc2cab2a0f8e4fdb995f7ad80163b772dc167e07fbf3d57ee9181900360a00190a15050505050505050565b60009081526005602052604090206003015460a060020a900460ff1690565b600054600160a060020a0316331461121c576040805160e560020a62461bcd02815260206004820152601560248201527f6d73672073656e646572206973206e6f742063656f0000000000000000000000604482015290519081900360640190fd5b600160a060020a038116151561123157600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60025481565b60015460a060020a900460ff165b90565b600680548290811061128557fe5b600091825260209091200154905081565b60086020526000908152604090208054600182015460028301546003909301549192600160a060020a039091169184565b60015460009081908190819060a060020a900460ff16156112e757600080fd5b6112f187866116a1565b60008781526005602052604090206003015490945060a060020a900460ff161515600114611357576040805160e560020a62461bcd02815260206004820152600e6024820152600080516020612073833981519152604482015290519081900360640190fd5b61136086610824565b156113b5576040805160e560020a62461bcd02815260206004820152601160248201527f6974656d20616c726561647920736f6c64000000000000000000000000000000604482015290519081900360640190fd5b60008681526005602090815260408083206001015481517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526044810191909152905173ceb158068523a1bcb4411a38d5660e1267ec7ac0936323b872dd93606480850194919392918390030190829087803b15801561144157600080fd5b505af1158015611455573d6000803e3d6000fd5b505050506040513d602081101561146b57600080fd5b505192508215156114c6576040805160e560020a62461bcd02815260206004820152601860248201527f796962207472616e736665722066726f6d206661696c65640000000000000000604482015290519081900360640190fd5b60008681526005602090815260408083206003808201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038e161790556001808301546002909301929092558885526008845291842060048101805492830181558552928420018990559186905201541561162f5760035460008781526005602052604090206001015461156591606491610b329163ffffffff611f6616565b60008581526008602090815260408083206003015483528083206001015481517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039091166004820181905260248201869052915194965090945073ceb158068523a1bcb4411a38d5660e1267ec7ac09363a9059cbb93604480840194938390030190829087803b15801561160257600080fd5b505af1158015611616573d6000803e3d6000fd5b505050506040513d602081101561162c57600080fd5b50505b600086815260056020908152604091829020600101548251308152600160a060020a038b1692810192909252818301899052606082015242608082015290517f153e69120acfee9fc2cab2a0f8e4fdb995f7ad80163b772dc167e07fbf3d57ee9181900360a00190a150505050505050565b600160a060020a0382166000908152600760205260408120548190151561171b5760048054600190810191829055600160a060020a0386166000818152600760209081526040808320869055858352600890915290209283559101805473ffffffffffffffffffffffffffffffffffffffff191690911790555b5050600160a060020a0382166000908152600760209081526040808320548084526008909252909120600301829055805b5092915050565b805160009082908280806020841180159061176e5750600084115b15156117ea576040805160e560020a62461bcd02815260206004820152602a60248201527f737472696e67206d757374206265206265747765656e203120616e642033322060448201527f6368617261637465727300000000000000000000000000000000000000000000606482015290519081900360840190fd5b8460008151811015156117f957fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a02141580156118605750846001850381518110151561183857fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a0214155b15156118dc576040805160e560020a62461bcd02815260206004820152602560248201527f737472696e672063616e6e6f74207374617274206f7220656e6420776974682060448201527f7370616365000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8460008151811015156118eb57fe5b90602001015160f860020a900460f860020a02600160f860020a031916603060f860020a021415611a2e5784600181518110151561192557fe5b90602001015160f860020a900460f860020a02600160f860020a031916607860f860020a02141515156119a2576040805160e560020a62461bcd02815260206004820152601b60248201527f737472696e672063616e6e6f7420737461727420776974682030780000000000604482015290519081900360640190fd5b8460018151811015156119b157fe5b90602001015160f860020a900460f860020a02600160f860020a031916605860f860020a0214151515611a2e576040805160e560020a62461bcd02815260206004820152601b60248201527f737472696e672063616e6e6f7420737461727420776974682030580000000000604482015290519081900360640190fd5b600091505b83821015611efe5784517f400000000000000000000000000000000000000000000000000000000000000090869084908110611a6b57fe5b90602001015160f860020a900460f860020a02600160f860020a031916118015611adf575084517f5b0000000000000000000000000000000000000000000000000000000000000090869084908110611ac057fe5b90602001015160f860020a900460f860020a02600160f860020a031916105b15611b4c578482815181101515611af257fe5b90602001015160f860020a900460f860020a0260f860020a900460200160f860020a028583815181101515611b2357fe5b906020010190600160f860020a031916908160001a905350821515611b4757600192505b611ef3565b8482815181101515611b5a57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a021480611c2a575084517f600000000000000000000000000000000000000000000000000000000000000090869084908110611bb657fe5b90602001015160f860020a900460f860020a02600160f860020a031916118015611c2a575084517f7b0000000000000000000000000000000000000000000000000000000000000090869084908110611c0b57fe5b90602001015160f860020a900460f860020a02600160f860020a031916105b80611cd4575084517f2f0000000000000000000000000000000000000000000000000000000000000090869084908110611c6057fe5b90602001015160f860020a900460f860020a02600160f860020a031916118015611cd4575084517f3a0000000000000000000000000000000000000000000000000000000000000090869084908110611cb557fe5b90602001015160f860020a900460f860020a02600160f860020a031916105b1515611d50576040805160e560020a62461bcd02815260206004820152602260248201527f737472696e6720636f6e7461696e7320696e76616c696420636861726163746560448201527f7273000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8482815181101515611d5e57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a021415611e3d578482600101815181101515611d9a57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a0214151515611e3d576040805160e560020a62461bcd02815260206004820152602860248201527f737472696e672063616e6e6f7420636f6e7461696e20636f6e7365637574697660448201527f6520737061636573000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b82158015611ee9575084517f300000000000000000000000000000000000000000000000000000000000000090869084908110611e7657fe5b90602001015160f860020a900460f860020a02600160f860020a0319161080611ee9575084517f390000000000000000000000000000000000000000000000000000000000000090869084908110611eca57fe5b90602001015160f860020a900460f860020a02600160f860020a031916115b15611ef357600192505b600190910190611a33565b600183151514611f58576040805160e560020a62461bcd02815260206004820152601d60248201527f737472696e672063616e6e6f74206265206f6e6c79206e756d62657273000000604482015290519081900360640190fd5b505050506020015192915050565b600080831515611f79576000915061174c565b50828202828482811515611f8957fe5b0414611f9457600080fd5b9392505050565b600080808311611faa57600080fd5b8284811515611fb557fe5b04949350505050565b600082820183811015611f9457600080fd5b815481835581811115611ff457600083815260209020611ff4918101908301612034565b505050565b60a0604051908101604052806000815260200160008152602001600081526020016000600160a060020a031681526020016000151581525090565b61127491905b8082111561204e576000815560010161203a565b509056006d73672073656e646572206973206e6f742063206c6576656c000000000000006974656d206e6f74206578697374000000000000000000000000000000000000a165627a7a723058203432f6bbfa474f0b6f1df532618f394968bb2674478ecb7c1f9e7fe67a3210170029

Swarm Source

bzzr://3432f6bbfa474f0b6f1df532618f394968bb2674478ecb7c1f9e7fe67a321017
Block Age Transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward