Contract 0xBd4B50bbf385195C410a625681FF29d439ba61F3

 

Contract Overview

Etheremon: Trade 2
Balance:
0.88805883 Ether

EtherValue:
$1,784.15 (@ $2,009.05/ETH)

Token:
Txn Hash Method
Block
From
To
Value
0xe2e11b8aaf82028cafc0b448e154c5dbc628c4bd1e931d180335fc1e07fca846Buy Item89822412019-11-22 19:56:39578 days 15 hrs ago0x76ff559d51de4a68950dea865357a76a3e1fed4a IN  Etheremon: Trade 20.009 Ether0.0000229011
0x5803256145990c254f297979dac50c9cb3178ad12b8a10d83312ede33f3a5c9fBuy Item89822412019-11-22 19:56:39578 days 15 hrs ago0x76ff559d51de4a68950dea865357a76a3e1fed4a IN  Etheremon: Trade 20.0088 Ether0.0000229011
0xfb5b4a732278db142c7bd00806ea9df31b6a92d745695deb49fc827496bf1c1bBuy Item89822412019-11-22 19:56:39578 days 15 hrs ago0x76ff559d51de4a68950dea865357a76a3e1fed4a IN  Etheremon: Trade 20.008 Ether0.0000229011
0xa6d2513946456e91b74a1eb99c1a9c7dc05115afcca54a93791da04d9e5811efUpdate Maintaini...89241452019-11-13 3:25:32588 days 7 hrs agoEtheremonToken: Deployer 1 IN  Etheremon: Trade 20 Ether0.0005486420
0xc8e24bc6ab0ea33fd1f6eb72c4e36a83864d64bd00e8cd595592eaffe0e623dcPlace Sell Order89206122019-11-12 13:23:03588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.00016048081.2
0x7da9e5b67294190ecf0db0ca6b5af85c464b5de3e6fd8a8832e375f38a9fa420Place Sell Order89205982019-11-12 13:18:38588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.0002674682
0x1f25b4c588616b5c34c01ff7693bc5e62fd6bd31817247ce7aa4ee483896d5eaPlace Sell Order89205982019-11-12 13:18:38588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.000267342
0xb6f3c9998328ee93864fa60ebee12df3f4a8920771db2b1a219324fac1bfd22bPlace Sell Order89205842019-11-12 13:14:01588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.000267342
0xab5a6d579fc96f88351a735fa4f9632a0bb49e8e5ef016544b3abb3a9abbbc37Place Sell Order89205842019-11-12 13:14:01588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.000267342
0x7ef6ad68a0bfd2bddc5b94a3db12af4bb5b0a2643e357bdc8943d6d6fed06846Place Sell Order89205842019-11-12 13:14:01588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.000267342
0x13653919385433349893ef55be087881ebc94417a22b568b9d09208ec494abcePlace Sell Order89205842019-11-12 13:14:01588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.0002674682
0xfaea16b4a5c656beafe5be52ab684bd3fd1fda6b76ab96670c00cbd3bf1ee4a1Place Sell Order89205842019-11-12 13:14:01588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.000267342
0xbb14f89b1e59e9915a3279c7c9c4ace9d1d40e72729383d1d08c4a0feceb6d08Place Sell Order89205842019-11-12 13:14:01588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.000267342
0x4df471880190b2d5b353d8217a5bc0cba2015dc0c1dcddce4373a9617df4646cPlace Sell Order89205842019-11-12 13:14:01588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.000267342
0x9d829bbc24ed15c55f1cf4de2fc55ce680af47aff86aee1ec2253c085a931507Place Sell Order89205762019-11-12 13:12:16588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.000267342
0xce45caf94b596d3926b1df59e60de91a49214723a917b96c45601f9d3c7d4514Place Sell Order89205752019-11-12 13:12:04588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.000267342
0xb6ccbd7547919ee574024407ef5d34cb70be9b31c99835ab4026ebc8b9564073Place Sell Order89205732019-11-12 13:11:50588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.0002674682
0x8a0ca3803619fdcb97d6c4315e6d174d581e8e769248ffc8d7fd9a14ffa4a6a0Place Sell Order89205732019-11-12 13:11:50588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.0002674682
0xe7c4d3bb41bfb156200bdd598b431567fcbdb4181aae247ccf132dac9f55a4d3Place Sell Order89205702019-11-12 13:11:18588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.0002674682
0x154469698c792dc91c397b78a909d22b476f3a23781cb97c2e7859de6c810e8aPlace Sell Order89205692019-11-12 13:11:15588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.0002674682
0xc25520d2597028eafcb9a4d438226e96d367dd68995aa12830d66f47b5aa0d34Place Sell Order89205692019-11-12 13:11:15588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.0002674682
0x657f45ab2b56af418bf398d90c47e5584ce8693c809da76623cb178278d1c7afRemove Sell Orde...89205692019-11-12 13:11:15588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.00004177561.2
0x425e5e15974745d7d31162028170b79ccd65671ec94fdf20fdb5dcd3690ca8ccRemove Sell Orde...89205692019-11-12 13:11:15588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.00004177561.2
0xd8502b6f9461d3c954966c909673f452b50a9d7461e4b3b3b53e2d184607df35Remove Sell Orde...89205672019-11-12 13:10:37588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.0000696262
0xda7d26175b91d2d0ddc642808c4941b969103c6128c9d95551a999141095bd15Place Sell Order89205672019-11-12 13:10:37588 days 21 hrs ago0x4eb5c09f266a6681f3a7729cd4587cbb1ae3d41e IN  Etheremon: Trade 20 Ether0.0002674682
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x9138556bd2bd3214d0087caa93a4a0083da530a209beb0f6a520e8afd7c82ae589203802019-11-12 12:16:44588 days 22 hrs ago Etheremon: Trade 20x56539090b5104a7d2d00f7d16c45362a099eef600.1455 Ether
0x34a2c26548ef0705357b90518a56946ed0230c74c02534a538a3dc902b701cb489202712019-11-12 11:48:02588 days 23 hrs ago Etheremon: Trade 20xf96dc3e903baf7e99970094f74138018238318ce0.00873 Ether
0x60692dfbe3a3b0871329808734778b7cf2d1c78b6dbc3b469f9869f0873c487e89166392019-11-11 21:19:23589 days 13 hrs ago Etheremon: Trade 20xf55b92b635bb745f65be9f9e84a5509905298aaf0.97 Ether
0x06ce53997c65d048be357709dbf94558b510025dadb4257a8b0f24774880bcfd89158012019-11-11 18:05:22589 days 16 hrs ago Etheremon: Trade 20xbe07420e269f9a0dda08316b4f703f831c5d49d80.3395 Ether
0x769feae583d72133fe8198b61bd69bddccbf7f34f34640d4b342e28aff704be289037172019-11-09 17:54:32591 days 17 hrs ago Etheremon: Trade 20xa6fe83dcf28cc982818656ba680e03416824d5e40.004365 Ether
0xc5de97dbae8d3ea795d1beb6efe0b41354c3638e69d84618588718f8dc78302a89032512019-11-09 15:58:52591 days 18 hrs ago Etheremon: Trade 20xf3b2eea6ce35d2f80e3e9fccc6f0f3b1e34bc2490.01746 Ether
0x12a9cad5a4f243973d3119eaa7b2502733b6be85ec4da1ed94282449e04829f489032312019-11-09 15:53:08591 days 19 hrs ago Etheremon: Trade 20xf3b2eea6ce35d2f80e3e9fccc6f0f3b1e34bc2490.01164 Ether
0xaba61d0376bdb16981972ccbf7d45f40e63fc00bbe9d58268f5dbb9ca0b924cf89032242019-11-09 15:51:38591 days 19 hrs ago Etheremon: Trade 20xf3b2eea6ce35d2f80e3e9fccc6f0f3b1e34bc2490.01164 Ether
0xc0f2a658d38c530d00abcf6ee743844be08071ba5eda93189392833499cf6b2b89032192019-11-09 15:50:34591 days 19 hrs ago Etheremon: Trade 20xea2259bbedac98bbc9bda01ceacb987886c7bb9f0.0097 Ether
0x685a54df0e2a1ed11791cb0e78a43b029316db36eedc04182ded2715f33dac4589032182019-11-09 15:50:29591 days 19 hrs ago Etheremon: Trade 20xf3b2eea6ce35d2f80e3e9fccc6f0f3b1e34bc2490.0097 Ether
0x66afb974d85e8cf84cad5ab1e47fb486769a286159ca6f807144cbd87f595d3489032182019-11-09 15:50:29591 days 19 hrs ago Etheremon: Trade 20xa0ee5a798c7420ad32b2e4b34dffba07cf1ef3e20.0097 Ether
0xdf7f2b0b27af8ea0527d890930df4bb7621b30e79433aec892865d25801a3fc589032152019-11-09 15:49:49591 days 19 hrs ago Etheremon: Trade 20x36a0d5e712000c44c7ca18937845ff045343fe760.067415 Ether
0x5a0f9c2c682a902cfb349f9ab0a669519c0c81ab32501d91be7e4248479dc53589032152019-11-09 15:49:49591 days 19 hrs ago Etheremon: Trade 20x36a0d5e712000c44c7ca18937845ff045343fe760.067415 Ether
0xb62e77cdbfb7120d89b9a528977c4a9df0c9b710a4f67870bacc2d2a1c974b1a89032032019-11-09 15:47:29591 days 19 hrs ago Etheremon: Trade 20x8c2979e97315bdfb730df681a33f0ee8e4e2c56a0.0291 Ether
0x0b78779ea0a5727519ff17ec8642b46cc10e2cda178fad45a2c4eb2cf54e298489031922019-11-09 15:45:56591 days 19 hrs ago Etheremon: Trade 20xf3b2eea6ce35d2f80e3e9fccc6f0f3b1e34bc2490.02522 Ether
0x09624766e86b097bd8e727ebe29509563542648547a3ff9610c9deb94a9e72cc89031892019-11-09 15:44:58591 days 19 hrs ago Etheremon: Trade 20x8c2979e97315bdfb730df681a33f0ee8e4e2c56a0.02231 Ether
0x81fd458eb83e670a1260620a83544857d7e567bdb509ff285bc1289774e86b0c89031852019-11-09 15:44:16591 days 19 hrs ago Etheremon: Trade 20x2fef65e4d69a38bf0dd074079f367cdf176ec0de0.0194 Ether
0xcfd1f8960578e5fad03b6bec5eddb9833c3bbbc1b5e339d56cd7130ab65c94c489031822019-11-09 15:44:11591 days 19 hrs ago Etheremon: Trade 20x976357a83be2092e65f93cf53426b90f2e2326e30.01843 Ether
0x79b691bf96273689a0b097585ee9710dfecdf17457bbe2d6578231c8f79682fe89031802019-11-09 15:43:44591 days 19 hrs ago Etheremon: Trade 20xf96dc3e903baf7e99970094f74138018238318ce0.01843 Ether
0x4e848692bf9c7f64181df1aeb1f37ccf6aa2096ad1e3456ab738ea5dc831b65889031792019-11-09 15:43:36591 days 19 hrs ago Etheremon: Trade 20xf3b2eea6ce35d2f80e3e9fccc6f0f3b1e34bc2490.0119698 Ether
0x5ad6ea3c3af02d4cff09c6e64af30860a355c36e7be81acad31c7546a216d40e89031632019-11-09 15:39:52591 days 19 hrs ago Etheremon: Trade 20x7e259fdd48c149aca06a48042816a132b44caf2e0.009603 Ether
0x7e2b55b2f637703012fbd534d8d436e23f6c5d87310752f75fbc07d9212e7fed88932792019-11-08 1:07:13593 days 9 hrs ago Etheremon: Trade 20xf3b2eea6ce35d2f80e3e9fccc6f0f3b1e34bc2490.0097 Ether
0xe0a9d673e0c4745e56ec7c5017c2a11dca4b38fe8e3e346dccc2d3f5acb9399b88815442019-11-06 3:38:35595 days 7 hrs ago Etheremon: Trade 20x5d1a571fe06f45bc713fd9bf7dbc8efad66f6f040.000097 Ether
0x588336cfb3af087e3ccc7c1e8e51159f638700b23ce970d876c2b62ac433edde88684432019-11-04 1:03:29597 days 9 hrs ago Etheremon: Trade 20xbe07420e269f9a0dda08316b4f703f831c5d49d80.097 Ether
0x69bfb2e8fb29a1d82bf139b7ff7e261622339134e93cd7aad78b278af18618f088626912019-11-03 3:00:28598 days 7 hrs ago Etheremon: Trade 20xf3b2eea6ce35d2f80e3e9fccc6f0f3b1e34bc2490.01649 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EtheremonTrade

