Sponsored Link:   Revain - How to find moon tokens to invest? See what crypto experts are saying. Read reviews!
 Latest 25 txns from a total Of 9605 transactions
View All

TxHash Age From To Value [TxFee]
0x082556383016d4ad76c49a31544d21fd630b9729f2aac7c66410e7505ff208b829 days 10 hrs ago0x46740a9ae3b3bdfc4a9381023bf8a74ecbceedf2  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef4.36431 Ether0.00026506
0x1edaefb9c1bba181cbb4e402a6d275db7933af560fb6677699b5b06223486d1d48 days 19 hrs ago0x14a12356b5b106e9a7f706b1a01af4fd6cf93f86  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.35402 Ether0.000066265
0x27897e909a2999b1da2885c3c11aa914abc981d5f2d1b9f12ab6f93ccf8e791a56 days 22 hrs ago0xcef2abb0d96240f59ebb7f21711a06edb85f1990  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef3.27004 Ether0.0000728211
0x92e7ffe83b4f3e1b4dc4248002f1a68a443644803766cbeb3932dc6c4df5792868 days 17 hrs ago0x3f63d5e021cb75841d8146f2275bdcfed78ebd02  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.0000023486
0xf13bf1e14e0b54aab034a9a9e65f2d783928ba62cfb68c810bb2f540658c3b3169 days 7 hrs ago0xfc1f7923bcbfd84637b8e4ef4376abbc564e59a6  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.00060902
0xf70926ef1e38141b1a8c47c45519f637c23c3937e3e27b6cbe472e27f2ed547669 days 12 hrs ago0xa89b146ec9d3899e94611f1e61e3217cf2e956ef  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.14002 Ether0.00013253
0xef192428e09fe7cf589c80a4920e5ad57115ae9baa2984d2198375aba377c39677 days 6 hrs ago0x4180fc6676c646dd127fd4afac0021d2beb8df32  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.00058715
0x7220107d98fa08a62e22925194ce5968c6faae3aa103f9024280c2fa06f4b11778 days 13 hrs ago0x1ca05331643e3a076fe022eba795c3d26aa41c41  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.6 Ether0.000331325
0x0d29d7a20c9c780ebe80176b082bb2cd7c2bd5f0cf957610cf102dd42b44b7ab80 days 3 hrs ago0x2dd69f5b02e99efef9101fcae8bd1e02375b265b  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.82672 Ether0.000131626
0xd11bcff5d5f4ef3f7c092633d9d161334824896a90d0ae06d2743772269a339e80 days 3 hrs ago0x2dd69f5b02e99efef9101fcae8bd1e02375b265b  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.82525 Ether0.000131626
0x4f52cb5ce74104eaff71d11e7415142e83be2575c759f4ab8506f5c805a53a8080 days 13 hrs ago0xf8835309fb87154b65c7c9e8071a0922cac63dac  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.90978 Ether0.00066201
0x1cd6441d8bb70e3d457b5290f22c5cd0e15d969005e7e84674679f7280607dfa80 days 15 hrs ago0xb480cff7072a74a37f1dcbfbfe9fe6a76ff1fd4c  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef28.76499 Ether0.000331015
0x69d07f5b79eedc873b1b9502b59d53a95da96e222f3bbedd73b542cabbdbcdf580 days 18 hrs ago0xb480cff7072a74a37f1dcbfbfe9fe6a76ff1fd4c  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef5.86736 Ether0.000331015
0x584afa525bd5c443a74cba2bf8781cdaffa8577b82034aa4536f88adbe9a833c81 days 3 hrs ago0x739061db8d6be288d0e314bc8c35760891cea5cb  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef3.27004 Ether0.00013253
0xee826a481f190a683fa6f6f49d5d160dc7e129c2f28343de1f67ca8a60200ae181 days 20 hrs ago0x82b4828e321934df4e11b4cef8737db45bc8cd31  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.41639 Ether0.000263252
0x79af97e6cb09b41eafb0d64ae0071113f5db9eb9d0bc804ab955cfd3d487f37882 days 2 hrs ago0xac57bbc3b04e783fc61aaad2e91d03c20e53e0af  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.4 Ether0.003488089
0x67422a148c80fc56223b8eadd9fe05bf8cfcc79e37187e19f48e5744c75c3d1082 days 2 hrs ago0xb03bec2357953ab8e1ef6eb36d6f10078bb039fa  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.001352256
0xd36afb6e445215f45de2635138c409ea9e96410e250416ddda04e047cbbb502b82 days 2 hrs ago0x7404190c4fd2fcc17286064e900c998fb864d9e2  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.41754 Ether0.003027398
0xa2e31fb08debd7bfcf6dcbf7b6238d2c0840f4393e808d1ec53ee30e53a244ea82 days 2 hrs ago0x4f3413f3743ec99e366044d1c41f7bf00fa2fc08  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef2.09722 Ether0.000198795
0xe6b7b5a520f405f2e4583f6e1fbb8224e13938ff13cd7cbae25b24a6528cf6cc82 days 2 hrs ago0x2f10f33c012f2794693be01be402b2179d4f0390  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.2 Ether0.002961584999
0x5b1e5ce92febcd0a6bb824a14fc0c56c7f9425de7fe229b31ff59c764dd08e8182 days 3 hrs ago0xb03bec2357953ab8e1ef6eb36d6f10078bb039fa  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0 Ether0.001351488
0x33c1ff4425b8ec4521bb4d5f5d44f589ec0ba7c41b2f9117d4e5c9219cca806a82 days 13 hrs ago0x6c656688fcf27c1806c13792fea58ad4ae656548  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0.00022 Ether0.000023486
0x21d396b66ce1dfd82c7422a2909541644f10e0735a2e6d2ddad6a9ee6675f49c82 days 13 hrs ago0x2dc111c84731bf455e3cf0af59d13256439eb128  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.62745 Ether0.000592317
0xbad694ab5cbcb5b768fb86efe6a20fb19ad7c17f18975fd5240d4b1804c7f66b82 days 14 hrs ago0x4db690a81f4a1e4ba0e576ac2cbab76dfc917aa7  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef4.23338 Ether0.00013253
0x00257bf9d8b009729598a3f96c02e29f1c5e2a4ff6009daeaafcb9c7cd7b018582 days 15 hrs ago0x54b6c156801da8566eee2e49248aff3363866099  IN   0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef1.5 Ether0.006647113
[ 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
0x082556383016d4ad76c49a31544d21fd630b9729f2aac7c66410e7505ff208b8551351829 days 10 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x46740a9ae3b3bdfc4a9381023bf8a74ecbceedf20.000008239690701944 Ether
0x082556383016d4ad76c49a31544d21fd630b9729f2aac7c66410e7505ff208b8551351829 days 10 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xb7a87ef2a7647f231e04567a4b7cba22b53fcd664.233372707500019115 Ether
0x1edaefb9c1bba181cbb4e402a6d275db7933af560fb6677699b5b06223486d1d539975148 days 19 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x14a12356b5b106e9a7f706b1a01af4fd6cf93f860.000014238900460517 Ether
0x1edaefb9c1bba181cbb4e402a6d275db7933af560fb6677699b5b06223486d1d539975148 days 19 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2dd69f5b02e99efef9101fcae8bd1e02375b265b2.283385588266553299 Ether
0x27897e909a2999b1da2885c3c11aa914abc981d5f2d1b9f12ab6f93ccf8e791a535069356 days 22 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xcef2abb0d96240f59ebb7f21711a06edb85f19900.000008891706789942 Ether
0x27897e909a2999b1da2885c3c11aa914abc981d5f2d1b9f12ab6f93ccf8e791a535069356 days 22 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x7404190c4fd2fcc17286064e900c998fb864d9e23.171930175044413757 Ether
0xf13bf1e14e0b54aab034a9a9e65f2d783928ba62cfb68c810bb2f540658c3b31527665469 days 7 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xfc1f7923bcbfd84637b8e4ef4376abbc564e59a6159.744098378493302103 Ether
0xf70926ef1e38141b1a8c47c45519f637c23c3937e3e27b6cbe472e27f2ed5476527540269 days 12 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xa89b146ec9d3899e94611f1e61e3217cf2e956ef0.000014762636782289 Ether
0xf70926ef1e38141b1a8c47c45519f637c23c3937e3e27b6cbe472e27f2ed5476527540269 days 12 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x8374e6ed6c867491ffc1ffef7a0f6f59a00e85b12.07580508024232118 Ether
0x7220107d98fa08a62e22925194ce5968c6faae3aa103f9024280c2fa06f4b117522237378 days 13 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x1ca05331643e3a076fe022eba795c3d26aa41c410.070370438455163786 Ether
0x7220107d98fa08a62e22925194ce5968c6faae3aa103f9024280c2fa06f4b117522237378 days 13 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2dc111c84731bf455e3cf0af59d13256439eb1282.453740674698491128 Ether
0x0d29d7a20c9c780ebe80176b082bb2cd7c2bd5f0cf957610cf102dd42b44b7ab521302480 days 3 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2dd69f5b02e99efef9101fcae8bd1e02375b265b0.000011529386757361 Ether
0x0d29d7a20c9c780ebe80176b082bb2cd7c2bd5f0cf957610cf102dd42b44b7ab521302480 days 3 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x7404190c4fd2fcc17286064e900c998fb864d9e21.77190721649484536 Ether
0xd11bcff5d5f4ef3f7c092633d9d161334824896a90d0ae06d2743772269a339e521300580 days 3 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x2dd69f5b02e99efef9101fcae8bd1e02375b265b0.000014731241364653 Ether
0xd11bcff5d5f4ef3f7c092633d9d161334824896a90d0ae06d2743772269a339e521300580 days 3 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x82b4828e321934df4e11b4cef8737db45bc8cd311.770478210695876287 Ether
0x4f52cb5ce74104eaff71d11e7415142e83be2575c759f4ab8506f5c805a53a80521053880 days 13 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xf8835309fb87154b65c7c9e8071a0922cac63dac0.000012755872037412 Ether
0x4f52cb5ce74104eaff71d11e7415142e83be2575c759f4ab8506f5c805a53a80521053880 days 13 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x8525c12618eae3d8717c0d6123e85efe41d968cc2.822474226804123711 Ether
0x1cd6441d8bb70e3d457b5290f22c5cd0e15d969005e7e84674679f7280607dfa521009280 days 15 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xb480cff7072a74a37f1dcbfbfe9fe6a76ff1fd4c0.000008153413057283 Ether
0x1cd6441d8bb70e3d457b5290f22c5cd0e15d969005e7e84674679f7280607dfa521009280 days 15 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x99ae71137fde8d9b0e61bae68dc7f4825c054b3328.189682209655203863 Ether
0x69d07f5b79eedc873b1b9502b59d53a95da96e222f3bbedd73b542cabbdbcdf5520930780 days 18 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xb480cff7072a74a37f1dcbfbfe9fe6a76ff1fd4c0.000013061224489796 Ether
0x69d07f5b79eedc873b1b9502b59d53a95da96e222f3bbedd73b542cabbdbcdf5520930780 days 18 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x4e13c14246579f11f443d842e5cf92f6d6e5e5db5.75 Ether
0x584afa525bd5c443a74cba2bf8781cdaffa8577b82034aa4536f88adbe9a833c520721981 days 3 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x739061db8d6be288d0e314bc8c35760891cea5cb0.000008891706789942 Ether
0x584afa525bd5c443a74cba2bf8781cdaffa8577b82034aa4536f88adbe9a833c520721981 days 3 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x07d37ef9704ab8c0f3d9ef2681d235b658ad21e03.171930175044413757 Ether
0xee826a481f190a683fa6f6f49d5d160dc7e129c2f28343de1f67ca8a60200ae1520294781 days 20 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0x82b4828e321934df4e11b4cef8737db45bc8cd310.00000743144329897 Ether
0xee826a481f190a683fa6f6f49d5d160dc7e129c2f28343de1f67ca8a60200ae1520294781 days 20 hrs ago0x92cb5f1fbabbcbdd891b9cbd8e9a056c8c1eebef0xac57bbc3b04e783fc61aaad2e91d03c20e53e0af1.3738910915 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.