Sponsored:   Kirik Meta Protocol - New Generation of Blockchain - Join Pre-Sale Aug 15-17
 Latest 25 txns from a total Of 9634 transactions

TxHash Age From To Value [TxFee]
0xfa49f284360a1049d68f1ed25f1525f943a9a00be09a0b81f955150059f0ac462 days 7 hrs ago0x45f0bb2e663cdf84c21ab041d9b8746b9a5328ed  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.001597592
0x15efc55dfa599bf6d1e012dbb94ccea2f0b652952b923a4824cbab210b2fb20d2 days 7 hrs ago0x45f0bb2e663cdf84c21ab041d9b8746b9a5328ed  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef3.94427 Ether0.001456422
0x4560b31e29790a875f1afc2f4c382a930b619e0549cc6773c51edd133b31502f6 days 48 mins ago0x4246afa249ba48913bc810bc88d11d15092e8229  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef5.11 Ether0.00397602
0x5f20b7041536a5522a11e21a5e6013e25f06c06f20c4b6d42d858f0f509396616 days 52 mins ago0x4246afa249ba48913bc810bc88d11d15092e8229  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef3.6 Ether0.00397206
0xe7ce1805c795a1760f5ba442058bdb31d5a871a4682b15c718a6a0fc06908ebf8 days 11 hrs ago0x54d6fca0ca37382b01304e6716420538604b447b  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000188208
0x0425554eb774b3b7e36ffc71aae1c9560f19545c5c2101cacd37c573240301b69 days 16 hrs ago0x238361f646681118c3dc9df3197fd82d3324856e  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000096156
0xa686f17e53146683d415a7737e62ad6463199596454e5b89cfd2043dcbd97bdc13 days 11 hrs ago0xe729933ab6b2394129f0bd568eddab562cf6d25f  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000047052
0x740b2887d97fb648f34d9e9c71e73f82ea539e6d986faf3e4b65cd00c745d2f614 days 14 hrs ago0x54d6fca0ca37382b01304e6716420538604b447b  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000063976
0xb9fed75a180302cd18a2225b3c96a1ecdcafb9b67cb900012cbdb3e1c19fbcbb14 days 14 hrs ago0x54d6fca0ca37382b01304e6716420538604b447b  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000093976
0xfd9c42ae4a4dec4b0b72fa48607bbfaec26ae6904f75873efe97dfff229316a114 days 14 hrs ago0x54d6fca0ca37382b01304e6716420538604b447b  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000093976
0x9feb953065114711cd3e8a267d3715d0ee4f8e97f9315adda87373a0373952a218 days 18 hrs ago0x91276fd2525976a1d0383636b31b274f38f90871  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000064104
0x7a44f5fdbf570e15d96873ef3034f1d1423a8ad33c328a151d478b0908aa20dd20 days 17 hrs ago0x54d6fca0ca37382b01304e6716420538604b447b  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000093976
0x50786c721d81f2613ce94871ed17d60c763ab09221bf1b7a621fe043013d426620 days 22 hrs ago0x7cd84443027d2e19473c3657f167ada34417654f  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000376416
0x0a031ed76d044564050edcff832af5d4b8ebff4b94e0dd6fb9160d67440bdf9c21 days 16 hrs ago0x91276fd2525976a1d0383636b31b274f38f90871  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.00016026
0x49653e61eaeb8802b1e6cbb0da793edc8c45ffd9c5f94c6a69508c41edf007c721 days 20 hrs ago0x1812aef4748f3026c1eb5a52cd3f3bc44d1584d8  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef4.36466 Ether0.00039759
0xc66e2adb339b5fcac8e0945dc1a24c1d1fa52e7c088588b2fda856fd0bba550825 days 5 hrs ago0x91276fd2525976a1d0383636b31b274f38f90871  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.00023526
0x14ad97c6670bb67df34046c6f432395a8e20e2f4aade5defc60c5d27801d248a26 days 43 mins ago0x91276fd2525976a1d0383636b31b274f38f90871  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef4.75752 Ether0.000198795
0x3b9a426fabcc2d823e7926d447262769e63ac3c787643bc8497549197c0b89d526 days 21 hrs ago0xb80ecd45752600e36984975d3a373e98429f1322  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000095964
0x2ce13b84dd365ca9268e3ca1679a0a5cf074e07789c5b409402f960baffa65ae26 days 21 hrs ago0xb80ecd45752600e36984975d3a373e98429f1322  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000127952
0x361a7720d7f425b94c6451e3eb6292bc200c18ce79e85a1397b6d3dc6926f05a26 days 21 hrs ago0xb80ecd45752600e36984975d3a373e98429f1322  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000140964
0x0d0476bfdbda9a0f16e9625ce647f8d07a5e1eaa0b2a42f830853d43aab6860b27 days 11 hrs ago0x238361f646681118c3dc9df3197fd82d3324856e  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000188208
0xd6aac52e821bc951a94f994d83be91e6154b8b98bd3b084018196c1ad281158027 days 11 hrs ago0x238361f646681118c3dc9df3197fd82d3324856e  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000188208
0xde5a00b9fad5254f84a231bc9d136ee6d29df7cae0d3188d648a5a31f5166d5e27 days 22 hrs ago0xfc1f7923bcbfd84637b8e4ef4376abbc564e59a6  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.0005508
0xded79958dcd3c2e39eb55658bb5ec10bad59e2346330bd90537bb182d5239bbc27 days 23 hrs ago0x7cd84443027d2e19473c3657f167ada34417654f  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000188608
0x1ca1b9216d83892f2e11330098f1be14a501cf08d331a3b256aaa22bbdb5a00727 days 23 hrs ago0x7cd84443027d2e19473c3657f167ada34417654f  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000094304
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click here to View More View All
ParentTxHash Block Age From To Value
0x15efc55dfa599bf6d1e012dbb94ccea2f0b652952b923a4824cbab210b2fb20d61379262 days 7 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x45f0bb2e663cdf84c21ab041d9b8746b9a5328ed0.000005673502004364 Ether
0x15efc55dfa599bf6d1e012dbb94ccea2f0b652952b923a4824cbab210b2fb20d61379262 days 7 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xcef2abb0d96240f59ebb7f21711a06edb85f19903.825936396703055767 Ether
0x4560b31e29790a875f1afc2f4c382a930b619e0549cc6773c51edd133b31502f61158716 days 48 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x4246afa249ba48913bc810bc88d11d15092e82290.003766940438121273 Ether
0x4560b31e29790a875f1afc2f4c382a930b619e0549cc6773c51edd133b31502f61158716 days 48 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x8525c12618eae3d8717c0d6123e85efe41d968cc5.004108398370641153 Ether
0x5f20b7041536a5522a11e21a5e6013e25f06c06f20c4b6d42d858f0f5093966161158536 days 52 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x4246afa249ba48913bc810bc88d11d15092e82290.090280746773488425 Ether
0x5f20b7041536a5522a11e21a5e6013e25f06c06f20c4b6d42d858f0f5093966161158536 days 52 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xf8835309fb87154b65c7c9e8071a0922cac63dac3.404427675629716228 Ether
0x49653e61eaeb8802b1e6cbb0da793edc8c45ffd9c5f94c6a69508c41edf007c7602223821 days 20 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x1812aef4748f3026c1eb5a52cd3f3bc44d1584d80.000009133808056117 Ether
0x49653e61eaeb8802b1e6cbb0da793edc8c45ffd9c5f94c6a69508c41edf007c7602223821 days 20 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x8bb4f7f71a4a86e50c21f0a67c11dd05bb85a6bb4.233711340206185567 Ether
0x14ad97c6670bb67df34046c6f432395a8e20e2f4aade5defc60c5d27801d248a599752826 days 43 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x91276fd2525976a1d0383636b31b274f38f908710.000005296904479491 Ether
0x14ad97c6670bb67df34046c6f432395a8e20e2f4aade5defc60c5d27801d248a599752826 days 43 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xe9bdf368bbf9626a4da1fd32d2bbb95c700bca4b4.614789262002654894 Ether
0x3b1605df832ef7b154525e0d4b6bee20a4d02d41e39a9d4de11fe636009e5830586259149 days 1 hr ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x06c7a28eb8c2a6a79bdb19493873d4a8265ca8d60.000014762636782289 Ether
0x3b1605df832ef7b154525e0d4b6bee20a4d02d41e39a9d4de11fe636009e5830586259149 days 1 hr ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xd10ac604b85d40650df8252ad01c21541fdb11eb2.07580508024232118 Ether
0x8be70bf9a15e33f6856ad31a59fc2040fa694d7e94ca6555699e392f559cb08e584360952 days 8 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xac6b3b665e2632372fb73fe0536ad49b9cd2b7570.000013903709214583 Ether
0x8be70bf9a15e33f6856ad31a59fc2040fa694d7e94ca6555699e392f559cb08e584360952 days 8 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xf9caa50b78eeb8bb46caf538d31af9ef2fb155bd2.416237113402061855 Ether
0x082556383016d4ad76c49a31544d21fd630b9729f2aac7c66410e7505ff208b85513518110 days 4 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x46740a9ae3b3bdfc4a9381023bf8a74ecbceedf20.000008239690701944 Ether
0x082556383016d4ad76c49a31544d21fd630b9729f2aac7c66410e7505ff208b85513518110 days 4 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xb7a87ef2a7647f231e04567a4b7cba22b53fcd664.233372707500019115 Ether
0x1edaefb9c1bba181cbb4e402a6d275db7933af560fb6677699b5b06223486d1d5399751129 days 12 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x14a12356b5b106e9a7f706b1a01af4fd6cf93f860.000014238900460517 Ether
0x1edaefb9c1bba181cbb4e402a6d275db7933af560fb6677699b5b06223486d1d5399751129 days 12 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2dd69f5b02e99efef9101fcae8bd1e02375b265b2.283385588266553299 Ether
0x27897e909a2999b1da2885c3c11aa914abc981d5f2d1b9f12ab6f93ccf8e791a5350693137 days 15 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xcef2abb0d96240f59ebb7f21711a06edb85f19900.000008891706789942 Ether
0x27897e909a2999b1da2885c3c11aa914abc981d5f2d1b9f12ab6f93ccf8e791a5350693137 days 15 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x7404190c4fd2fcc17286064e900c998fb864d9e23.171930175044413757 Ether
0xf13bf1e14e0b54aab034a9a9e65f2d783928ba62cfb68c810bb2f540658c3b315276654150 days 1 hr ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xfc1f7923bcbfd84637b8e4ef4376abbc564e59a6159.744098378493302103 Ether
0xf70926ef1e38141b1a8c47c45519f637c23c3937e3e27b6cbe472e27f2ed54765275402150 days 6 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xa89b146ec9d3899e94611f1e61e3217cf2e956ef0.000014762636782289 Ether
0xf70926ef1e38141b1a8c47c45519f637c23c3937e3e27b6cbe472e27f2ed54765275402150 days 6 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x8374e6ed6c867491ffc1ffef7a0f6f59a00e85b12.07580508024232118 Ether
0x7220107d98fa08a62e22925194ce5968c6faae3aa103f9024280c2fa06f4b1175222373159 days 6 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x1ca05331643e3a076fe022eba795c3d26aa41c410.070370438455163786 Ether
0x7220107d98fa08a62e22925194ce5968c6faae3aa103f9024280c2fa06f4b1175222373159 days 6 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2dc111c84731bf455e3cf0af59d13256439eb1282.453740674698491128 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact match)
Contract Name: ItemToken
Compiler Version: v0.4.20-nightly.2018.1.29+commit.a668b9de
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.13;