Compiler Version
v0.4.19+commit.c4cbbb05

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-08-29
*/

pragma solidity ^0.4.16;

// copyright [email protected]

contract SafeMath {

    /* function assert(bool assertion) internal { */
    /*   if (!assertion) { */
    /*     throw; */
    /*   } */
    /* }      // assert no longer needed once solidity is on 0.4.10 */

    function safeAdd(uint256 x, uint256 y) pure internal returns(uint256) {
      uint256 z = x + y;
      assert((z >= x) && (z >= y));
      return z;
    }

    function safeSubtract(uint256 x, uint256 y) pure internal returns(uint256) {
      assert(x >= y);
      uint256 z = x - y;
      return z;
    }

    function safeMult(uint256 x, uint256 y) pure internal returns(uint256) {
      uint256 z = x * y;
      assert((x == 0)||(z/x == y));
      return z;
    }

}

contract BasicAccessControl {
    address public owner;
    // address[] public moderators;
    uint16 public totalModerators = 0;
    mapping (address => bool) public moderators;
    bool public isMaintaining = false;

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

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

    modifier onlyModerators() {
        require(msg.sender == owner || moderators[msg.sender] == true);
        _;
    }

    modifier isActive {
        require(!isMaintaining);
        _;
    }

    function ChangeOwner(address _newOwner) onlyOwner public {
        if (_newOwner != address(0)) {
            owner = _newOwner;
        }
    }


    function AddModerator(address _newModerator) onlyOwner public {
        if (moderators[_newModerator] == false) {
            moderators[_newModerator] = true;
            totalModerators += 1;
        }
    }
    
    function RemoveModerator(address _oldModerator) onlyOwner public {
        if (moderators[_oldModerator] == true) {
            moderators[_oldModerator] = false;
            totalModerators -= 1;
        }
    }

    function UpdateMaintaining(bool _isMaintaining) onlyOwner public {
        isMaintaining = _isMaintaining;
    }
}

contract EtheremonEnum {

    enum ResultCode {
        SUCCESS,
        ERROR_CLASS_NOT_FOUND,
        ERROR_LOW_BALANCE,
        ERROR_SEND_FAIL,
        ERROR_NOT_TRAINER,
        ERROR_NOT_ENOUGH_MONEY,
        ERROR_INVALID_AMOUNT,
        ERROR_OBJ_NOT_FOUND,
        ERROR_OBJ_INVALID_OWNERSHIP
    }
    
    enum ArrayType {
        CLASS_TYPE,
        STAT_STEP,
        STAT_START,
        STAT_BASE,
        OBJ_SKILL
    }
}

contract EtheremonDataBase is EtheremonEnum, BasicAccessControl, SafeMath {
    
    uint64 public totalMonster;
    uint32 public totalClass;
    
    // write
    function addElementToArrayType(ArrayType _type, uint64 _id, uint8 _value) onlyModerators public returns(uint);
    function removeElementOfArrayType(ArrayType _type, uint64 _id, uint8 _value) onlyModerators public returns(uint);
    function setMonsterClass(uint32 _classId, uint256 _price, uint256 _returnPrice, bool _catchable) onlyModerators public returns(uint32);
    function addMonsterObj(uint32 _classId, address _trainer, string _name) onlyModerators public returns(uint64);
    function setMonsterObj(uint64 _objId, string _name, uint32 _exp, uint32 _createIndex, uint32 _lastClaimIndex) onlyModerators public;
    function increaseMonsterExp(uint64 _objId, uint32 amount) onlyModerators public;
    function decreaseMonsterExp(uint64 _objId, uint32 amount) onlyModerators public;
    function removeMonsterIdMapping(address _trainer, uint64 _monsterId) onlyModerators public;
    function addMonsterIdMapping(address _trainer, uint64 _monsterId) onlyModerators public;
    function clearMonsterReturnBalance(uint64 _monsterId) onlyModerators public returns(uint256 amount);
    function collectAllReturnBalance(address _trainer) onlyModerators public returns(uint256 amount);
    function transferMonster(address _from, address _to, uint64 _monsterId) onlyModerators public returns(ResultCode);
    function addExtraBalance(address _trainer, uint256 _amount) onlyModerators public returns(uint256);
    function deductExtraBalance(address _trainer, uint256 _amount) onlyModerators public returns(uint256);
    function setExtraBalance(address _trainer, uint256 _amount) onlyModerators public;
    
    // read
    function getSizeArrayType(ArrayType _type, uint64 _id) constant public returns(uint);
    function getElementInArrayType(ArrayType _type, uint64 _id, uint _index) constant public returns(uint8);
    function getMonsterClass(uint32 _classId) constant public returns(uint32 classId, uint256 price, uint256 returnPrice, uint32 total, bool catchable);
    function getMonsterObj(uint64 _objId) constant public returns(uint64 objId, uint32 classId, address trainer, uint32 exp, uint32 createIndex, uint32 lastClaimIndex, uint createTime);
    function getMonsterName(uint64 _objId) constant public returns(string name);
    function getExtraBalance(address _trainer) constant public returns(uint256);
    function getMonsterDexSize(address _trainer) constant public returns(uint);
    function getMonsterObjId(address _trainer, uint index) constant public returns(uint64);
    function getExpectedBalance(address _trainer) constant public returns(uint256);
    function getMonsterReturn(uint64 _objId) constant public returns(uint256 current, uint256 total);
}

interface EtheremonBattleInterface {
    function isOnBattle(uint64 _objId) constant external returns(bool) ;
}

interface EtheremonMonsterNFTInterface {
   function triggerTransferEvent(address _from, address _to, uint _tokenId) external;
   function getMonsterCP(uint64 _monsterId) constant external returns(uint cp);
}

