Sponsored Link:   WELL – WORKING HEALTHCARE U.S. PLATFORM - RAISED $3M IN PRE-ICO – JOIN NOW WITH 40% BONUS
Contract Overview
ETH Balance: 139.874297352089501443 Ether
ETH USD Value: $111,149.71 (@ $794.64/ETH)
No Of Transactions: 8902 txns
  Latest 25 txns from a total Of 8902 transactions View All

TxHash Age From To Value [TxFee]
0x4bfdb65ee69541aa8dc89278fff0b970b4f463b32b55abc71c3a0327b060c7878 hrs 32 mins ago0xf898f063d22a994ba6943d50a96c2dbc0bd9218c  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2 Ether0.000528336
0x16cce64e28a8fe2e8c9cc07ff97288290e0d2137846d5d6d9ad4669f1e661ee88 hrs 36 mins ago0xb03bec2357953ab8e1ef6eb36d6f10078bb039fa  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000225248
0xdd43e4b22291d6f6744d5547a98acddbf49b6e83067d3f93ce2cf717fad3efe315 hrs 19 mins ago0x44e6a8806f2ae1186b804ef9f1a24983c969cf2b  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.52964 Ether0.00013253
0xb0c060e25f7cce8bae56afaf2a313a400e79ebb636095b16e79e1d52264a4a2615 hrs 20 mins ago0x44e6a8806f2ae1186b804ef9f1a24983c969cf2b  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.2629 Ether0.000023486
0xf130738a0a4cbad6615b6c0c87b062a90cb68e3d0121c7b7e08d46f64c4478b816 hrs 16 mins ago0x44e6a8806f2ae1186b804ef9f1a24983c969cf2b  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.09722 Ether0.000023486
0x8e28c02c19bab9b7cffb9ce48278ac4a6ad076a0d007640be97f58c421afda3b17 hrs 17 mins ago0xf898f063d22a994ba6943d50a96c2dbc0bd9218c  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2 Ether0.0046972
0xf964c5285d7c0d5032859bc8ec14775966b765e4b2aa075ac8f44597ae89b8a917 hrs 18 mins ago0xd7669cb6bcec3a9e9cd2beb38074ecd267806c47  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2 Ether0.003569871999
0xfcdcd7b1a917631f0f377de6411ec2c8a6ca2d18d756e0abc5c33c5ec87a7c2a17 hrs 19 mins ago0xb7a87ef2a7647f231e04567a4b7cba22b53fcd66  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.435095353720617 Ether0.0099384247
0xd08cb29afeebeefd218d90eb9c4627ba3e38b19807505c057850d4a694b6518217 hrs 19 mins ago0x7404190c4fd2fcc17286064e900c998fb864d9e2  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.022725734849999 Ether0.00993908735
0xe21f62129f72dadd57976255e2371f1f8f8234027351891f5dc026a1b2def45d17 hrs 19 mins ago0xb03bec2357953ab8e1ef6eb36d6f10078bb039fa  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.000337872
0x7b2e06720204548588b7eb10aa9476a792a3a92ce7cc535a93960a926affa3c917 hrs 21 mins ago0xb4cfd39d292d852df0f0d63f3e34e670581d39f7  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.09722 Ether0.000070458
0xdae05877434f9858a06e96b5a0ffd903abf21d7caca671758d7f24b863ff474317 hrs 21 mins ago0x3c382d39bc6441695b3c0eaa9d418003bd0af408  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.2629 Ether0.000187888
0x0323155e865f472a19b29a1737946a273713ada2aae04c827dc9aa41966da24017 hrs 22 mins ago0x98f7ecd99404c1f06c7dba998f9c59c981d76434  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.668111856918775 Ether0.012607076668
0xc434981d2459981f79e1cb57d6ddcab2bf896f332651f3106b975f39eda7d5bf17 hrs 22 mins ago0xb7a87ef2a7647f231e04567a4b7cba22b53fcd66  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.119873320129063 Ether0.0035123313
0x40d6e3b314290a4b38ee929565cfc871be8b10397cd0a7796f5d6dcecf84488317 hrs 22 mins ago0xb7a87ef2a7647f231e04567a4b7cba22b53fcd66  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.285554187889526 Ether0.00351280102
0x78d530361397a9c08f4e7c5af61365ad22a8e01249149878da4b4ec44be05f4617 hrs 22 mins ago0xb7a87ef2a7647f231e04567a4b7cba22b53fcd66  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0.783148435640118 Ether0.00351327074
0x63c20e576452588a775476435583c49f5bb04d7bfde3ca3c014e71f27810ceed17 hrs 22 mins ago0x7404190c4fd2fcc17286064e900c998fb864d9e2  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.552287114644849 Ether0.0099092681
0x5e420df090aafdcb733dc700c296cf69067d7efbff51d516285c81a433aa1fbb17 hrs 22 mins ago0xb7a87ef2a7647f231e04567a4b7cba22b53fcd66  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0.442319747465827 Ether0.00351374046
0xcf8586ab3596e7a3c9768af0d5b9f5b3108b2425f174ee78e7a73efa4e62fafd17 hrs 22 mins ago0x7404190c4fd2fcc17286064e900c998fb864d9e2  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.650098842858153 Ether0.00351256616
0xbaef0936c3d87c28c008e4d2b11118908244dc36d7801a8d3d05eca3b6293a4d17 hrs 22 mins ago0xb7a87ef2a7647f231e04567a4b7cba22b53fcd66  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0.234880190158843 Ether0.00351421018
0xc7bd02a0bbac566bfc33903cf643eb892ff8f8406d005206d9bfa3e19b47bf8b17 hrs 22 mins ago0x7404190c4fd2fcc17286064e900c998fb864d9e2  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.002667875027472 Ether0.00351303588
0x34c9a78ea5aeb250e0b4a879ba177e4b9271ae2dbbfe981f2ee430bd57ee09f817 hrs 22 mins ago0xb7a87ef2a7647f231e04567a4b7cba22b53fcd66  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0.129983857639311 Ether0.0035146799
0xdc2ef7b211a508002fcbef019177fdf292c75b3a494e7389cec2094cc7c49b7c17 hrs 22 mins ago0xd7669cb6bcec3a9e9cd2beb38074ecd267806c47  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.9 Ether0.003569871999
0xc82dea30a83fe6eae0d0dd6b3bae53008b010e94c4c6e4c9b7ebc5e5d98b959417 hrs 22 mins ago0x3c382d39bc6441695b3c0eaa9d418003bd0af408  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.09722 Ether0.000093944
0xa1fdcc7f4c085eaf8c3399ae04dcaf6e60b6137a5f0ed5b1506ea9296f03b76a17 hrs 22 mins ago0x246fc43d887af9aa7efd3226ad1f3bb20efc900d  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.09722 Ether0.0011743
[ 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
0x4bfdb65ee69541aa8dc89278fff0b970b4f463b32b55abc71c3a0327b060c78751346338 hrs 32 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xb03bec2357953ab8e1ef6eb36d6f10078bb039fa1.94 Ether
0xdd43e4b22291d6f6744d5547a98acddbf49b6e83067d3f93ce2cf717fad3efe3513295215 hrs 19 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x44e6a8806f2ae1186b804ef9f1a24983c969cf2b0.000010438455163786 Ether
0xdd43e4b22291d6f6744d5547a98acddbf49b6e83067d3f93ce2cf717fad3efe3513295215 hrs 19 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x7404190c4fd2fcc17286064e900c998fb864d9e22.453740674698491128 Ether
0xfcdcd7b1a917631f0f377de6411ec2c8a6ca2d18d756e0abc5c33c5ec87a7c2a513246217 hrs 19 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xb7a87ef2a7647f231e04567a4b7cba22b53fcd660.022724219699999428 Ether
0xfcdcd7b1a917631f0f377de6411ec2c8a6ca2d18d756e0abc5c33c5ec87a7c2a513246217 hrs 19 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x7404190c4fd2fcc17286064e900c998fb864d9e22.34 Ether
0xd08cb29afeebeefd218d90eb9c4627ba3e38b19807505c057850d4a694b65182513246217 hrs 19 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x7404190c4fd2fcc17286064e900c998fb864d9e20.022725734849999872 Ether
0xd08cb29afeebeefd218d90eb9c4627ba3e38b19807505c057850d4a694b65182513246217 hrs 19 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xb03bec2357953ab8e1ef6eb36d6f10078bb039fa1.94 Ether
0x0323155e865f472a19b29a1737946a273713ada2aae04c827dc9aa41966da240513244717 hrs 22 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x98f7ecd99404c1f06c7dba998f9c59c981d764340.138482295373939594 Ether
0x0323155e865f472a19b29a1737946a273713ada2aae04c827dc9aa41966da240513244717 hrs 22 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x7404190c4fd2fcc17286064e900c998fb864d9e22.453740674698491128 Ether
0x63c20e576452588a775476435583c49f5bb04d7bfde3ca3c014e71f27810ceed513244617 hrs 22 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x7404190c4fd2fcc17286064e900c998fb864d9e20.455072862765797418 Ether
0x63c20e576452588a775476435583c49f5bb04d7bfde3ca3c014e71f27810ceed513244617 hrs 22 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2f10f33c012f2794693be01be402b2179d4f03902.034297824322680679 Ether
0xcbeb77e07ec3fcd23267dd2db136a86b52c7e4c0b3bc84df66aaa909a95ae7f8513244617 hrs 22 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2f10f33c012f2794693be01be402b2179d4f03900.272561740541855457 Ether
0xcbeb77e07ec3fcd23267dd2db136a86b52c7e4c0b3bc84df66aaa909a95ae7f8513244617 hrs 22 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xd7669cb6bcec3a9e9cd2beb38074ecd267806c471.578615111674400207 Ether
0x27d4d351625495e57352473d3cc0e14da2fa50984889b66ad0abc81ee4ad113f513244617 hrs 22 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xd7669cb6bcec3a9e9cd2beb38074ecd267806c470.637107910660479834 Ether
0x27d4d351625495e57352473d3cc0e14da2fa50984889b66ad0abc81ee4ad113f513244617 hrs 22 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2f10f33c012f2794693be01be402b2179d4f03901.225005326659334562 Ether
0x1aca499dddf3a88012fdffe10c683cb88583f63cfb41c49ac113202ef4e96fd3513244517 hrs 23 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2f10f33c012f2794693be01be402b2179d4f03900.919995738672532351 Ether
0x1aca499dddf3a88012fdffe10c683cb88583f63cfb41c49ac113202ef4e96fd3513244517 hrs 23 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xd7669cb6bcec3a9e9cd2beb38074ecd267806c470.95060413348764362 Ether
0x8bd3a5c9ea470811d1299a75ffee1adc9ea2f0ca9df7d5ec3f5646500ea9ecd4513244517 hrs 23 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xd7669cb6bcec3a9e9cd2beb38074ecd267806c471.139516693209885104 Ether
0x8bd3a5c9ea470811d1299a75ffee1adc9ea2f0ca9df7d5ec3f5646500ea9ecd4513244517 hrs 23 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2f10f33c012f2794693be01be402b2179d4f03900.73766880758641145 Ether
0xd7806e5f3c390e53a389a5ff68287c1c9f456970de8200205be9759547637194513244517 hrs 23 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2f10f33c012f2794693be01be402b2179d4f03901.30986495393087084 Ether
0xd7806e5f3c390e53a389a5ff68287c1c9f456970de8200205be9759547637194513244517 hrs 23 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xd7669cb6bcec3a9e9cd2beb38074ecd267806c470.572430994687055286 Ether
0xc48b4ce705cab57e046be10526c682e55a2478085efd284c63d47f3e564e09b2513244517 hrs 23 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xd7669cb6bcec3a9e9cd2beb38074ecd267806c471.480348411684174819 Ether
0xc48b4ce705cab57e046be10526c682e55a2478085efd284c63d47f3e564e09b2513244517 hrs 23 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2f10f33c012f2794693be01be402b2179d4f03900.402865524783192174 Ether
0x5c07652641aba867656d93be40b0a09483e26444fee2c1c1d2420cd7176a38b0513244517 hrs 23 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2f10f33c012f2794693be01be402b2179d4f03901.601581092753190982 Ether
0x5c07652641aba867656d93be40b0a09483e26444fee2c1c1d2420cd7176a38b0513244517 hrs 23 mins ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xd7669cb6bcec3a9e9cd2beb38074ecd267806c470.286482150956936658 Ether
[ Download CSV Export  ] 
Contract Source Code Verified
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.