Contract 0xA4bec96265C7B58486aCd15DE27A53E2A45b30a2

 
 
Txn Hash
Method
Block
From
To
Value
0xf94b1bd604cd16e3dd6832ea658d79b9f69f4ba6569829b8031e898fbb143a63Withdraw All50527072018-02-08 11:30:091762 days 22 hrs ago0x747c66f6f7b623629cfdf281eaf27e885ab4cffc IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20 Ether0.000601620
0x6228075d89904ae4625074df3eec30b76bf28cc2eb282b76e39cac68703eaba5Buy50173012018-02-02 12:42:571768 days 21 hrs ago0x7cd84443027d2e19473c3657f167ada34417654f IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a21.18200331 Ether0.000196344
0xbaee6421cc1441b0b2a9a0d068c5845b36183f72e72692dd2cd07a60b0321255Buy50150922018-02-02 3:49:001769 days 5 hrs ago0x50261871a86dad1bd25008c5f31cfd92303d9dec IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.92568197 Ether0.0005399411
0x58938ec7d348a28530c1480c2fe2788dacae4dfeb725390a77996aa24a6193dbBuy50149972018-02-02 3:26:211769 days 6 hrs ago0xbace3371fd1e65dd0255ddef233bd16bfa374db2 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.032 Ether0.0012250953
0x467f9163e70b438fcd650830d65d2bf04c48dcf947226b19264dd35ebe72a1d3Buy50149972018-02-02 3:26:211769 days 6 hrs ago0xbace3371fd1e65dd0255ddef233bd16bfa374db2 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.016 Ether0.0009911943
0x7aacd4f782f75238218cee6fc13045b7f92017dfbb861a183dd458f52b5f4228Buy50149972018-02-02 3:26:211769 days 6 hrs ago0xbace3371fd1e65dd0255ddef233bd16bfa374db2 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.016 Ether0.0008759338
0x3e227be85a3f22f30d643a3ba237fb49e58440b0847be6180adac200af7d099dBuy50149972018-02-02 3:26:211769 days 6 hrs ago0xbace3371fd1e65dd0255ddef233bd16bfa374db2 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.008 Ether0.0008321436
0x850cfffb953c974b0d6195509e41fc3ff467a8538a5a27674d617f81dc6ce0beBuy50149952018-02-02 3:26:031769 days 6 hrs ago0xbace3371fd1e65dd0255ddef233bd16bfa374db2 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.008 Ether0.0008298336
0x7846d3c8529a422a59c9ca4afb516aa582482295deade75242cdd167a6f71c35Buy50149932018-02-02 3:25:511769 days 6 hrs ago0xbace3371fd1e65dd0255ddef233bd16bfa374db2 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.004 Ether0.0006472228
0x48cf62cb7e51082e5653e6c7a90236b42dc58a56621221e059d1d94d998df9f9Buy50149922018-02-02 3:25:361769 days 6 hrs ago0xbace3371fd1e65dd0255ddef233bd16bfa374db2 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.004 Ether0.0006009926
0xfd1862921c4f98612b2c28f01fb0435d46c5c916f907c30b73e20f9e465860c2Buy50149902018-02-02 3:25:151769 days 6 hrs ago0xbace3371fd1e65dd0255ddef233bd16bfa374db2 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.002 Ether0.000023111
0x02bbfc77aba6d85a72690121e6bda247525a431af7bb568973c31a3352c5dd6bBuy50149242018-02-02 3:10:111769 days 6 hrs ago0xbace3371fd1e65dd0255ddef233bd16bfa374db2 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.002 Ether0.000023111
0xb52497b4377c6707919405b104fd1806c2822c53040db6e765f8d76cde26603aBuy50147072018-02-02 2:08:121769 days 7 hrs ago0x7f6c305bb0b2cd5e83db06aded1925e1c4e2cf72 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.92568197 Ether0.0019168539
0xc304640125ed61b2642360530069918cf01c01a07ea84d938b0a5996347881afBuy50147062018-02-02 2:07:481769 days 7 hrs ago0x7f6c305bb0b2cd5e83db06aded1925e1c4e2cf72 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.92568197 Ether0.000884718
0x6548eb3d6084c2f529162dd609dba2c5e60734524e85a07c99a837fc90ab71b6Buy50145832018-02-02 1:36:351769 days 8 hrs ago0x3de5e64e972c2e69b4cab92789f289d8466d98a0 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.016 Ether0.0003236114
0xb55d33995f2aa84b99eeb979647d8a0684525c424cfab029745fb228bee3b158Buy50145802018-02-02 1:35:411769 days 8 hrs ago0x3de5e64e972c2e69b4cab92789f289d8466d98a0 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.008 Ether0.000023111
0x31ce234628f828059cc7493e4d91ff70dbcb342a54e9e13b5fae0c283ba28d23Buy50145802018-02-02 1:35:411769 days 8 hrs ago0xbace3371fd1e65dd0255ddef233bd16bfa374db2 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.002 Ether0.000023051
0xffbe627ac58261eed976e1b6cb448cd469c7bebf034f2534f8133fd6a0d21543Buy50145472018-02-02 1:25:071769 days 8 hrs agoENS Name vitaliq.eth IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.004 Ether0.0018440880
0xc370a0a7073cacf0c8b2878a1e3dfbc25f8cc137b4c7e49e73af4719dddab327Buy50145312018-02-02 1:21:471769 days 8 hrs agoENS Name vitaliq.eth IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.21030809 Ether0.0022820499
0x6b8c116d8b370ad339188540a818f06c3f05948c7d553e80e82a906b8112209fBuy50143132018-02-02 0:24:501769 days 9 hrs ago0x0e3619445cc5084dc881bac90bb649be0b106842 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.002 Ether0.000023051
0x2a409c7c665cf21c4b219a168b75d49a956cd07c3b3950ca981d3b7da60839f3Buy50142692018-02-02 0:13:531769 days 9 hrs ago0x0e3619445cc5084dc881bac90bb649be0b106842 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.001 Ether0.000046232
0x1133700ed2150696ace846bc25cac1c545c252658103cad59e40666c5b53034fBuy50142502018-02-02 0:09:181769 days 9 hrs ago0x155f173031764f0040f3da43e8d383ae9270d494 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.128 Ether0.0006915330
0xca09a9882c1228500cce529851db70a357dd2de6b987f9571120075b0fff12f3Buy50142502018-02-02 0:09:181769 days 9 hrs ago0x155f173031764f0040f3da43e8d383ae9270d494 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.21030809 Ether0.0006915330
0xfcff860b854a16f8063beff3008c5a227f60ccbef90afbe9ff72f96b9146fff4Buy50142502018-02-02 0:09:181769 days 9 hrs ago0x155f173031764f0040f3da43e8d383ae9270d494 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.001 Ether0.000924640
0x6a2f1c08b37b5f2bf032e40349f6e4627261327676bd2126a90826622d5eceb5Buy50142502018-02-02 0:09:181769 days 9 hrs ago0x155f173031764f0040f3da43e8d383ae9270d494 IN  0xa4bec96265c7b58486acd15de27a53e2a45b30a20.001 Ether0.0009220440
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xf94b1bd604cd16e3dd6832ea658d79b9f69f4ba6569829b8031e898fbb143a6350527072018-02-08 11:30:091762 days 22 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x747c66f6f7b623629cfdf281eaf27e885ab4cffc5.40547045 Ether
0x6228075d89904ae4625074df3eec30b76bf28cc2eb282b76e39cac68703eaba550173012018-02-02 12:42:571768 days 21 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x8bb4f7f71a4a86e50c21f0a67c11dd05bb85a6bb1.12290315 Ether
0xbaee6421cc1441b0b2a9a0d068c5845b36183f72e72692dd2cd07a60b032125550150922018-02-02 3:49:001769 days 5 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x60f01d5632725652c5596fff489f9439f4a751ea0.87939788 Ether
0xb52497b4377c6707919405b104fd1806c2822c53040db6e765f8d76cde26603a50147072018-02-02 2:08:121769 days 7 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x7d526cf82801f0128e7feee03bc0200a49ed7f5a0.87939788 Ether
0xc304640125ed61b2642360530069918cf01c01a07ea84d938b0a5996347881af50147062018-02-02 2:07:481769 days 7 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xe2b671583a3690d4ec842cdd0735cdb225ad769d0.87939788 Ether
0x9919698808a174d83e830ab65be58792305d0d37ad996b0a0d35fe414bd7b8df50140522018-02-01 23:23:471769 days 10 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xdb224f8c9056218f33665609132f914d5499c2d90.87939788 Ether
0xceea81c7f2d4253ec08719327d28e0d68ecde3eb77763f03219f7b73b1ae35fc50140402018-02-01 23:20:591769 days 10 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x41fc933390608be0989f360348f95da86e7f3d2b0.77822821 Ether
0x78ad16286adb5d523376f829a9ba73c85c6a88d3f8e946a8e1eb2484ca69f2d850139692018-02-01 23:07:331769 days 10 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xeca46592d25c07f72bbf6ed5ee10c31b24fa9d1d0.87939788 Ether
0xa77cb9d8a41c05730c525dda4faefbc0b983f28178e8e846ddfc60057d92f02050138882018-02-01 22:45:341769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xa2381223639181689cd6c46d38a1a4884bb6d83c0.77822821 Ether
0xaea17e12e66ed46b54ac8cad1391142e0fb4301519b771e7f80b2c5e0bb2167250138742018-02-01 22:41:371769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x1561b611aabe08bc6678df2bc10756d14daa4e8d0.77822821 Ether
0x5d5a238a8b7b1e41354881b188ae8ade6658dc17c497c8d2994295d4e8796e0250137982018-02-01 22:20:281769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xb87e73ad25086c43a16fe5f9589ff265f8a3a9eb0.77822821 Ether
0xf7c9ca3540309afe2955e3548d9dd2f9612d7a50cbfd19123b7b965a6d6ec24a50137982018-02-01 22:20:281769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x8cdeead171fffd36cdda767c4cb39a589e22f8550.77822821 Ether
0x5e88f293966b6ba692452793c3ffa569f17b4a492443d16c0b2f5d5f09a17f0e50137672018-02-01 22:12:241769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x1561b611aabe08bc6678df2bc10756d14daa4e8d0.09505522 Ether
0x5e88f293966b6ba692452793c3ffa569f17b4a492443d16c0b2f5d5f09a17f0e50137672018-02-01 22:12:241769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xef764bac8a438e7e498c2e5fccf0f174c3e3f8db0.68869753 Ether
0xaf84a395924da7e83f48339008404b2b7a123704b807ff19a28fec499b5385da50137572018-02-01 22:10:461769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xef764bac8a438e7e498c2e5fccf0f174c3e3f8db0.15845595 Ether
0xaf84a395924da7e83f48339008404b2b7a123704b807ff19a28fec499b5385da50137572018-02-01 22:10:461769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xa2381223639181689cd6c46d38a1a4884bb6d83c0.60946684 Ether
0xb49b70e534cfed73892e356a9f3ead24807c60e267443025cc0340778b778f1750137442018-02-01 22:08:221769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xeca46592d25c07f72bbf6ed5ee10c31b24fa9d1d0.0508124 Ether
0xb49b70e534cfed73892e356a9f3ead24807c60e267443025cc0340778b778f1750137442018-02-01 22:08:221769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xc6ebc539ac0e1bfd90413611b69ae057229c9e1a0.77822821 Ether
0x45db2b698e24afd96ae103c1d1250c16545c0418ae112bc3e336dd41f50863a550137432018-02-01 22:08:171769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x8bb4f7f71a4a86e50c21f0a67c11dd05bb85a6bb0.68869753 Ether
0x70d467dd725fffdc89fbe9832cd7e327a9788dafc06dc1ff397a51ecf4ea6d9150137432018-02-01 22:08:171769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xa2381223639181689cd6c46d38a1a4884bb6d83c0.2322619 Ether
0x70d467dd725fffdc89fbe9832cd7e327a9788dafc06dc1ff397a51ecf4ea6d9150137432018-02-01 22:08:171769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x1561b611aabe08bc6678df2bc10756d14daa4e8d0.53935118 Ether
0x72eec82b409c7dfe53a9b233e15ae9aa273a8181b327614cabb68802994c0f5150137392018-02-01 22:07:141769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x1561b611aabe08bc6678df2bc10756d14daa4e8d0.31886602 Ether
0x72eec82b409c7dfe53a9b233e15ae9aa273a8181b327614cabb68802994c0f5150137392018-02-01 22:07:141769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xeca46592d25c07f72bbf6ed5ee10c31b24fa9d1d0.45707727 Ether
0x2da6dd5afb617eac8c971bdcb7b5bcc20aa582aa530c6b639d4b8540d9f88c7d50137352018-02-01 22:05:401769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20xeca46592d25c07f72bbf6ed5ee10c31b24fa9d1d0.25225934 Ether
0x2da6dd5afb617eac8c971bdcb7b5bcc20aa582aa530c6b639d4b8540d9f88c7d50137352018-02-01 22:05:401769 days 11 hrs ago 0xa4bec96265c7b58486acd15de27a53e2a45b30a20x8cdeead171fffd36cdda767c4cb39a589e22f8550.38735362 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ItemRegistry