contract EtheremonTradeData is BasicAccessControl {
    struct BorrowItem {
        uint index;
        address owner;
        address borrower;
        uint price;
        bool lent;
        uint releaseTime;
        uint createTime;
    }
    
    struct SellingItem {
        uint index;
        uint price;
        uint createTime;
    }

    mapping(uint => SellingItem) public sellingDict; // monster id => item
    uint[] public sellingList; // monster id
    
    mapping(uint => BorrowItem) public borrowingDict;
    uint[] public borrowingList;

    mapping(address => uint[]) public lendingList;
    
    function removeSellingItem(uint _itemId) onlyModerators external {
        SellingItem storage item = sellingDict[_itemId];
        if (item.index == 0)
            return;
        
        if (item.index <= sellingList.length) {
            // Move an existing element into the vacated key slot.
            sellingDict[sellingList[sellingList.length-1]].index = item.index;
            sellingList[item.index-1] = sellingList[sellingList.length-1];
            sellingList.length -= 1;
            delete sellingDict[_itemId];
        }
    }
    
    function addSellingItem(uint _itemId, uint _price, uint _createTime) onlyModerators external {
        SellingItem storage item = sellingDict[_itemId];
        item.price = _price;
        item.createTime = _createTime;
        
        if (item.index == 0) {
            item.index = ++sellingList.length;
            sellingList[item.index - 1] = _itemId;
        }
    }
    
    function removeBorrowingItem(uint _itemId) onlyModerators external {
        BorrowItem storage item = borrowingDict[_itemId];
        if (item.index == 0)
            return;
        
        if (item.index <= borrowingList.length) {
            // Move an existing element into the vacated key slot.
            borrowingDict[borrowingList[borrowingList.length-1]].index = item.index;
            borrowingList[item.index-1] = borrowingList[borrowingList.length-1];
            borrowingList.length -= 1;
            delete borrowingDict[_itemId];
        }
    }

    function addBorrowingItem(address _owner, uint _itemId, uint _price, address _borrower, bool _lent, uint _releaseTime, uint _createTime) onlyModerators external {
        BorrowItem storage item = borrowingDict[_itemId];
        item.owner = _owner;
        item.borrower = _borrower;
        item.price = _price;
        item.lent = _lent;
        item.releaseTime = _releaseTime;
        item.createTime = _createTime;
        
        if (item.index == 0) {
            item.index = ++borrowingList.length;
            borrowingList[item.index - 1] = _itemId;
        }
    }
    
    function addItemLendingList(address _trainer, uint _objId) onlyModerators external {
        lendingList[_trainer].push(_objId);
    }
    
    function removeItemLendingList(address _trainer, uint _objId) onlyModerators external {
        uint foundIndex = 0;
        uint[] storage objList = lendingList[_trainer];
        for (; foundIndex < objList.length; foundIndex++) {
            if (objList[foundIndex] == _objId) {
                break;
            }
        }
        if (foundIndex < objList.length) {
            objList[foundIndex] = objList[objList.length-1];
            delete objList[objList.length-1];
            objList.length--;
        }
    }

    // read access
    function isOnBorrow(uint _objId) constant external returns(bool) {
        return (borrowingDict[_objId].index > 0);
    }
    
    function isOnSell(uint _objId) constant external returns(bool) {
        return (sellingDict[_objId].index > 0);
    }
    
    function isOnLent(uint _objId) constant external returns(bool) {
        return borrowingDict[_objId].lent;
    }
    
    function getSellPrice(uint _objId) constant external returns(uint) {
        return sellingDict[_objId].price;
    }
    
    function isOnTrade(uint _objId) constant external returns(bool) {
        return ((borrowingDict[_objId].index > 0) || (sellingDict[_objId].index > 0)); 
    }
    
    function getBorrowBasicInfo(uint _objId) constant external returns(address owner, bool lent) {
        BorrowItem storage borrowItem = borrowingDict[_objId];
        return (borrowItem.owner, borrowItem.lent);
    }
    
    function getBorrowInfo(uint _objId) constant external returns(uint index, address owner, address borrower, uint price, bool lent, uint createTime, uint releaseTime) {
        BorrowItem storage borrowItem = borrowingDict[_objId];
        return (borrowItem.index, borrowItem.owner, borrowItem.borrower, borrowItem.price, borrowItem.lent, borrowItem.createTime, borrowItem.releaseTime);
    }
    
    function getSellInfo(uint _objId) constant external returns(uint index, uint price, uint createTime) {
        SellingItem storage item = sellingDict[_objId];
        return (item.index, item.price, item.createTime);
    }
    
    function getTotalSellingItem() constant external returns(uint) {
        return sellingList.length;
    }
    
    function getTotalBorrowingItem() constant external returns(uint) {
        return borrowingList.length;
    }
    
    function getTotalLendingItem(address _trainer) constant external returns(uint) {
        return lendingList[_trainer].length;
    }
    
    function getSellingInfoByIndex(uint _index) constant external returns(uint objId, uint price, uint createTime) {
        objId = sellingList[_index];
        SellingItem storage item = sellingDict[objId];
        price = item.price;
        createTime = item.createTime;
    }
    
    function getBorrowInfoByIndex(uint _index) constant external returns(uint objId, address owner, address borrower, uint price, bool lent, uint createTime, uint releaseTime) {
        objId = borrowingList[_index];
        BorrowItem storage borrowItem = borrowingDict[objId];
        return (objId, borrowItem.owner, borrowItem.borrower, borrowItem.price, borrowItem.lent, borrowItem.createTime, borrowItem.releaseTime);
    }
    
    function getLendingObjId(address _trainer, uint _index) constant external returns(uint) {
        return lendingList[_trainer][_index];
    }
    
    function getLendingInfo(address _trainer, uint _index) constant external returns(uint objId, address owner, address borrower, uint price, bool lent, uint createTime, uint releaseTime) {
        objId = lendingList[_trainer][_index];
        BorrowItem storage borrowItem = borrowingDict[objId];
        return (objId, borrowItem.owner, borrowItem.borrower, borrowItem.price, borrowItem.lent, borrowItem.createTime, borrowItem.releaseTime);
    }
    
    function getTradingInfo(uint _objId) constant external returns(uint sellingPrice, uint lendingPrice, bool lent, uint releaseTime, address owner, address borrower) {
        SellingItem storage item = sellingDict[_objId];
        sellingPrice = item.price;
        BorrowItem storage borrowItem = borrowingDict[_objId];
        lendingPrice = borrowItem.price;
        lent = borrowItem.lent;
        releaseTime = borrowItem.releaseTime;
        owner = borrowItem.owner;
        borrower = borrower;
    }
}