library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws 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 Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract ItemToken {
  using SafeMath for uint256;

  event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
  event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);
  event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
  event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);

  address private owner;
  mapping (address => bool) private admins;
  IItemRegistry private itemRegistry;
  bool private erc721Enabled = false;

  uint256 private increaseLimit1 = 0.02 ether;
  uint256 private increaseLimit2 = 0.5 ether;
  uint256 private increaseLimit3 = 2.0 ether;
  uint256 private increaseLimit4 = 5.0 ether;

  uint256[] private listedItems;
  mapping (uint256 => address) private ownerOfItem;
  mapping (uint256 => uint256) private startingPriceOfItem;
  mapping (uint256 => uint256) private priceOfItem;
  mapping (uint256 => address) private approvedOfItem;

  function ItemToken () public {
    owner = msg.sender;
    admins[owner] = true;
  }

  /* Modifiers */
  modifier onlyOwner() {
    require(owner == msg.sender);
    _;
  }

  modifier onlyAdmins() {
    require(admins[msg.sender]);
    _;
  }

  modifier onlyERC721() {
    require(erc721Enabled);
    _;
  }

  /* Owner */
  function setOwner (address _owner) onlyOwner() public {
    owner = _owner;
  }

  function setItemRegistry (address _itemRegistry) onlyOwner() public {
    itemRegistry = IItemRegistry(_itemRegistry);
  }

  function addAdmin (address _admin) onlyOwner() public {
    admins[_admin] = true;
  }

  function removeAdmin (address _admin) onlyOwner() public {
    delete admins[_admin];
  }

  // Unlocks ERC721 behaviour, allowing for trading on third party platforms.
  function enableERC721 () onlyOwner() public {
    erc721Enabled = true;
  }

  /* Withdraw */
  /*
    NOTICE: These functions withdraw the developer's cut which is left
    in the contract by `buy`. User funds are immediately sent to the old
    owner in `buy`, no user funds are left in the contract.
  */
  function withdrawAll () onlyOwner() public {
    owner.transfer(this.balance);
  }

  function withdrawAmount (uint256 _amount) onlyOwner() public {
    owner.transfer(_amount);
  }

  /* Listing */
  function populateFromItemRegistry (uint256[] _itemIds) onlyOwner() public {
    for (uint256 i = 0; i < _itemIds.length; i++) {
      if (priceOfItem[_itemIds[i]] > 0 || itemRegistry.priceOf(_itemIds[i]) == 0) {
        continue;
      }

      listItemFromRegistry(_itemIds[i]);
    }
  }

  function listItemFromRegistry (uint256 _itemId) onlyOwner() public {
    require(itemRegistry != address(0));
    require(itemRegistry.ownerOf(_itemId) != address(0));
    require(itemRegistry.priceOf(_itemId) > 0);

    uint256 price = itemRegistry.priceOf(_itemId);
    address itemOwner = itemRegistry.ownerOf(_itemId);
    listItem(_itemId, price, itemOwner);
  }

  function listMultipleItems (uint256[] _itemIds, uint256 _price, address _owner) onlyAdmins() external {
    for (uint256 i = 0; i < _itemIds.length; i++) {
      listItem(_itemIds[i], _price, _owner);
    }
  }

  function listItem (uint256 _itemId, uint256 _price, address _owner) onlyAdmins() public {
    require(_price > 0);
    require(priceOfItem[_itemId] == 0);
    require(ownerOfItem[_itemId] == address(0));

    ownerOfItem[_itemId] = _owner;
    priceOfItem[_itemId] = _price;
    startingPriceOfItem[_itemId] = _price;
    listedItems.push(_itemId);
  }

  /* Buying */
  function calculateNextPrice (uint256 _price) public view returns (uint256 _nextPrice) {
    if (_price < increaseLimit1) {
      return _price.mul(200).div(95);
    } else if (_price < increaseLimit2) {
      return _price.mul(135).div(96);
    } else if (_price < increaseLimit3) {
      return _price.mul(125).div(97);
    } else if (_price < increaseLimit4) {
      return _price.mul(117).div(97);
    } else {
      return _price.mul(115).div(98);
    }
  }

  function calculateDevCut (uint256 _price) public view returns (uint256 _devCut) {
    if (_price < increaseLimit1) {
      return _price.mul(5).div(100); // 5%
    } else if (_price < increaseLimit2) {
      return _price.mul(4).div(100); // 4%
    } else if (_price < increaseLimit3) {
      return _price.mul(3).div(100); // 3%
    } else if (_price < increaseLimit4) {
      return _price.mul(3).div(100); // 3%
    } else {
      return _price.mul(2).div(100); // 2%
    }
  }

  /*
     Buy a country directly from the contract for the calculated price
     which ensures that the owner gets a profit.  All countries that
     have been listed can be bought by this method. User funds are sent
     directly to the previous owner and are never stored in the contract.
  */
  function buy (uint256 _itemId) payable public {
    require(priceOf(_itemId) > 0);
    require(ownerOf(_itemId) != address(0));
    require(msg.value >= priceOf(_itemId));
    require(ownerOf(_itemId) != msg.sender);
    require(!isContract(msg.sender));
    require(msg.sender != address(0));

    address oldOwner = ownerOf(_itemId);
    address newOwner = msg.sender;
    uint256 price = priceOf(_itemId);
    uint256 excess = msg.value.sub(price);

    _transfer(oldOwner, newOwner, _itemId);
    priceOfItem[_itemId] = nextPriceOf(_itemId);

    Bought(_itemId, newOwner, price);
    Sold(_itemId, oldOwner, price);

    // Devevloper's cut which is left in contract and accesed by
    // `withdrawAll` and `withdrawAmountTo` methods.
    uint256 devCut = calculateDevCut(price);

    // Transfer payment to old owner minus the developer's cut.
    oldOwner.transfer(price.sub(devCut));

    if (excess > 0) {
      newOwner.transfer(excess);
    }
  }

  /* ERC721 */
  function implementsERC721() public view returns (bool _implements) {
    return erc721Enabled;
  }

  function name() public pure returns (string _name) {
    return "CryptoCountries.io Countries";
  }

  function symbol() public pure returns (string _symbol) {
    return "CCC";
  }

  function totalSupply() public view returns (uint256 _totalSupply) {
    return listedItems.length;
  }

  function balanceOf (address _owner) public view returns (uint256 _balance) {
    uint256 counter = 0;

    for (uint256 i = 0; i < listedItems.length; i++) {
      if (ownerOf(listedItems[i]) == _owner) {
        counter++;
      }
    }

    return counter;
  }

  function ownerOf (uint256 _itemId) public view returns (address _owner) {
    return ownerOfItem[_itemId];
  }

  function tokensOf (address _owner) public view returns (uint256[] _tokenIds) {
    uint256[] memory items = new uint256[](balanceOf(_owner));

    uint256 itemCounter = 0;
    for (uint256 i = 0; i < listedItems.length; i++) {
      if (ownerOf(listedItems[i]) == _owner) {
        items[itemCounter] = listedItems[i];
        itemCounter += 1;
      }
    }

    return items;
  }

  function tokenExists (uint256 _itemId) public view returns (bool _exists) {
    return priceOf(_itemId) > 0;
  }

  function approvedFor(uint256 _itemId) public view returns (address _approved) {
    return approvedOfItem[_itemId];
  }

  function approve(address _to, uint256 _itemId) onlyERC721() public {
    require(msg.sender != _to);
    require(tokenExists(_itemId));
    require(ownerOf(_itemId) == msg.sender);

    if (_to == 0) {
      if (approvedOfItem[_itemId] != 0) {
        delete approvedOfItem[_itemId];
        Approval(msg.sender, 0, _itemId);
      }
    } else {
      approvedOfItem[_itemId] = _to;
      Approval(msg.sender, _to, _itemId);
    }
  }

  /* Transferring a country to another owner will entitle the new owner the profits from `buy` */
  function transfer(address _to, uint256 _itemId) onlyERC721() public {
    require(msg.sender == ownerOf(_itemId));
    _transfer(msg.sender, _to, _itemId);
  }

  function transferFrom(address _from, address _to, uint256 _itemId) onlyERC721() public {
    require(approvedFor(_itemId) == msg.sender);
    _transfer(_from, _to, _itemId);
  }

  function _transfer(address _from, address _to, uint256 _itemId) internal {
    require(tokenExists(_itemId));
    require(ownerOf(_itemId) == _from);
    require(_to != address(0));
    require(_to != address(this));

    ownerOfItem[_itemId] = _to;
    approvedOfItem[_itemId] = 0;

    Transfer(_from, _to, _itemId);
  }

  /* Read */
  function isAdmin (address _admin) public view returns (bool _isAdmin) {
    return admins[_admin];
  }

  function startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
    return startingPriceOfItem[_itemId];
  }

  function priceOf (uint256 _itemId) public view returns (uint256 _price) {
    return priceOfItem[_itemId];
  }

  function nextPriceOf (uint256 _itemId) public view returns (uint256 _nextPrice) {
    return calculateNextPrice(priceOf(_itemId));
  }

  function allOf (uint256 _itemId) external view returns (address _owner, uint256 _startingPrice, uint256 _price, uint256 _nextPrice) {
    return (ownerOf(_itemId), startingPriceOf(_itemId), priceOf(_itemId), nextPriceOf(_itemId));
  }

  function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items) {
    uint256[] memory items = new uint256[](_take);

    for (uint256 i = 0; i < _take; i++) {
      items[i] = listedItems[_from + i];
    }

    return items;
  }

  /* Util */
  function isContract(address addr) internal view returns (bool) {
    uint size;
    assembly { size := extcodesize(addr) } // solium-disable-line
    return size > 0;
  }
}