Compiler Version
v0.4.20-nightly.2018.1.6+commit.2548228b

Optimization Enabled:
Yes with 200 runs

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

pragma solidity ^0.4.13;

contract ItemRegistry {
  using SafeMath for uint256;

  enum ItemClass {TIER1, TIER2, TIER3, TIER4}

  event Bought (uint256 indexed _itemId, address indexed _owner, uint256 _price);
  event Sold (uint256 indexed _itemId, address indexed _owner, uint256 _price);

  address public owner;
  uint256 cutNumerator = 5;
  uint256 cutDenominator = 100;

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

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

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

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

  function withdrawAll () onlyOwner() public {
    owner.transfer(this.balance);
  }

  function withdrawAmountTo (uint256 _amount, address _to) onlyOwner() public {
    _to.transfer(_amount);
  }

  function listItem (uint256 _itemId, uint256 _price, ItemClass _class, address _owner) onlyOwner() public {
    require(_price > 0);
    require(priceOfItem[_itemId] == 0);
    require(ownerOfItem[_itemId] == address(0));
    require(_class <= ItemClass.TIER4);

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

  function listMultipleItems (uint256[] _itemIds, uint256 _price, ItemClass _class) onlyOwner() external {
    for (uint256 i = 0; i < _itemIds.length; i++) {
      listItem(_itemIds[i], _price, _class, msg.sender);
    }
  }

  /* Read */
  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 startingPriceOf (uint256 _itemId) public view returns (uint256 _startingPrice) {
    return startingPriceOfItem[_itemId];
  }

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

  function classOf (uint256 _itemId) public view returns (ItemClass _class) {
    return classOfItem[_itemId];
  }

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

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

  function itemsOfOwner (address _owner) public view returns (uint256[] _items) {
    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 numberOfItemsForSale () public view returns (uint256 _n) {
    return listedItems.length;
  }

  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;
  }

  function allItemsForSale () public view returns (uint256[] _items) {
    return listedItems;
  }

  /* Next price */
  function calculateNextPrice (uint256 _currentPrice, ItemClass _class) public pure returns (uint256 _newPrice) {
    if (_class == ItemClass.TIER1) {
      if (_currentPrice <= 0.05 ether) {
        return _currentPrice.mul(2); // 2
      } else if (_currentPrice <= 0.5 ether) {
        return _currentPrice.mul(117).div(100); // 1.17
      } else {
        return _currentPrice.mul(112).div(100); // 1.12
      }
    }

    if (_class == ItemClass.TIER2) {
      if (_currentPrice <= 0.1 ether) {
        return _currentPrice.mul(2); // 2
      } else if (_currentPrice <= 0.5 ether) {
        return _currentPrice.mul(118).div(100); // 1.18
      } else {
        return _currentPrice.mul(113).div(100); // 1.13
      }
    }

    if (_class == ItemClass.TIER3) {
      if (_currentPrice <= 0.15 ether) {
        return _currentPrice * 2; // 2
      } else if (_currentPrice <= 0.5 ether) {
        return _currentPrice.mul(119).div(100); // 1.19
      } else {
        return _currentPrice.mul(114).div(100); // 1.14
      }
    }

    if (_class == ItemClass.TIER4) {
      if (_currentPrice <= 0.2 ether) {
        return _currentPrice.mul(2); // 2
      } else if (_currentPrice <= 0.5 ether) {
        return _currentPrice.mul(120).div(100); // 1.2
      } else {
        return  _currentPrice.mul(115).div(100); // 1.15
      }
    }
  }

  /* Buy */
  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));

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

    ownerOfItem[_itemId] = newOwner;
    priceOfItem[_itemId] = nextPriceOf(_itemId);

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

    uint256 cut = 0;
    if (cutDenominator > 0 && cutNumerator > 0) {
      cut = price.mul(cutNumerator).div(cutDenominator);
    }

    oldOwner.transfer(price - cut);

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

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

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 Security Audit