contract EtheremonTrade is EtheremonEnum, BasicAccessControl, SafeMath {
    
    uint8 constant public GEN0_NO = 24;

    struct MonsterClassAcc {
        uint32 classId;
        uint256 price;
        uint256 returnPrice;
        uint32 total;
        bool catchable;
    }

    struct MonsterObjAcc {
        uint64 monsterId;
        uint32 classId;
        address trainer;
        string name;
        uint32 exp;
        uint32 createIndex;
        uint32 lastClaimIndex;
        uint createTime;
    }
    
    // Gen0 has return price & no longer can be caught when this contract is deployed
    struct Gen0Config {
        uint32 classId;
        uint256 originalPrice;
        uint256 returnPrice;
        uint32 total; // total caught (not count those from eggs)
    }
    
    struct BorrowItem {
        uint index;
        address owner;
        address borrower;
        uint price;
        bool lent;
        uint releaseTime;
        uint createTime;
    }
    
    // data contract
    address public dataContract;
    address public battleContract;
    address public tradingMonDataContract;
    address public monsterNFTContract;
    
    mapping(uint32 => Gen0Config) public gen0Config;
    
    // trading fee
    uint16 public tradingFeePercentage = 3;
    
    // event
    event EventPlaceSellOrder(address indexed seller, uint objId, uint price);
    event EventRemoveSellOrder(address indexed seller, uint objId);
    event EventCompleteSellOrder(address indexed seller, address indexed buyer, uint objId, uint price);
    event EventOfferBorrowingItem(address indexed lender, uint objId, uint price, uint releaseTime);
    event EventRemoveOfferBorrowingItem(address indexed lender, uint objId);
    event EventAcceptBorrowItem(address indexed lender, address indexed borrower, uint objId, uint price);
    event EventGetBackItem(address indexed lender, address indexed borrower, uint objId);
    
    // constructor
    function EtheremonTrade(address _dataContract, address _battleContract, address _tradingMonDataContract, address _monsterNFTContract) public {
        dataContract = _dataContract;
        battleContract = _battleContract;
        tradingMonDataContract = _tradingMonDataContract;
        monsterNFTContract = _monsterNFTContract;
    }
    
     // admin & moderators
    function setOriginalPriceGen0() onlyModerators public {
        gen0Config[1] = Gen0Config(1, 0.3 ether, 0.003 ether, 374);
        gen0Config[2] = Gen0Config(2, 0.3 ether, 0.003 ether, 408);
        gen0Config[3] = Gen0Config(3, 0.3 ether, 0.003 ether, 373);
        gen0Config[4] = Gen0Config(4, 0.2 ether, 0.002 ether, 437);
        gen0Config[5] = Gen0Config(5, 0.1 ether, 0.001 ether, 497);
        gen0Config[6] = Gen0Config(6, 0.3 ether, 0.003 ether, 380); 
        gen0Config[7] = Gen0Config(7, 0.2 ether, 0.002 ether, 345);
        gen0Config[8] = Gen0Config(8, 0.1 ether, 0.001 ether, 518); 
        gen0Config[9] = Gen0Config(9, 0.1 ether, 0.001 ether, 447);
        gen0Config[10] = Gen0Config(10, 0.2 ether, 0.002 ether, 380); 
        gen0Config[11] = Gen0Config(11, 0.2 ether, 0.002 ether, 354);
        gen0Config[12] = Gen0Config(12, 0.2 ether, 0.002 ether, 346);
        gen0Config[13] = Gen0Config(13, 0.2 ether, 0.002 ether, 351); 
        gen0Config[14] = Gen0Config(14, 0.2 ether, 0.002 ether, 338);
        gen0Config[15] = Gen0Config(15, 0.2 ether, 0.002 ether, 341);
        gen0Config[16] = Gen0Config(16, 0.35 ether, 0.0035 ether, 384);
        gen0Config[17] = Gen0Config(17, 1 ether, 0.01 ether, 305); 
        gen0Config[18] = Gen0Config(18, 0.1 ether, 0.001 ether, 427);
        gen0Config[19] = Gen0Config(19, 1 ether, 0.01 ether, 304);
        gen0Config[20] = Gen0Config(20, 0.4 ether, 0.05 ether, 82);
        gen0Config[21] = Gen0Config(21, 1, 1, 123);
        gen0Config[22] = Gen0Config(22, 0.2 ether, 0.001 ether, 468);
        gen0Config[23] = Gen0Config(23, 0.5 ether, 0.0025 ether, 302);
        gen0Config[24] = Gen0Config(24, 1 ether, 0.005 ether, 195);
    }
    
    function setContract(address _dataContract, address _battleContract, address _tradingMonDataContract, address _monsterNFTContract) onlyModerators public {
        dataContract = _dataContract;
        battleContract = _battleContract;
        tradingMonDataContract = _tradingMonDataContract;
        monsterNFTContract = _monsterNFTContract;
    }
    
    function updateConfig(uint16 _fee) onlyModerators public {
        tradingFeePercentage = _fee;
    }
    
    function withdrawEther(address _sendTo, uint _amount) onlyModerators public {
        // no user money is kept in this contract, only trasaction fee
        if (_amount > this.balance) {
            revert();
        }
        _sendTo.transfer(_amount);
    }

    function _triggerNFTEvent(address _from, address _to, uint _objId) internal {
        EtheremonMonsterNFTInterface monsterNFT = EtheremonMonsterNFTInterface(monsterNFTContract);
        monsterNFT.triggerTransferEvent(_from, _to, _objId);
    }
    
    // public
    function placeSellOrder(uint _objId, uint _price) isActive external {
        if (_price == 0)
            revert();
        
        // not on borrowing
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        if (monTradeData.isOnBorrow(_objId))
            revert();

        // not on battle 
        EtheremonBattleInterface battle = EtheremonBattleInterface(battleContract);
        if (battle.isOnBattle(uint64(_objId)))
            revert();
        
        // check ownership
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_objId));

        if (obj.trainer != msg.sender) {
            revert();
        }
        
        monTradeData.addSellingItem(_objId, _price, block.timestamp);
        EventPlaceSellOrder(msg.sender, _objId, _price);
    }
    
    function removeSellOrder(uint _objId) isActive external {
        // check ownership
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_objId));

        if (obj.trainer != msg.sender) {
            revert();
        }
        
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        monTradeData.removeSellingItem(_objId);
        
        EventRemoveSellOrder(msg.sender, _objId);
    }
    
    function buyItem(uint _objId) isActive external payable {
        // check item is valid to sell
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        uint requestPrice = monTradeData.getSellPrice(_objId);
        if (requestPrice == 0 || msg.value != requestPrice) {
            revert();
        }

        // check obj
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_objId));
        // can not buy from yourself
        if (obj.monsterId == 0 || obj.trainer == msg.sender) {
            revert();
        }
        
        EtheremonMonsterNFTInterface monsterNFT = EtheremonMonsterNFTInterface(monsterNFTContract);

        uint fee = requestPrice * tradingFeePercentage / 100;
        monTradeData.removeSellingItem(_objId);
        
        // transfer owner
        data.removeMonsterIdMapping(obj.trainer, obj.monsterId);
        data.addMonsterIdMapping(msg.sender, obj.monsterId);
        monsterNFT.triggerTransferEvent(obj.trainer, msg.sender, _objId);
        
        // transfer money
        obj.trainer.transfer(safeSubtract(requestPrice, fee));
        
        EventCompleteSellOrder(obj.trainer, msg.sender, _objId, requestPrice);
    }
    
    function offerBorrowingItem(uint _objId, uint _price, uint _releaseTime) isActive external {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        if (monTradeData.isOnSell(_objId) || monTradeData.isOnLent(_objId)) revert();

         // check ownership
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_objId));

        if (obj.trainer != msg.sender) {
            revert();
        }

        // not on battle 
        EtheremonBattleInterface battle = EtheremonBattleInterface(battleContract);
        if (battle.isOnBattle(obj.monsterId))
            revert();
        
        monTradeData.addBorrowingItem(msg.sender, _objId, _price, address(0), false, _releaseTime, block.timestamp);
        EventOfferBorrowingItem(msg.sender, _objId, _price, _releaseTime);
    }
    
    function removeBorrowingOfferItem(uint _objId) isActive external {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        address owner;
        bool lent;
        (owner, lent) = monTradeData.getBorrowBasicInfo(_objId);
        if (owner != msg.sender || lent == true)
            revert();
        
        monTradeData.removeBorrowingItem(_objId);
        EventRemoveOfferBorrowingItem(msg.sender, _objId);
    }
    
    function borrowItem(uint _objId) isActive external payable {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        BorrowItem memory borrowItem;
        (borrowItem.index, borrowItem.owner, borrowItem.borrower, borrowItem.price, borrowItem.lent, borrowItem.createTime, borrowItem.releaseTime) = monTradeData.getBorrowInfo(_objId);
        if (borrowItem.index == 0 || borrowItem.lent == true) revert();
        if (borrowItem.owner == msg.sender) revert(); // can not borrow from yourself
        if (borrowItem.price != msg.value)
            revert();

        // check obj
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(uint64(_objId));
        if (obj.trainer != borrowItem.owner) {
            revert();
        }
        
        // update borrow data
        monTradeData.addBorrowingItem(borrowItem.owner, _objId, borrowItem.price, msg.sender, true, (borrowItem.releaseTime + block.timestamp), borrowItem.createTime);
        
        data.removeMonsterIdMapping(obj.trainer, obj.monsterId);
        data.addMonsterIdMapping(msg.sender, obj.monsterId);
        _triggerNFTEvent(obj.trainer, msg.sender, _objId);
        
        obj.trainer.transfer(safeSubtract(borrowItem.price, borrowItem.price * tradingFeePercentage / 100));
        monTradeData.addItemLendingList(obj.trainer, _objId);
        EventAcceptBorrowItem(obj.trainer, msg.sender, _objId, borrowItem.price);
    }
    
    function getBackLendingItem(uint64 _objId) isActive external {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        BorrowItem memory borrowItem;
        (borrowItem.index, borrowItem.owner, borrowItem.borrower, borrowItem.price, borrowItem.lent, borrowItem.createTime, borrowItem.releaseTime) = monTradeData.getBorrowInfo(_objId);
        
        if (borrowItem.index == 0)
            revert();
        if (borrowItem.lent == false)
            revert();
        if (borrowItem.releaseTime > block.timestamp)
            revert();
        
        if (msg.sender != borrowItem.owner)
            revert();
        
        monTradeData.removeBorrowingItem(_objId);
        
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        data.removeMonsterIdMapping(borrowItem.borrower, _objId);
        data.addMonsterIdMapping(msg.sender, _objId);
        EtheremonMonsterNFTInterface monsterNFT = EtheremonMonsterNFTInterface(monsterNFTContract);
        monsterNFT.triggerTransferEvent(borrowItem.borrower, msg.sender, _objId);
        
        monTradeData.removeItemLendingList(msg.sender, _objId);
        EventGetBackItem(msg.sender, borrowItem.borrower, _objId);
    }
    
    // read access
    function getObjInfoWithBp(uint64 _objId) constant public returns(address owner, uint32 classId, uint32 exp, uint32 createIndex, uint bp) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, classId, owner, exp, createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(_objId);
        EtheremonMonsterNFTInterface monsterNFT = EtheremonMonsterNFTInterface(monsterNFTContract);
        bp = monsterNFT.getMonsterCP(_objId);
    }
    
    function getTotalSellingMonsters() constant external returns(uint) {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        return monTradeData.getTotalSellingItem();
    }
    
    function getTotalBorrowingMonsters() constant external returns(uint) {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        return monTradeData.getTotalBorrowingItem();
    }

    function getSellingItem(uint _index) constant external returns(uint objId, uint32 classId, uint32 exp, uint bp, address trainer, uint32 createIndex, uint256 price, uint createTime) {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        (objId, price, createTime) = monTradeData.getSellingInfoByIndex(_index);
        if (objId > 0) {
            (trainer, classId, exp, createIndex, bp) = getObjInfoWithBp(uint64(objId));
        }
    }
    
    function getSellingItemByObjId(uint64 _objId) constant external returns(uint32 classId, uint32 exp, uint bp, address trainer, uint32 createIndex, uint256 price, uint createTime) {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        uint index;
        (index, price, createTime) = monTradeData.getSellInfo(_objId);
        if (price > 0) {
            (trainer, classId, exp, createIndex, bp) = getObjInfoWithBp(_objId);
        }
    }

    function getBorrowingItem(uint _index) constant external returns(uint objId, address owner, address borrower, 
        uint256 price, bool lent, uint createTime, uint releaseTime) {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);    
        (objId, owner, borrower, price, lent, createTime, releaseTime) = monTradeData.getBorrowInfoByIndex(_index);
    }
    
    function getBorrowingItemByObjId(uint64 _objId) constant external returns(uint index, address owner, address borrower, 
        uint256 price, bool lent, uint createTime, uint releaseTime) {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);    
        (index, owner, borrower, price, lent, createTime, releaseTime) = monTradeData.getBorrowInfo(_objId);
    }
    
    
    function getLendingItemLength(address _trainer) constant external returns(uint) {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);    
        return monTradeData.getTotalLendingItem(_trainer);
    }
    
    function getLendingItemInfo(address _trainer, uint _index) constant external returns(uint objId, address owner, address borrower, 
        uint256 price, bool lent, uint createTime, uint releaseTime) {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        (objId, owner, borrower, price, lent, createTime, releaseTime) = monTradeData.getLendingInfo(_trainer, _index);
    }
    
    function getTradingInfo(uint _objId) constant external returns(address owner, address borrower, uint256 sellingPrice, uint256 lendingPrice, bool lent, uint releaseTime) {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        (sellingPrice, lendingPrice, lent, releaseTime, owner, borrower) = monTradeData.getTradingInfo(_objId);
    }
    
    function isOnTrading(uint _objId) constant external returns(bool) {
        EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
        return monTradeData.isOnTrade(_objId);
    }
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[{"name":"_objId","type":"uint256"}],"name":"removeSellOrder","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"dataContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"gen0Config","outputs":[{"name":"classId","type":"uint32"},{"name":"originalPrice","type":"uint256"},{"name":"returnPrice","type":"uint256"},{"name":"total","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_objId","type":"uint64"}],"name":"getSellingItemByObjId","outputs":[{"name":"classId","type":"uint32"},{"name":"exp","type":"uint32"},{"name":"bp","type":"uint256"},{"name":"trainer","type":"address"},{"name":"createIndex","type":"uint32"},{"name":"price","type":"uint256"},{"name":"createTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"moderators","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getTotalBorrowingMonsters","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_objId","type":"uint256"},{"name":"_price","type":"uint256"},{"name":"_releaseTime","type":"uint256"}],"name":"offerBorrowingItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_objId","type":"uint256"}],"name":"removeBorrowingOfferItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"monsterNFTContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"battleContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_isMaintaining","type":"bool"}],"name":"UpdateMaintaining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_objId","type":"uint64"}],"name":"getBackLendingItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalModerators","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_objId","type":"uint64"}],"name":"getBorrowingItemByObjId","outputs":[{"name":"index","type":"uint256"},{"name":"owner","type":"address"},{"name":"borrower","type":"address"},{"name":"price","type":"uint256"},{"name":"lent","type":"bool"},{"name":"createTime","type":"uint256"},{"name":"releaseTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_sendTo","type":"address"},{"name":"_amount","type":"uint256"}],"name":"withdrawEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_dataContract","type":"address"},{"name":"_battleContract","type":"address"},{"name":"_tradingMonDataContract","type":"address"},{"name":"_monsterNFTContract","type":"address"}],"name":"setContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"setOriginalPriceGen0","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_objId","type":"uint256"}],"name":"isOnTrading","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newModerator","type":"address"}],"name":"AddModerator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"GEN0_NO","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tradingMonDataContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"getSellingItem","outputs":[{"name":"objId","type":"uint256"},{"name":"classId","type":"uint32"},{"name":"exp","type":"uint32"},{"name":"bp","type":"uint256"},{"name":"trainer","type":"address"},{"name":"createIndex","type":"uint32"},{"name":"price","type":"uint256"},{"name":"createTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getTotalSellingMonsters","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint16"}],"name":"updateConfig","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_objId","type":"uint256"},{"name":"_price","type":"uint256"}],"name":"placeSellOrder","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_trainer","type":"address"},{"name":"_index","type":"uint256"}],"name":"getLendingItemInfo","outputs":[{"name":"objId","type":"uint256"},{"name":"owner","type":"address"},{"name":"borrower","type":"address"},{"name":"price","type":"uint256"},{"name":"lent","type":"bool"},{"name":"createTime","type":"uint256"},{"name":"releaseTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tradingFeePercentage","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_oldModerator","type":"address"}],"name":"RemoveModerator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_trainer","type":"address"}],"name":"getLendingItemLength","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_objId","type":"uint256"}],"name":"getTradingInfo","outputs":[{"name":"owner","type":"address"},{"name":"borrower","type":"address"},{"name":"sellingPrice","type":"uint256"},{"name":"lendingPrice","type":"uint256"},{"name":"lent","type":"bool"},{"name":"releaseTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_objId","type":"uint256"}],"name":"buyItem","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_objId","type":"uint256"}],"name":"borrowItem","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"isMaintaining","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"ChangeOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_objId","type":"uint64"}],"name":"getObjInfoWithBp","outputs":[{"name":"owner","type":"address"},{"name":"classId","type":"uint32"},{"name":"exp","type":"uint32"},{"name":"createIndex","type":"uint32"},{"name":"bp","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"getBorrowingItem","outputs":[{"name":"objId","type":"uint256"},{"name":"owner","type":"address"},{"name":"borrower","type":"address"},{"name":"price","type":"uint256"},{"name":"lent","type":"bool"},{"name":"createTime","type":"uint256"},{"name":"releaseTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_dataContract","type":"address"},{"name":"_battleContract","type":"address"},{"name":"_tradingMonDataContract","type":"address"},{"name":"_monsterNFTContract","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"seller","type":"address"},{"indexed":false,"name":"objId","type":"uint256"},{"indexed":false,"name":"price","type":"uint256"}],"name":"EventPlaceSellOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"seller","type":"address"},{"indexed":false,"name":"objId","type":"uint256"}],"name":"EventRemoveSellOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"seller","type":"address"},{"indexed":true,"name":"buyer","type":"address"},{"indexed":false,"name":"objId","type":"uint256"},{"indexed":false,"name":"price","type":"uint256"}],"name":"EventCompleteSellOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"lender","type":"address"},{"indexed":false,"name":"objId","type":"uint256"},{"indexed":false,"name":"price","type":"uint256"},{"indexed":false,"name":"releaseTime","type":"uint256"}],"name":"EventOfferBorrowingItem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"lender","type":"address"},{"indexed":false,"name":"objId","type":"uint256"}],"name":"EventRemoveOfferBorrowingItem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"lender","type":"address"},{"indexed":true,"name":"borrower","type":"address"},{"indexed":false,"name":"objId","type":"uint256"},{"indexed":false,"name":"price","type":"uint256"}],"name":"EventAcceptBorrowItem","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"lender","type":"address"},{"indexed":true,"name":"borrower","type":"address"},{"indexed":false,"name":"objId","type":"uint256"}],"name":"EventGetBackItem","type":"event"}]