interface IItemRegistry {
  function itemsForSaleLimit (uint256 _from, uint256 _take) public view returns (uint256[] _items);
  function ownerOf (uint256 _itemId) public view returns (address _owner);
  function priceOf (uint256 _itemId) public view returns (uint256 _price);
}

    Contract ABI  
[{"constant":true,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"tokenExists","outputs":[{"name":"_exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"withdrawAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"_name","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_itemId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"implementsERC721","outputs":[{"name":"_implements","type":"bool"}],"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":"_admin","type":"address"}],"name":"removeAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"_totalSupply","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_itemRegistry","type":"address"}],"name":"setItemRegistry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_itemId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_admin","type":"address"}],"name":"isAdmin","outputs":[{"name":"_isAdmin","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"approvedFor","outputs":[{"name":"_approved","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"allOf","outputs":[{"name":"_owner","type":"address"},{"name":"_startingPrice","type":"uint256"},{"name":"_price","type":"uint256"},{"name":"_nextPrice","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"listItemFromRegistry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_itemId","type":"uint256"},{"name":"_price","type":"uint256"},{"name":"_owner","type":"address"}],"name":"listItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_from","type":"uint256"},{"name":"_take","type":"uint256"}],"name":"itemsForSaleLimit","outputs":[{"name":"_items","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"tokensOf","outputs":[{"name":"_tokenIds","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"nextPriceOf","outputs":[{"name":"_nextPrice","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"_owner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_price","type":"uint256"}],"name":"calculateDevCut","outputs":[{"name":"_devCut","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_admin","type":"address"}],"name":"addAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"_balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"enableERC721","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"withdrawAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_itemIds","type":"uint256[]"}],"name":"populateFromItemRegistry","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"_symbol","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_itemId","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"startingPriceOf","outputs":[{"name":"_startingPrice","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"priceOf","outputs":[{"name":"_price","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_itemIds","type":"uint256[]"},{"name":"_price","type":"uint256"},{"name":"_owner","type":"address"}],"name":"listMultipleItems","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"buy","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"_price","type":"uint256"}],"name":"calculateNextPrice","outputs":[{"name":"_nextPrice","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_itemId","type":"uint256"},{"indexed":true,"name":"_owner","type":"address"},{"indexed":false,"name":"_price","type":"uint256"}],"name":"Bought","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_itemId","type":"uint256"},{"indexed":true,"name":"_owner","type":"address"},{"indexed":false,"name":"_price","type":"uint256"}],"name":"Sold","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_approved","type":"address"},{"indexed":false,"name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60606040526002805460a060020a60ff021916905566470de4df8200006003556706f05b59d3b20000600455671bc16d674ec80000600555674563918244f40000600655341561004e57600080fd5b60008054600160a060020a03338116600160a060020a031990921691909117808355168152600160208190526040909120805460ff191690911790556116a1806100996000396000f30060606040526004361061017b5763ffffffff60e060020a600035041662923f9e81146101805780630562b9f7146101aa57806306fdde03146101c2578063095ea7b31461024c5780631051db341461026e57806313af4035146102815780631785f53c146102a057806318160ddd146102bf5780631fe8500e146102e457806323b872dd1461030357806324d7806c1461032b5780632a6dd48f1461034a5780632e4f43bf1461037c57806337525ff0146103cf578063442edd03146103e55780635435bac81461040a5780635a3f2672146104765780635ba9e48e146104955780636352211e146104ab57806365121205146104c157806370480275146104d757806370a08231146104f657806371dc761e14610515578063853828b6146105285780638f88aed01461053b57806395d89b411461058a578063a9059cbb1461059d578063af7520b9146105bf578063b9186d7d146105d5578063baddee6f146105eb578063d96a094a14610619578063e08503ec14610624575b600080fd5b341561018b57600080fd5b61019660043561063a565b604051901515815260200160405180910390f35b34156101b557600080fd5b6101c060043561064f565b005b34156101cd57600080fd5b6101d56106a0565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102115780820151838201526020016101f9565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561025757600080fd5b6101c0600160a060020a03600435166024356106e2565b341561027957600080fd5b61019661084e565b341561028c57600080fd5b6101c0600160a060020a036004351661085e565b34156102ab57600080fd5b6101c0600160a060020a036004351661089b565b34156102ca57600080fd5b6102d26108d7565b60405190815260200160405180910390f35b34156102ef57600080fd5b6101c0600160a060020a03600435166108dd565b341561030e57600080fd5b6101c0600160a060020a036004358116906024351660443561091a565b341561033657600080fd5b610196600160a060020a0360043516610968565b341561035557600080fd5b610360600435610986565b604051600160a060020a03909116815260200160405180910390f35b341561038757600080fd5b6103926004356109a1565b6040518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390f35b34156103da57600080fd5b6101c06004356109da565b34156103f057600080fd5b6101c0600435602435600160a060020a0360443516610bf1565b341561041557600080fd5b610423600435602435610cc4565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561046257808201518382015260200161044a565b505050509050019250505060405180910390f35b341561048157600080fd5b610423600160a060020a0360043516610d46565b34156104a057600080fd5b6102d2600435610e1a565b34156104b657600080fd5b610360600435610e33565b34156104cc57600080fd5b6102d2600435610e4e565b34156104e257600080fd5b6101c0600160a060020a0360043516610ef9565b341561050157600080fd5b6102d2600160a060020a0360043516610f3b565b341561052057600080fd5b6101c0610f8b565b341561053357600080fd5b6101c0610fcc565b341561054657600080fd5b6101c0600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061102295505050505050565b341561059557600080fd5b6101d5611130565b34156105a857600080fd5b6101c0600160a060020a0360043516602435611171565b34156105ca57600080fd5b6102d26004356111bc565b34156105e057600080fd5b6102d26004356111ce565b34156105f657600080fd5b6101c0602460048035828101929101359035600160a060020a03604435166111e0565b6101c060043561123f565b341561062f57600080fd5b6102d260043561143f565b600080610646836111ce565b1190505b919050565b60005433600160a060020a0390811691161461066a57600080fd5b600054600160a060020a031681156108fc0282604051600060405180830381858888f19350505050151561069d57600080fd5b50565b6106a8611626565b60408051908101604052601c81527f43727970746f436f756e74726965732e696f20436f756e747269657300000000602082015290505b90565b60025460a060020a900460ff1615156106fa57600080fd5b81600160a060020a031633600160a060020a03161415151561071b57600080fd5b6107248161063a565b151561072f57600080fd5b33600160a060020a031661074282610e33565b600160a060020a03161461075557600080fd5b600160a060020a03821615156107e3576000818152600b6020526040902054600160a060020a0316156107de576000818152600b60205260408082208054600160a060020a031916905533600160a060020a0316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35b61084a565b6000818152600b6020526040908190208054600160a060020a031916600160a060020a038581169182179092559133909116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35b5050565b60025460a060020a900460ff1690565b60005433600160a060020a0390811691161461087957600080fd5b60008054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a039081169116146108b657600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b60075490565b60005433600160a060020a039081169116146108f857600080fd5b60028054600160a060020a031916600160a060020a0392909216919091179055565b60025460a060020a900460ff16151561093257600080fd5b33600160a060020a031661094582610986565b600160a060020a03161461095857600080fd5b6109638383836114d7565b505050565b600160a060020a031660009081526001602052604090205460ff1690565b6000908152600b6020526040902054600160a060020a031690565b6000806000806109b085610e33565b6109b9866111bc565b6109c2876111ce565b6109cb88610e1a565b93509350935093509193509193565b60008054819033600160a060020a039081169116146109f857600080fd5b600254600160a060020a03161515610a0f57600080fd5b600254600090600160a060020a0316636352211e85836040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610a6257600080fd5b6102c65a03f11515610a7357600080fd5b50505060405180519050600160a060020a031614151515610a9357600080fd5b600254600090600160a060020a031663b9186d7d85836040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610ae657600080fd5b6102c65a03f11515610af757600080fd5b50505060405180519050111515610b0d57600080fd5b600254600160a060020a031663b9186d7d8460006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610b5e57600080fd5b6102c65a03f11515610b6f57600080fd5b5050506040518051600254909350600160a060020a03169050636352211e8460006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610bcd57600080fd5b6102c65a03f11515610bde57600080fd5b5050506040518051905090506109638383835b600160a060020a03331660009081526001602052604090205460ff161515610c1857600080fd5b60008211610c2557600080fd5b6000838152600a602052604090205415610c3e57600080fd5b600083815260086020526040902054600160a060020a031615610c6057600080fd5b60008381526008602090815260408083208054600160a060020a031916600160a060020a038616179055600a8252808320859055600990915290208290556007805460018101610cb08382611638565b506000918252602090912001929092555050565b610ccc611626565b610cd4611626565b600083604051805910610ce45750595b90808252806020026020018201604052509150600090505b83811015610d3e5760078054868301908110610d1457fe5b906000526020600020900154828281518110610d2c57fe5b60209081029091010152600101610cfc565b509392505050565b610d4e611626565b610d56611626565b600080610d6285610f3b565b604051805910610d6f5750595b9080825280602002602001820160405250925060009150600090505b600754811015610e115784600160a060020a0316610dc2600783815481101515610db157fe5b906000526020600020900154610e33565b600160a060020a03161415610e09576007805482908110610ddf57fe5b906000526020600020900154838381518110610df757fe5b60209081029091010152600191909101905b600101610d8b565b50909392505050565b6000610e2d610e28836111ce565b61143f565b92915050565b600090815260086020526040902054600160a060020a031690565b6000600354821015610e8357610e7c6064610e7084600563ffffffff6115c316565b9063ffffffff6115f516565b905061064a565b600454821015610ea357610e7c6064610e7084600463ffffffff6115c316565b600554821015610ec357610e7c6064610e7084600363ffffffff6115c316565b600654821015610ee357610e7c6064610e7084600363ffffffff6115c316565b610e7c6064610e7084600263ffffffff6115c316565b60005433600160a060020a03908116911614610f1457600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b600080805b600754811015610f845783600160a060020a0316610f66600783815481101515610db157fe5b600160a060020a03161415610f7c576001909101905b600101610f40565b5092915050565b60005433600160a060020a03908116911614610fa657600080fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a179055565b60005433600160a060020a03908116911614610fe757600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561102057600080fd5b565b6000805433600160a060020a0390811691161461103e57600080fd5b5060005b815181101561084a576000600a600084848151811061105d57fe5b9060200190602002015181526020019081526020016000205411806111005750600254600160a060020a031663b9186d7d83838151811061109a57fe5b9060200190602002015160006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156110e357600080fd5b6102c65a03f115156110f457600080fd5b50505060405180511590505b1561110a57611128565b61112882828151811061111957fe5b906020019060200201516109da565b600101611042565b611138611626565b60408051908101604052600381527f43434300000000000000000000000000000000000000000000000000000000006020820152905090565b60025460a060020a900460ff16151561118957600080fd5b61119281610e33565b600160a060020a031633600160a060020a03161415156111b157600080fd5b61084a3383836114d7565b60009081526009602052604090205490565b6000908152600a602052604090205490565b600160a060020a03331660009081526001602052604081205460ff16151561120757600080fd5b5060005b838110156112385761123085858381811061122257fe5b905060200201358484610bf1565b60010161120b565b5050505050565b600080600080600080611251876111ce565b1161125b57600080fd5b600061126687610e33565b600160a060020a0316141561127a57600080fd5b611283866111ce565b34101561128f57600080fd5b33600160a060020a03166112a287610e33565b600160a060020a031614156112b657600080fd5b6112bf3361160c565b156112c957600080fd5b33600160a060020a031615156112de57600080fd5b6112e786610e33565b94503393506112f5866111ce565b9250611307348463ffffffff61161416565b91506113148585886114d7565b61131d86610e1a565b600a60008881526020019081526020016000208190555083600160a060020a0316867fd2728f908c7e0feb83c6278798370fcb86b62f236c9dbf1a3f541096c21590408560405190815260200160405180910390a384600160a060020a0316867f66f5cd880edf48cdde6c966e5da0784fcc4c5e85572b8b3b62c4357798d447d78560405190815260200160405180910390a36113b983610e4e565b9050600160a060020a0385166108fc6113d8858463ffffffff61161416565b9081150290604051600060405180830381858888f1935050505015156113fd57600080fd5b600082111561143757600160a060020a03841682156108fc0283604051600060405180830381858888f19350505050151561143757600080fd5b505050505050565b600060035482101561146157610e7c605f610e708460c863ffffffff6115c316565b60045482101561148157610e7c6060610e7084608763ffffffff6115c316565b6005548210156114a157610e7c6061610e7084607d63ffffffff6115c316565b6006548210156114c157610e7c6061610e7084607563ffffffff6115c316565b610e7c6062610e7084607363ffffffff6115c316565b6114e08161063a565b15156114eb57600080fd5b82600160a060020a03166114fe82610e33565b600160a060020a03161461151157600080fd5b600160a060020a038216151561152657600080fd5b30600160a060020a031682600160a060020a03161415151561154757600080fd5b60008181526008602090815260408083208054600160a060020a03808816600160a060020a03199283168117909355600b909452938290208054909416909355908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a3505050565b6000808315156115d65760009150610f84565b508282028284828115156115e657fe5b04146115ee57fe5b9392505050565b600080828481151561160357fe5b04949350505050565b6000903b1190565b60008282111561162057fe5b50900390565b60206040519081016040526000815290565b815481835581811511610963576000838152602090206109639181019083016106df91905b80821115611671576000815560010161165d565b50905600a165627a7a72305820d02d851d837ae9e5e9201563ae875962723201215471d512c64af47770035e050029

   Swarm Source:
bzzr://d02d851d837ae9e5e9201563ae875962723201215471d512c64af47770035e05

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.