Contract ABI

[{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","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":"_class","type":"uint8"},{"name":"_nextPrice","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numberOfItemsForSale","outputs":[{"name":"_n","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"classOf","outputs":[{"name":"_class","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_itemIds","type":"uint256[]"},{"name":"_price","type":"uint256"},{"name":"_class","type":"uint8"}],"name":"listMultipleItems","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":"_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":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"_balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"itemsOfOwner","outputs":[{"name":"_items","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_itemId","type":"uint256"}],"name":"startingPriceOf","outputs":[{"name":"_startingPrice","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"},{"name":"_to","type":"address"}],"name":"withdrawAmountTo","outputs":[],"payable":false,"stateMutability":"nonpayable","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":"_itemId","type":"uint256"},{"name":"_price","type":"uint256"},{"name":"_class","type":"uint8"},{"name":"_owner","type":"address"}],"name":"listItem","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":"allItemsForSale","outputs":[{"name":"_items","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_currentPrice","type":"uint256"},{"name":"_class","type":"uint8"}],"name":"calculateNextPrice","outputs":[{"name":"_newPrice","type":"uint256"}],"payable":false,"stateMutability":"pure","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"}]

606060405260056001556064600255341561001957600080fd5b60008054600160a060020a033316600160a060020a0319909116179055610ddb806100456000396000f3006060604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166313af4035811461010b5780632e4f43bf1461012c5780633a3d12d4146101945780634324aa21146101b95780635191e37f146101f35780635435bac81461021b5780635ba9e48e146102875780636352211e1461029d57806370a08231146102cf578063853828b6146102ee5780638da5cb5b146103015780639a4ca3cb14610314578063af7520b914610333578063b1237eae14610349578063b9186d7d1461036b578063bc358af914610381578063d96a094a146103ac578063f0d07014146103b7578063fa0a8f26146103ca575b600080fd5b341561011657600080fd5b61012a600160a060020a03600435166103e6565b005b341561013757600080fd5b610142600435610430565b6040518086600160a060020a0316600160a060020a0316815260200185815260200184815260200183600381111561017657fe5b60ff1681526020018281526020019550505050505060405180910390f35b341561019f57600080fd5b6101a7610477565b60405190815260200160405180910390f35b34156101c457600080fd5b6101cf60043561047e565b604051808260038111156101df57fe5b60ff16815260200191505060405180910390f35b34156101fe57600080fd5b61012a60246004803582810192910135903560ff60443516610493565b341561022657600080fd5b6102346004356024356104e8565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561027357808201518382015260200161025b565b505050509050019250505060405180910390f35b341561029257600080fd5b6101a760043561056a565b34156102a857600080fd5b6102b360043561058c565b604051600160a060020a03909116815260200160405180910390f35b34156102da57600080fd5b6101a7600160a060020a03600435166105a7565b34156102f957600080fd5b61012a610608565b341561030c57600080fd5b6102b361065e565b341561031f57600080fd5b610234600160a060020a036004351661066d565b341561033e57600080fd5b6101a7600435610730565b341561035457600080fd5b61012a600435600160a060020a0360243516610742565b341561037657600080fd5b6101a7600435610792565b341561038c57600080fd5b61012a60043560243560ff60443516600160a060020a03606435166107a4565b61012a6004356108b5565b34156103c257600080fd5b610234610aeb565b34156103d557600080fd5b6101a760043560ff60243516610b49565b60005433600160a060020a0390811691161461040157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008060008060006104418661058c565b61044a87610730565b61045388610792565b61045c8961047e565b6104658a61056a565b939a9299509097509550909350915050565b6003545b90565b60009081526007602052604090205460ff1690565b6000805433600160a060020a039081169116146104af57600080fd5b5060005b838110156104e1576104d98585838181106104ca57fe5b905060200201358484336107a4565b6001016104b3565b5050505050565b6104f0610d56565b6104f8610d56565b6000836040518059106105085750595b90808252806020026020018201604052509150600090505b83811015610562576003805486830190811061053857fe5b90600052602060002090015482828151811061055057fe5b60209081029091010152600101610520565b509392505050565b600061058661057883610792565b6105818461047e565b610b49565b92915050565b600090815260046020526040902054600160a060020a031690565b600080805b6003548110156106015783600160a060020a03166105e36003838154811015156105d257fe5b90600052602060002090015461058c565b600160a060020a031614156105f9576001909101905b6001016105ac565b5092915050565b60005433600160a060020a0390811691161461062357600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561065c57600080fd5b565b600054600160a060020a031681565b610675610d56565b61067d610d56565b600080610689856105a7565b6040518059106106965750595b9080825280602002602001820160405250925060009150600090505b6003548110156107275784600160a060020a03166106d86003838154811015156105d257fe5b600160a060020a0316141561071f5760038054829081106106f557fe5b90600052602060002090015483838151811061070d57fe5b60209081029091010152600191909101905b6001016106b2565b50909392505050565b60009081526005602052604090205490565b60005433600160a060020a0390811691161461075d57600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f19350505050151561078e57600080fd5b5050565b60009081526006602052604090205490565b60005433600160a060020a039081169116146107bf57600080fd5b600083116107cc57600080fd5b600084815260066020526040902054156107e557600080fd5b600084815260046020526040902054600160a060020a03161561080757600080fd5b600382600381111561081557fe5b111561082057600080fd5b6000848152600460209081526040808320805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038616179055600682528083208690556005825280832086905560079091529020805483919060ff1916600183600381111561088957fe5b021790555060038054600181016108a08382610d68565b50600091825260209091200193909355505050565b6000806000806000806108c787610792565b116108d157600080fd5b60006108dc8761058c565b600160a060020a031614156108f057600080fd5b6108f986610792565b34101561090557600080fd5b33600160a060020a03166109188761058c565b600160a060020a0316141561092c57600080fd5b61093533610d05565b1561093f57600080fd5b6109488661058c565b945033935061095686610792565b6000878152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038716179055925034839003915061099b8661056a565b600660008881526020019081526020016000208190555083600160a060020a0316867fd2728f908c7e0feb83c6278798370fcb86b62f236c9dbf1a3f541096c21590408560405190815260200160405180910390a384600160a060020a0316867f66f5cd880edf48cdde6c966e5da0784fcc4c5e85572b8b3b62c4357798d447d78560405190815260200160405180910390a3600090506000600254118015610a4657506000600154115b15610a7557610a72600254610a6660015486610d0d90919063ffffffff16565b9063ffffffff610d3f16565b90505b600160a060020a03851681840380156108fc0290604051600060405180830381858888f193505050501515610aa957600080fd5b6000821115610ae357600160a060020a03841682156108fc0283604051600060405180830381858888f193505050501515610ae357600080fd5b505050505050565b610af3610d56565b6003805480602002602001604051908101604052809291908181526020018280548015610b3f57602002820191906000526020600020905b815481526020019060010190808311610b2b575b5050505050905090565b600080826003811115610b5857fe5b1415610bbf5766b1a2bc2ec500008311610b8457610b7d83600263ffffffff610d0d16565b9050610586565b6706f05b59d3b200008311610ba957610b7d6064610a6685607563ffffffff610d0d16565b610b7d6064610a6685607063ffffffff610d0d16565b6001826003811115610bcd57fe5b1415610c2e5767016345785d8a00008311610bf357610b7d83600263ffffffff610d0d16565b6706f05b59d3b200008311610c1857610b7d6064610a6685607663ffffffff610d0d16565b610b7d6064610a6685607163ffffffff610d0d16565b6002826003811115610c3c57fe5b1415610c9657670214e8348c4f00008311610c5b575060028202610586565b6706f05b59d3b200008311610c8057610b7d6064610a6685607763ffffffff610d0d16565b610b7d6064610a6685607263ffffffff610d0d16565b6003826003811115610ca457fe5b1415610586576702c68af0bb1400008311610cca57610b7d83600263ffffffff610d0d16565b6706f05b59d3b200008311610cef57610b7d6064610a6685607863ffffffff610d0d16565b610b7d6064610a6685607363ffffffff610d0d16565b6000903b1190565b600080831515610d205760009150610601565b50828202828482811515610d3057fe5b0414610d3857fe5b9392505050565b6000808284811515610d4d57fe5b04949350505050565b60206040519081016040526000815290565b815481835581811511610d8c57600083815260209020610d8c918101908301610d91565b505050565b61047b91905b80821115610dab5760008155600101610d97565b50905600a165627a7a7230582090c7352f36167df7990f5216b905227a9042e24b7b9b7108874f74133cbfd5650029

Swarm Source

bzzr://90c7352f36167df7990f5216b905227a9042e24b7b9b7108874f74133cbfd565
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.