60606040526000805460a060020a61ffff02191690556002805460ff191690556007805461ffff19166003179055341561003857600080fd5b604051608080613c808339810160405280805191906020018051919060200180519190602001805160008054600160a060020a03338116600160a060020a031992831617909255600280549883166101000261010060a860020a031990991698909817909755600380549682169688169690961790955560048054948616948716949094179093555050600580549290911691909216179055613ba0806100e06000396000f3006060604052600436106101b35763ffffffff60e060020a6000350416630559c11481146101b85780630d668818146101d05780630daf4151146101ff5780630e5aaffc1461024c57806314d0f1ba146102bc57806317880b67146102ef57806327e90a7e146103145780632f6dc6b3146103305780633dd287d414610346578063423b1ca31461035957806348ef5aa81461036c5780634eb4fe80146103845780634efb023e146103a45780634f99a96e146103ce578063522f68151461043a578063615dbebb1461045c57806366ba26701461048d578063677f768d146104a05780636c81fd6d146104b657806373d65c00146104d55780637e27133f146104fe5780638426a4521461051157806385ff96a7146105815780638da5cb5b1461059457806398cdf0ca146105a7578063a4406bcd146105c1578063ad4e39f3146105da578063b2356ad4146105fc578063b85d62751461060f578063c73437541461062e578063cc4999ea1461064d578063e7fb74c7146106a7578063ee422f13146106b2578063ee4e4416146106bd578063f2853292146106d0578063f9a3e07d146106ef578063faa5369d14610751575b600080fd5b34156101c357600080fd5b6101ce600435610767565b005b34156101db57600080fd5b6101e3610927565b604051600160a060020a03909116815260200160405180910390f35b341561020a57600080fd5b61021b63ffffffff6004351661093b565b60405163ffffffff948516815260208101939093526040808401929092529092166060820152608001905180910390f35b341561025757600080fd5b61026c67ffffffffffffffff6004351661096a565b60405163ffffffff97881681529587166020870152604080870195909552600160a060020a0390931660608601529416608084015260a083019390935260c082019290925260e001905180910390f35b34156102c757600080fd5b6102db600160a060020a0360043516610a31565b604051901515815260200160405180910390f35b34156102fa57600080fd5b610302610a46565b60405190815260200160405180910390f35b341561031f57600080fd5b6101ce600435602435604435610ab0565b341561033b57600080fd5b6101ce600435610e30565b341561035157600080fd5b6101e3610f8d565b341561036457600080fd5b6101e3610f9c565b341561037757600080fd5b6101ce6004351515610fab565b341561038f57600080fd5b6101ce67ffffffffffffffff60043516610fd9565b34156103af57600080fd5b6103b76113c0565b60405161ffff909116815260200160405180910390f35b34156103d957600080fd5b6103ee67ffffffffffffffff600435166113e2565b604051968752600160a060020a0395861660208801529390941660408087019190915260608601929092521515608085015260a084019290925260c083015260e0909101905180910390f35b341561044557600080fd5b6101ce600160a060020a03600435166024356114b2565b341561046757600080fd5b6101ce600160a060020a0360043581169060243581169060443581169060643516611544565b341561049857600080fd5b6101ce6115fd565b34156104ab57600080fd5b6102db6004356126c7565b34156104c157600080fd5b6101ce600160a060020a036004351661273c565b34156104e057600080fd5b6104e86127e6565b60405160ff909116815260200160405180910390f35b341561050957600080fd5b6101e36127eb565b341561051c57600080fd5b6105276004356127fa565b60405197885263ffffffff96871660208901529486166040808901919091526060880194909452600160a060020a03909216608087015290931660a085015260c084019290925260e0830152610100909101905180910390f35b341561058c57600080fd5b6103026128b8565b341561059f57600080fd5b6101e3612903565b34156105b257600080fd5b6101ce61ffff60043516612912565b34156105cc57600080fd5b6101ce600435602435612970565b34156105e557600080fd5b6103ee600160a060020a0360043516602435612c4b565b341561060757600080fd5b6103b7612d21565b341561061a57600080fd5b6101ce600160a060020a0360043516612d2b565b341561063957600080fd5b610302600160a060020a0360043516612dd5565b341561065857600080fd5b610663600435612e31565b604051600160a060020a03968716815294909516602085015260408085019390935260608401919091521515608083015260a082019290925260c001905180910390f35b6101ce600435612edd565b6101ce600435613318565b34156106c857600080fd5b6102db613826565b34156106db57600080fd5b6101ce600160a060020a036004351661382f565b34156106fa57600080fd5b61070f67ffffffffffffffff60043516613886565b604051600160a060020a03909516855263ffffffff938416602086015291831660408086019190915292166060840152608083015260a0909101905180910390f35b341561075c57600080fd5b6103ee6004356139e8565b6000610771613ada565b60025460009060ff161561078457600080fd5b6002546101009004600160a060020a0316925082630720246085600060405160e0015260405160e060020a63ffffffff841602815267ffffffffffffffff909116600482015260240160e060405180830381600087803b15156107e657600080fd5b6102c65a03f115156107f757600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160e08a01525063ffffffff90811660c089015290811660a08801529081166080870152600160a060020a03918216604087019081529216602086015267ffffffffffffffff9092168452339091169051600160a060020a03161461088657600080fd5b50600454600160a060020a03168063067002ce8560405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156108d057600080fd5b6102c65a03f115156108e157600080fd5b50505033600160a060020a03167f5e3b2818238e34ce5e09ea1caf84df69e3121cf9d3e6d3ccb44afa165dcf7c238560405190815260200160405180910390a250505050565b6002546101009004600160a060020a031681565b600660205260009081526040902080546001820154600283015460039093015463ffffffff9283169391921684565b600454600090819081908190819081908190600160a060020a0316818163e9bc63f78b836040516060015260405160e060020a63ffffffff841602815267ffffffffffffffff9091166004820152602401606060405180830381600087803b15156109d457600080fd5b6102c65a03f115156109e557600080fd5b5050506040518051906020018051906020018051919650909450909150506000841115610a2457610a158a613886565b929c50909a5090985090965094505b5050919395979092949650565b60016020526000908152604090205460ff1681565b600454600090600160a060020a0316806220338583604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610a9057600080fd5b6102c65a03f11515610aa157600080fd5b50505060405180519250505090565b600080610abb613ada565b60025460009060ff1615610ace57600080fd5b600454600160a060020a031693508363542c8f378860006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610b2257600080fd5b6102c65a03f11515610b3357600080fd5b5050506040518051905080610bae575083600160a060020a0316633a060bc98860006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610b9257600080fd5b6102c65a03f11515610ba357600080fd5b505050604051805190505b15610bb857600080fd5b6002546101009004600160a060020a0316925082630720246088600060405160e0015260405160e060020a63ffffffff841602815267ffffffffffffffff909116600482015260240160e060405180830381600087803b1515610c1a57600080fd5b6102c65a03f11515610c2b57600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160e08a01525063ffffffff90811660c089015290811660a08801529081166080870152600160a060020a03918216604087019081529216602086015267ffffffffffffffff9092168452339091169051600160a060020a031614610cba57600080fd5b50600354600160a060020a0316806335f097f3835160006040516020015260405160e060020a63ffffffff841602815267ffffffffffffffff9091166004820152602401602060405180830381600087803b1515610d1757600080fd5b6102c65a03f11515610d2857600080fd5b5050506040518051905015610d3c57600080fd5b83600160a060020a031663a18e0ce43389896000808b4260405160e060020a63ffffffff8a16028152600160a060020a03978816600482015260248101969096526044860194909452919094166064840152921515608483015260a482019290925260c481019190915260e401600060405180830381600087803b1515610dc257600080fd5b6102c65a03f11515610dd357600080fd5b50505033600160a060020a03167fb663c085fbea38e62b747399d2382848a59381222e56339f222b5ef6c10a489588888860405180848152602001838152602001828152602001935050505060405180910390a250505050505050565b6002546000908190819060ff1615610e4757600080fd5b600454600160a060020a031692508263e40906ed8560006040516040015260405160e060020a63ffffffff841602815260048101919091526024016040805180830381600087803b1515610e9a57600080fd5b6102c65a03f11515610eab57600080fd5b50505060405180519060200180519050809250819350505033600160a060020a031682600160a060020a0316141580610ee657506001811515145b15610ef057600080fd5b82600160a060020a03166329da3b4d8560405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610f3657600080fd5b6102c65a03f11515610f4757600080fd5b50505033600160a060020a03167f7fdce2a001e343c4e897863ce0647872b5ff9d179c3d7aa9e6a28a94eb7c0e158560405190815260200160405180910390a250505050565b600554600160a060020a031681565b600354600160a060020a031681565b60005433600160a060020a03908116911614610fc657600080fd5b6002805460ff1916911515919091179055565b6000610fe3613b26565b600254600090819060ff1615610ff857600080fd5b600454600160a060020a0316935083630e13736886600060405160e0015260405160e060020a63ffffffff841602815267ffffffffffffffff909116600482015260240160e060405180830381600087803b151561105557600080fd5b6102c65a03f1151561106657600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160a08b01525060c0890152151560808801526060870152600160a060020a0390811660408701521660208501528352825115156110ce57600080fd5b826080015115156110de57600080fd5b428360a0015111156110ef57600080fd5b8260200151600160a060020a031633600160a060020a031614151561111357600080fd5b83600160a060020a03166329da3b4d8660405160e060020a63ffffffff841602815267ffffffffffffffff9091166004820152602401600060405180830381600087803b151561116257600080fd5b6102c65a03f1151561117357600080fd5b50506002546101009004600160a060020a031692508290506360c6ccb260408501518760405160e060020a63ffffffff8516028152600160a060020a03909216600483015267ffffffffffffffff166024820152604401600060405180830381600087803b15156111e357600080fd5b6102c65a03f115156111f457600080fd5b50505081600160a060020a0316639248019e338760405160e060020a63ffffffff8516028152600160a060020a03909216600483015267ffffffffffffffff166024820152604401600060405180830381600087803b151561125557600080fd5b6102c65a03f1151561126657600080fd5b5050600554600160a060020a0316915081905063c463b0086040850151338860405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015267ffffffffffffffff9091166044820152606401600060405180830381600087803b15156112dd57600080fd5b6102c65a03f115156112ee57600080fd5b50505083600160a060020a031663770c6bde338760405160e060020a63ffffffff8516028152600160a060020a03909216600483015267ffffffffffffffff166024820152604401600060405180830381600087803b151561134f57600080fd5b6102c65a03f1151561136057600080fd5b5050508260400151600160a060020a031633600160a060020a03167f5ac3d58a9aee148e0e65022b260237441447fdc7ebae1524effd9065721a15888760405167ffffffffffffffff909116815260200160405180910390a35050505050565b60005474010000000000000000000000000000000000000000900461ffff1681565b600454600090819081908190819081908190600160a060020a031680630e1373688a8460405160e0015260405160e060020a63ffffffff841602815267ffffffffffffffff909116600482015260240160e060405180830381600087803b151561144b57600080fd5b6102c65a03f1151561145c57600080fd5b50505060405180519060200180519060200180519060200180519060200180519060200180519060200180519050809850819950829a50839b50849c50859d50869e505050505050505050919395979092949650565b60005433600160a060020a03908116911614806114ed5750600160a060020a03331660009081526001602081905260409091205460ff161515145b15156114f857600080fd5b30600160a060020a03163181111561150f57600080fd5b600160a060020a03821681156108fc0282604051600060405180830381858888f19350505050151561154057600080fd5b5050565b60005433600160a060020a039081169116148061157f5750600160a060020a03331660009081526001602081905260409091205460ff161515145b151561158a57600080fd5b60028054600160a060020a039586166101000274ffffffffffffffffffffffffffffffffffffffff00199091161790556003805493851673ffffffffffffffffffffffffffffffffffffffff19948516179055600480549285169284169290921790915560058054919093169116179055565b60005433600160a060020a03908116911614806116385750600160a060020a03331660009081526001602081905260409091205460ff161515145b151561164357600080fd5b608060405190810160409081526001808352670429d069189e0000602080850191909152660aa87bee538000928401929092526101766060840152600052600690527f3e5fec24aa4dc4e5aee2e025e51e1392c72a2500577559fae9665c6d52bd6a318151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff90921691909117905550608060405190810160409081526002808352670429d069189e0000602080850191909152660aa87bee538000928401929092526101986060840152600052600690527f8819ef417987f8ae7a81f42cdfb18815282fe989326fbff903d13cf0e03ace298151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff90921691909117905550608060405190810160409081526003808352670429d069189e0000602080850191909152660aa87bee538000928401929092526101756060840152600052600690527f75f96ab15d697e93042dc45b5c896c4b27e89bb6eaf39475c5c371cb2513f7d28151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff909216919091179055506080604051908101604090815260048083526702c68af0bb14000060208085019190915266071afd498d0000928401929092526101b56060840152600052600690527fc5069e24aaadb2addc3e52e868fcf3f4f8acf5a87e24300992fd4540c2a87eed8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152600580835267016345785d8a000060208085019190915266038d7ea4c68000928401929092526101f16060840152600052600690527fbfd358e93f18da3ed276c3afdbdba00b8f0b6008a03476a6a86bd6320ee6938b8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff90921691909117905550608060405190810160409081526006808352670429d069189e0000602080850191909152660aa87bee5380009284019290925261017c6060840152600081905290527f697b2bd7bb2984c4e0dc14c79c987d37818484a62958b9c45a0e8b962f20650f8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff909216919091179055506080604051908101604090815260078083526702c68af0bb14000060208085019190915266071afd498d0000928401929092526101596060840152600052600690527f4ced6d0d36392b04cc5d8761b1327b3bbba6e1089c77f60a9a9ca18e05e4f00e8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152600880835267016345785d8a000060208085019190915266038d7ea4c68000928401929092526102066060840152600052600690527fb8d683c9d414f481826f3e7fe14b3ac6ae8c73450778287390c4bb8cb9f2e80b8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152600980835267016345785d8a000060208085019190915266038d7ea4c68000928401929092526101bf6060840152600052600690527fca4d0c6c94a9477136dd41a99cc19ecbe441c8f6609efe7c6fa65be007a473238151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152600a8083526702c68af0bb14000060208085019190915266071afd498d00009284019290925261017c6060840152600052600690527f4da38fc8e544afc56a4c2a17752b8ddb67d8e23ac4583c9029d2e2d1dbe6c9888151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152600b8083526702c68af0bb14000060208085019190915266071afd498d0000928401929092526101626060840152600052600690527f85291c2e7881182c13e19eca9b58927ebfdc2c5d04882018eeb33d8241d357118151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152600c8083526702c68af0bb14000060208085019190915266071afd498d00009284019290925261015a6060840152600052600690527f0b94fa1b86997cc1f1148bfbe25b674e8cefc7cc6f976aa8d7c7966bd4cca3478151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152600d8083526702c68af0bb14000060208085019190915266071afd498d00009284019290925261015f6060840152600052600690527f248457bacb20e239ae314d8db91c0f270e453c28ee138c84f97aea6cfcf9a4998151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152600e8083526702c68af0bb14000060208085019190915266071afd498d0000928401929092526101526060840152600052600690527faca6cdb4b5fe0ec50731a73f714dd191dc1911bfeb3f9eeb9e94ed0f6065ef8d8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152600f8083526702c68af0bb14000060208085019190915266071afd498d0000928401929092526101556060840152600052600690527ff130046d53bc87538ab17e4752ba5f5082985eecc06ccb932c5a55e8242dd5028151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff909216919091179055506080604051908101604090815260108083526704db732547630000602080850191909152660c6f3b40b6c000928401929092526101806060840152600052600690527f6fac4587033fa036e2426ad0134940d3a683633cc2b2b7862f39195344f163d18151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff90921691909117905550608060405190810160409081526011808352670de0b6b3a7640000602080850191909152662386f26fc10000928401929092526101316060840152600052600690527f84a4048ee77615560f9afb39551a46e123dd0dd6c928af241dc565271d0325698151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152601280835267016345785d8a000060208085019190915266038d7ea4c68000928401929092526101ab6060840152600052600690527fee4750d043edce57577a49a1f0c4b389e3b8c38c27dc693bc6b7154c072807718151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff90921691909117905550608060405190810160409081526013808352670de0b6b3a7640000602080850191909152662386f26fc10000928401929092526101306060840152600052600690527fb72a5233413dd9985e70abb239a7ba917e489fbf2ece87f523c6e26971cc821f8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff9092169190911790555060806040519081016040908152601480835267058d15e17628000060208085019190915266b1a2bc2ec500009284019290925260526060840152600052600690527f098d468efb4f874d617491296c759dc9ae46efb517fe36bcf30699ad3f714c0f8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff909216919091179055506080604051908101604090815260158083526001602080850182905292840152607b6060840152600052600690527feda6feebfb4ffb7de2d0dc45a13b92dc953c2ed6ee96fa7fe8179e7c4266747f8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff909216919091179055506080604051908101604090815260168083526702c68af0bb14000060208085019190915266038d7ea4c68000928401929092526101d46060840152600052600690527f7d35cc2b0520994422695eb24e3bf4f74e9cba2704cae72ecd9ec54409a56afb8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff909216919091179055506080604051908101604090815260178083526706f05b59d3b200006020808501919091526608e1bc9bf040009284019290925261012e6060840152600052600690527f84f72166cd6dc886f96a4867c4575af2a636c629c04227c9418bfffa7a09a9ed8151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff90921691909117905550608060405190810160409081526018808352670de0b6b3a76400006020808501919091526611c37937e080009284019290925260c36060840152600052600690527f7ca528807b45d0675df0059116d2304ca9c7f495d9ab623cd80c79f11948b8568151815463ffffffff191663ffffffff9190911617815560208201518160010155604082015181600201556060820151600391909101805463ffffffff191663ffffffff90921691909117905550565b600454600090600160a060020a03168063ff510ad884846040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561271b57600080fd5b6102c65a03f1151561272c57600080fd5b5050506040518051949350505050565b60005433600160a060020a0390811691161461275757600080fd5b600160a060020a03811660009081526001602052604090205460ff1615156127e357600160a060020a03811660009081526001602081905260408220805460ff191682179055815461ffff7401000000000000000000000000000000000000000080830482169093011690910275ffff0000000000000000000000000000000000000000199091161790555b50565b601881565b600454600160a060020a031681565b6004546000908190819081908190819081908190600160a060020a03168063488f1e438b846040516060015260405160e060020a63ffffffff84160281526004810191909152602401606060405180830381600087803b151561285c57600080fd5b6102c65a03f1151561286d57600080fd5b5050506040518051906020018051906020018051929b509094509092505060008911156128ac5761289d89613886565b929b5090995090975090955093505b50919395975091939597565b600454600090600160a060020a03168063654470fc83604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610a9057600080fd5b600054600160a060020a031681565b60005433600160a060020a039081169116148061294d5750600160a060020a03331660009081526001602081905260409091205460ff161515145b151561295857600080fd5b6007805461ffff191661ffff92909216919091179055565b600080600061297d613ada565b60025460ff161561298d57600080fd5b84151561299957600080fd5b600454600160a060020a0316935083639cbb165e8760006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156129ed57600080fd5b6102c65a03f115156129fe57600080fd5b5050506040518051905015612a1257600080fd5b600354600160a060020a03169250826335f097f38760006040516020015260405160e060020a63ffffffff841602815267ffffffffffffffff9091166004820152602401602060405180830381600087803b1515612a6f57600080fd5b6102c65a03f11515612a8057600080fd5b5050506040518051905015612a9457600080fd5b6002546101009004600160a060020a0316915081630720246087600060405160e0015260405160e060020a63ffffffff841602815267ffffffffffffffff909116600482015260240160e060405180830381600087803b1515612af657600080fd5b6102c65a03f11515612b0757600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160e08901525063ffffffff90811660c088015290811660a08701529081166080860152600160a060020a03918216604086019081529216602085015267ffffffffffffffff9092168352339091169051600160a060020a031614612b9657600080fd5b83600160a060020a031663f797ac0e87874260405160e060020a63ffffffff8616028152600481019390935260248301919091526044820152606401600060405180830381600087803b1515612beb57600080fd5b6102c65a03f11515612bfc57600080fd5b50505033600160a060020a03167f0a89884fbe620f3f10c082b012f4e476204fa9fefe182904fd4f20dd110643f1878760405191825260208201526040908101905180910390a2505050505050565b600454600090819081908190819081908190600160a060020a031680634afd8a198b8b8560405160e0015260405160e060020a63ffffffff8516028152600160a060020a039092166004830152602482015260440160e060405180830381600087803b1515612cb957600080fd5b6102c65a03f11515612cca57600080fd5b50505060405180519060200180519060200180519060200180519060200180519060200180519060200180519050809850819950829a50839b50849c50859d50869e50505050505050505092959891949750929550565b60075461ffff1681565b60005433600160a060020a03908116911614612d4657600080fd5b600160a060020a03811660009081526001602081905260409091205460ff16151514156127e357600160a060020a03166000908152600160205260408120805460ff19169055805475ffff0000000000000000000000000000000000000000198116740100000000000000000000000000000000000000009182900461ffff9081166000190116909102179055565b600454600090600160a060020a031680631008a2a584846040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561271b57600080fd5b60045460009081908190819081908190600160a060020a03168063cc4999ea898460405160c0015260405160e060020a63ffffffff8416028152600481019190915260240160c060405180830381600087803b1515612e8f57600080fd5b6102c65a03f11515612ea057600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051919e919d50949b5092995090975095509350505050565b6000806000612eea613ada565b600254600090819060ff1615612eff57600080fd5b600454600160a060020a031695508563ba730e538860006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515612f5357600080fd5b6102c65a03f11515612f6457600080fd5b5050506040518051955050841580612f7c5750843414155b15612f8657600080fd5b6002546101009004600160a060020a0316935083630720246088600060405160e0015260405160e060020a63ffffffff841602815267ffffffffffffffff909116600482015260240160e060405180830381600087803b1515612fe857600080fd5b6102c65a03f11515612ff957600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160e08b01525063ffffffff90811660c08a015290811660a08901529081166080880152600160a060020a03909116604087015216602085015267ffffffffffffffff168352825167ffffffffffffffff161580613097575033600160a060020a03168360400151600160a060020a0316145b156130a157600080fd5b600554600754600160a060020a03909116925060649061ffff16860204905085600160a060020a031663067002ce8860405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561310657600080fd5b6102c65a03f1151561311757600080fd5b50505083600160a060020a03166360c6ccb28460400151855160405160e060020a63ffffffff8516028152600160a060020a03909216600483015267ffffffffffffffff166024820152604401600060405180830381600087803b151561317d57600080fd5b6102c65a03f1151561318e57600080fd5b505050600160a060020a038416639248019e33855160405160e060020a63ffffffff8516028152600160a060020a03909216600483015267ffffffffffffffff166024820152604401600060405180830381600087803b15156131f057600080fd5b6102c65a03f1151561320157600080fd5b50505081600160a060020a031663c463b0088460400151338a60405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561326957600080fd5b6102c65a03f1151561327a57600080fd5b5050508260400151600160a060020a03166108fc6132988784613a48565b9081150290604051600060405180830381858888f1935050505015156132bd57600080fd5b33600160a060020a03168360400151600160a060020a03167f690b390bfec452b9fc546ccbb1fb061fdf10737cccfdfc3dde842773b44b7813898860405191825260208201526040908101905180910390a350505050505050565b6000613322613b26565b600061332c613ada565b60025460ff161561333c57600080fd5b600454600160a060020a0316935083630e13736886600060405160e0015260405160e060020a63ffffffff8416028152600481019190915260240160e060405180830381600087803b151561339057600080fd5b6102c65a03f115156133a157600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160a08b01525060c0890152151560808801526060870152600160a060020a0390811660408701521660208501528352825115806134105750826080015115156001145b1561341a57600080fd5b33600160a060020a03168360200151600160a060020a0316141561343d57600080fd5b3483606001511461344d57600080fd5b6002546101009004600160a060020a0316915081630720246086600060405160e0015260405160e060020a63ffffffff841602815267ffffffffffffffff909116600482015260240160e060405180830381600087803b15156134af57600080fd5b6102c65a03f115156134c057600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160e08901525063ffffffff90811660c088015290811660a08701529081166080860152600160a060020a0390911660408501521660208084019190915267ffffffffffffffff9091168252830151600160a060020a03168160400151600160a060020a03161461355b57600080fd5b83600160a060020a031663a18e0ce48460200151878660600151336001428a60a00151018a60c0015160405160e060020a63ffffffff8a16028152600160a060020a03978816600482015260248101969096526044860194909452919094166064840152921515608483015260a482019290925260c481019190915260e401600060405180830381600087803b15156135f357600080fd5b6102c65a03f1151561360457600080fd5b50505081600160a060020a03166360c6ccb28260400151835160405160e060020a63ffffffff8516028152600160a060020a03909216600483015267ffffffffffffffff166024820152604401600060405180830381600087803b151561366a57600080fd5b6102c65a03f1151561367b57600080fd5b505050600160a060020a038216639248019e33835160405160e060020a63ffffffff8516028152600160a060020a03909216600483015267ffffffffffffffff166024820152604401600060405180830381600087803b15156136dd57600080fd5b6102c65a03f115156136ee57600080fd5b50505061370081604001513387613a5c565b8060400151600160a060020a03166108fc613738856060015160075460649061ffff1660608901510281151561373257fe5b04613a48565b9081150290604051600060405180830381858888f19350505050151561375d57600080fd5b83600160a060020a0316635004817482604001518760405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156137b557600080fd5b6102c65a03f115156137c657600080fd5b50505033600160a060020a03168160400151600160a060020a03167f07231bc4467c1477cfded7197882f724714d8a598b8481746571e18f792cd22387866060015160405191825260208201526040908101905180910390a35050505050565b60025460ff1681565b60005433600160a060020a0390811691161461384a57600080fd5b600160a060020a038116156127e35760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600080600080600080613897613ada565b6002546101009004600160a060020a0316915060008263072024608a8360405160e0015260405160e060020a63ffffffff841602815267ffffffffffffffff909116600482015260240160e060405180830381600087803b15156138fa57600080fd5b6102c65a03f1151561390b57600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160e08a01525063ffffffff1660c088015267ffffffffffffffff9094168652600554919b50919950909750909550600160a060020a0316905080630672859b8a60006040516020015260405160e060020a63ffffffff841602815267ffffffffffffffff9091166004820152602401602060405180830381600087803b15156139bf57600080fd5b6102c65a03f115156139d057600080fd5b50505060405180519050935050505091939590929450565b600454600090819081908190819081908190600160a060020a031680639e5b241a8a8460405160e0015260405160e060020a63ffffffff8416028152600481019190915260240160e060405180830381600087803b151561144b57600080fd5b60008082841015613a5557fe5b5050900390565b600554600160a060020a03168063c463b00885858560405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b1515613ac057600080fd5b6102c65a03f11515613ad157600080fd5b50505050505050565b61010060405190810160409081526000808352602083018190529082015260608101613b04613b62565b8152600060208201819052604082018190526060820181905260809091015290565b60e06040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c082015290565b602060405190810160405260008152905600a165627a7a7230582095eddb17385cb44c4242e63f996e414bec1eedfcefba0863e82049b07de2fe010029000000000000000000000000abc1c404424bdf24c19a5cc5ef8f47781d18eb3e000000000000000000000000022c635044ba01ced1e098bc32e62a954147f2de0000000000000000000000009a376e31f1947c468ca904b4307c8970667e0ec20000000000000000000000005d00d312e171be5342067c09bae883f9bcb2003b

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000abc1c404424bdf24c19a5cc5ef8f47781d18eb3e000000000000000000000000022c635044ba01ced1e098bc32e62a954147f2de0000000000000000000000009a376e31f1947c468ca904b4307c8970667e0ec20000000000000000000000005d00d312e171be5342067c09bae883f9bcb2003b

-----Decoded View---------------
Arg [0] : _dataContract (address): 0xabc1c404424bdf24c19a5cc5ef8f47781d18eb3e
Arg [1] : _battleContract (address): 0x022c635044ba01ced1e098bc32e62a954147f2de
Arg [2] : _tradingMonDataContract (address): 0x9a376e31f1947c468ca904b4307c8970667e0ec2
Arg [3] : _monsterNFTContract (address): 0x5d00d312e171be5342067c09bae883f9bcb2003b

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000abc1c404424bdf24c19a5cc5ef8f47781d18eb3e
Arg [1] : 000000000000000000000000022c635044ba01ced1e098bc32e62a954147f2de
Arg [2] : 0000000000000000000000009a376e31f1947c468ca904b4307c8970667e0ec2
Arg [3] : 0000000000000000000000005d00d312e171be5342067c09bae883f9bcb2003b


Swarm Source

bzzr://95eddb17385cb44c4242e63f996e414bec1eedfcefba0863e82049b07de2fe01
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.