Contract 0x0c28bf52d0d4D9447e86d7E7F0e317F273D3C9a3

 
Ad
Ad
Txn Hash Method
Block
From
To
Value
0x5b2f0a1fde3954a36889312554f096bd6af215a5fe543f6ec434f70cba0987bbAttack Castle50733312018-02-11 22:18:291317 days 10 hrs ago0x2ed980f49087e762566627f946b364d357a5de7c IN  Etheremon: Battle 10 Ether0.00104894441
0x05ce42405c3887cb1abd8d8a6c5b9988884ef9c121215d8309ef3f261feb5d27Attack Castle50733242018-02-11 22:14:501317 days 10 hrs ago0x2ed980f49087e762566627f946b364d357a5de7c IN  Etheremon: Battle 10 Ether0.00104894441
0x28a76f2787b4ef7ae382a046fb498ba452c5201e81f4438f6983511ec50583a2Attack Castle50505402018-02-08 2:40:531321 days 6 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x75961b3b694ffb95db274acfbc4e9f751baddc058802758aca1b604c5471695fAttack Castle50505142018-02-08 2:34:531321 days 6 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0xe301a3f212f276a0386a3056e4f49f4ef5b26fe7969645339d6948bffb6bd709Attack Castle50504962018-02-08 2:30:201321 days 6 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x4b40d36f056402cb854cdc3f2c887e7a9865979ee223aa2000753a4bb4c15cc2Attack Castle50504512018-02-08 2:20:081321 days 6 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x475cf1536238715ae6b2e2aa2b17cbfba0e03bbc38e8faac625d1c58bf55e281Attack Castle50504502018-02-08 2:19:581321 days 6 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x761d091de9ddd70716c4b69ea6eede75cdb7c9b0e3c3840326373efc14d26c5dAttack Castle50504092018-02-08 2:08:371321 days 6 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x61d73afdf356e25870d211da7742da6671263bc76925fdca8c821dc55ed1ecdbAttack Castle50504012018-02-08 2:05:591321 days 6 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0xaf19d4042a06ad3a0fea2c00076c7a403b16fdc4a92412781120f83abddf69f9Attack Castle50503982018-02-08 2:05:221321 days 6 hrs ago0x95567c6502625ae5a8f4027aff27221a39c5feab IN  Etheremon: Battle 10 Ether0.0000129840.5
0x5267400ec9018220747a2f726b2a3b43f4144a0093a6a4b8ac849682e6711812Attack Castle50503702018-02-08 1:59:081321 days 6 hrs ago0x95567c6502625ae5a8f4027aff27221a39c5feab IN  Etheremon: Battle 10 Ether0.0000129840.5
0x5ee66a811227bc930b2acf532f5c1478d5c47ad14c1cecb2888f2e007c4a4977Attack Castle50503622018-02-08 1:57:181321 days 6 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x483c5f1c7c621cb08c0db4e5fceda202217d8bf8645ca9be0848a87409a09965Attack Castle50503552018-02-08 1:56:171321 days 6 hrs ago0x95567c6502625ae5a8f4027aff27221a39c5feab IN  Etheremon: Battle 10 Ether0.0000129840.5
0xe32cf6ea57159ad56594e748a71afe365425658f2cf93d7d42adfc1670ee666cAttack Castle50503102018-02-08 1:44:201321 days 7 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0xa5a5e0056a359553b6d935b59e0511a4f4afce73e9a92eda9a55ab4079c81efdAttack Castle50503062018-02-08 1:43:421321 days 7 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x0b38736e23ac1c58512368867bd3da257226f4247cbcd440a8f2015311175be1Attack Castle50502922018-02-08 1:40:591321 days 7 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x94e5bcf247ce333cfcebb90f02bc9f66601038aadd52760f0e410bdc8ec61505Attack Castle50502422018-02-08 1:27:071321 days 7 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x88b4c5accc9559e10ede550d21daf8d2cbf83bd97159e25b3f9df3a47a2cd201Attack Castle50502132018-02-08 1:19:461321 days 7 hrs ago0x95567c6502625ae5a8f4027aff27221a39c5feab IN  Etheremon: Battle 10 Ether0.00000259680.1
0xe8a3ddf762243e311b1c697798c4170ea0baa784f3b1f20f1e9aea6f9d93e940Attack Castle50502132018-02-08 1:19:461321 days 7 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x2e4c140e40167e6dbb78d867d0180016fc2f22b8bd64e938ca1454d7d5cd253dAttack Castle50502102018-02-08 1:19:301321 days 7 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0x12fec9f58e0e424a8b8032d2afd77b0a49e5e1f4496c08eefc5a199bf01547d9Attack Castle50501932018-02-08 1:15:241321 days 7 hrs ago0x95567c6502625ae5a8f4027aff27221a39c5feab IN  Etheremon: Battle 10 Ether0.00000259680.1
0xc5f30ea95b6f5af508f860a63494f5de9d4193b7d1f1f9097e491752c78ba68fAttack Castle50501692018-02-08 1:10:441321 days 7 hrs ago0x95567c6502625ae5a8f4027aff27221a39c5feab IN  Etheremon: Battle 10 Ether0.00000259680.1
0xc927c959b957e07026a61d1a176555b08ce7b38e300e3122e9650450a69026b4Attack Castle50501692018-02-08 1:10:441321 days 7 hrs ago0xb169ea10fdbdeb3f9c8cbbcc996fc28ddac7f6e1 IN  Etheremon: Battle 10 Ether0.00000255840.1
0xb913dd68b58ad95e47d32d3e8fe29c5300989e57d62dc32218d1b18aad003a6fAttack Castle50501112018-02-08 0:58:231321 days 7 hrs ago0x95567c6502625ae5a8f4027aff27221a39c5feab IN  Etheremon: Battle 10 Ether0.00000389520.15
0xc1348400c2246626685c52e55e64d7670d856c7547b919cb2bc9460fbe38573cAttack Castle50501082018-02-08 0:57:141321 days 7 hrs ago0x95567c6502625ae5a8f4027aff27221a39c5feab IN  Etheremon: Battle 10 Ether0.00000519360.2
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x8c547b5a091c99cada542fc51f03b48f6e7740944f13bac00b09afafd209bab550481032018-02-07 16:48:271321 days 16 hrs ago Etheremon: Battle 10xd3b6d520906bb14c0eab0faf7a8b13fe31f8cbda11.48 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EtheremonBattle

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-01-27
*/

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 = true;

    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
    }

    enum PropertyType {
        ANCESTOR,
        XFACTOR
    }
    
    enum BattleResult {
        CASTLE_WIN,
        CASTLE_LOSE,
        CASTLE_DESTROYED
    }
    
    enum CacheClassInfoType {
        CLASS_TYPE,
        CLASS_STEP,
        CLASS_ANCESTOR
    }
}

contract EtheremonDataBase is EtheremonEnum, BasicAccessControl, SafeMath {
    
    uint64 public totalMonster;
    uint32 public totalClass;
    
    // 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 EtheremonTradeInterface {
    function isOnTrading(uint64 _objId) constant external returns(bool);
}

interface EtheremonPaymentInterface {
    function giveBattleBonus(address _trainer, uint _amount) public; 
}

contract EtheremonGateway is EtheremonEnum, BasicAccessControl {
    // using for battle contract later
    function increaseMonsterExp(uint64 _objId, uint32 amount) onlyModerators public;
    function decreaseMonsterExp(uint64 _objId, uint32 amount) onlyModerators public;
    
    // read 
    function isGason(uint64 _objId) constant external returns(bool);
    function getObjBattleInfo(uint64 _objId) constant external returns(uint32 classId, uint32 exp, bool isGason, 
        uint ancestorLength, uint xfactorsLength);
    function getClassPropertySize(uint32 _classId, PropertyType _type) constant external returns(uint);
    function getClassPropertyValue(uint32 _classId, PropertyType _type, uint index) constant external returns(uint32);
}

contract EtheremonCastleContract is EtheremonEnum, BasicAccessControl{

    uint32 public totalCastle = 0;
    uint64 public totalBattle = 0;
    
    function getCastleBasicInfo(address _owner) constant external returns(uint32, uint, uint32);
    function getCastleBasicInfoById(uint32 _castleId) constant external returns(uint, address, uint32);
    function countActiveCastle() constant external returns(uint);
    function getCastleObjInfo(uint32 _castleId) constant external returns(uint64, uint64, uint64, uint64, uint64, uint64);
    function getCastleStats(uint32 _castleId) constant external returns(string, address, uint32, uint32, uint32, uint);
    function isOnCastle(uint32 _castleId, uint64 _objId) constant external returns(bool);
    function getCastleWinLose(uint32 _castleId) constant external returns(uint32, uint32, uint32);
    function getTrainerBrick(address _trainer) constant external returns(uint32);

    function addCastle(address _trainer, string _name, uint64 _a1, uint64 _a2, uint64 _a3, uint64 _s1, uint64 _s2, uint64 _s3, uint32 _brickNumber) 
        onlyModerators external returns(uint32 currentCastleId);
    function renameCastle(uint32 _castleId, string _name) onlyModerators external;
    function removeCastleFromActive(uint32 _castleId) onlyModerators external;
    function deductTrainerBrick(address _trainer, uint32 _deductAmount) onlyModerators external returns(bool);
    
    function addBattleLog(uint32 _castleId, address _attacker, 
        uint8 _ran1, uint8 _ran2, uint8 _ran3, uint8 _result, uint32 _castleExp1, uint32 _castleExp2, uint32 _castleExp3) onlyModerators external returns(uint64);
    function addBattleLogMonsterInfo(uint64 _battleId, uint64 _a1, uint64 _a2, uint64 _a3, uint64 _s1, uint64 _s2, uint64 _s3, uint32 _exp1, uint32 _exp2, uint32 _exp3) onlyModerators external;
}

contract EtheremonBattle is EtheremonEnum, BasicAccessControl, SafeMath {
    uint8 constant public NO_MONSTER = 3;
    uint8 constant public STAT_COUNT = 6;
    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;
    }
    
    struct BattleMonsterData {
        uint64 a1;
        uint64 a2;
        uint64 a3;
        uint64 s1;
        uint64 s2;
        uint64 s3;
    }

    struct SupporterData {
        uint32 classId1;
        bool isGason1;
        uint8 type1;
        uint32 classId2;
        bool isGason2;
        uint8 type2;
        uint32 classId3;
        bool isGason3;
        uint8 type3;
    }

    struct AttackData {
        uint64 aa;
        SupporterData asup;
        uint16 aAttackSupport;
        uint64 ba;
        SupporterData bsup;
        uint16 bAttackSupport;
        uint8 index;
    }
    
    struct MonsterBattleLog {
        uint64 objId;
        uint32 exp;
    }
    
    struct BattleLogData {
        address castleOwner;
        uint64 battleId;
        uint32 castleId;
        uint32[3] temp;
        uint castleIndex;
        uint8[6] monsterLevel;
        uint8[3] randoms;
        bool win;
        BattleResult result;
    }
    
    struct CacheClassInfo {
        uint8[] types;
        uint8[] steps;
        uint32[] ancestors;
    }
    
    struct CastleData {
        address trainer;
        string name;
        uint32 brickNumber;
        uint64 a1;
        uint64 a2;
        uint64 a3;
        uint64 s1;
        uint64 s2;
        uint64 s3;
    }

    // event
    event EventCreateCastle(address indexed owner, uint32 castleId);
    event EventAttackCastle(address indexed attacker, uint32 castleId, uint8 result);
    event EventRemoveCastle(uint32 indexed castleId);
    
    // linked smart contract
    address public worldContract;
    address public dataContract;
    address public tradeContract;
    address public castleContract;
    address public paymentContract;
    
    // global variable
    mapping(uint8 => uint8) typeAdvantages;
    mapping(uint32 => CacheClassInfo) cacheClasses;
    mapping(uint8 => uint32) levelExps;
    uint8 public ancestorBuffPercentage = 10;
    uint8 public gasonBuffPercentage = 10;
    uint8 public typeBuffPercentage = 20;
    uint8 public maxLevel = 100;
    uint16 public maxActiveCastle = 30;
    uint8 public maxRandomRound = 4;
    
    uint8 public winBrickReturn = 8;
    uint32 public castleMinBrick = 5;
    uint8 public castleExpAdjustment = 150; // percentage
    uint8 public castleMaxLevelGap = 5;
    uint public brickETHPrice = 0.004 ether;
    uint8 public minHpDeducted = 10;
    uint public winTokenReward = 10 ** 8;
    
    uint256 public totalEarn = 0;
    uint256 public totalWithdraw = 0;
    
    address private lastAttacker = address(0x0);
    
    // modifier
    modifier requireDataContract {
        require(dataContract != address(0));
        _;
    }
    
    modifier requireTradeContract {
        require(tradeContract != address(0));
        _;
    }
    
    modifier requireCastleContract {
        require(castleContract != address(0));
        _;
    }
    
    modifier requireWorldContract {
        require(worldContract != address(0));
        _;
    }
    
    modifier requirePaymentContract {
        require(paymentContract != address(0));
        _;
    }


    function EtheremonBattle(address _dataContract, address _worldContract, address _tradeContract, address _castleContract, address _paymentContract) public {
        dataContract = _dataContract;
        worldContract = _worldContract;
        tradeContract = _tradeContract;
        castleContract = _castleContract;
        paymentContract = _paymentContract;
    }
    
     // admin & moderators
    function setTypeAdvantages() onlyModerators external {
        typeAdvantages[1] = 14;
        typeAdvantages[2] = 16;
        typeAdvantages[3] = 8;
        typeAdvantages[4] = 9;
        typeAdvantages[5] = 2;
        typeAdvantages[6] = 11;
        typeAdvantages[7] = 3;
        typeAdvantages[8] = 5;
        typeAdvantages[9] = 15;
        typeAdvantages[11] = 18;
        // skipp 10
        typeAdvantages[12] = 7;
        typeAdvantages[13] = 6;
        typeAdvantages[14] = 17;
        typeAdvantages[15] = 13;
        typeAdvantages[16] = 12;
        typeAdvantages[17] = 1;
        typeAdvantages[18] = 4;
    }
    
    function setTypeAdvantage(uint8 _type1, uint8 _type2) onlyModerators external {
        typeAdvantages[_type1] = _type2;
    }
    
    function setCacheClassInfo(uint32 _classId) onlyModerators requireDataContract requireWorldContract public {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
         EtheremonGateway gateway = EtheremonGateway(worldContract);
        uint i = 0;
        CacheClassInfo storage classInfo = cacheClasses[_classId];

        // add type
        i = data.getSizeArrayType(ArrayType.CLASS_TYPE, uint64(_classId));
        uint8[] memory aTypes = new uint8[](i);
        for(; i > 0 ; i--) {
            aTypes[i-1] = data.getElementInArrayType(ArrayType.CLASS_TYPE, uint64(_classId), i-1);
        }
        classInfo.types = aTypes;

        // add steps
        i = data.getSizeArrayType(ArrayType.STAT_STEP, uint64(_classId));
        uint8[] memory steps = new uint8[](i);
        for(; i > 0 ; i--) {
            steps[i-1] = data.getElementInArrayType(ArrayType.STAT_STEP, uint64(_classId), i-1);
        }
        classInfo.steps = steps;
        
        // add ancestor
        i = gateway.getClassPropertySize(_classId, PropertyType.ANCESTOR);
        uint32[] memory ancestors = new uint32[](i);
        for(; i > 0 ; i--) {
            ancestors[i-1] = gateway.getClassPropertyValue(_classId, PropertyType.ANCESTOR, i-1);
        }
        classInfo.ancestors = ancestors;
    }
    
    function fastSetCacheClassInfo(uint32 _classId1, uint32 _classId2, uint32 _classId3, uint32 _classId4, uint32 _classId5, uint32 _classId6, uint32 _classId7, uint32 _classId8) 
        onlyModerators requireDataContract requireWorldContract public {
        setCacheClassInfo(_classId1);
        setCacheClassInfo(_classId2);
        setCacheClassInfo(_classId3);
        setCacheClassInfo(_classId4);
        setCacheClassInfo(_classId5);
        setCacheClassInfo(_classId6);
        setCacheClassInfo(_classId7);
        setCacheClassInfo(_classId8);
    }    
     
    function withdrawEther(address _sendTo, uint _amount) onlyModerators external {
        if (_amount > this.balance) {
            revert();
        }
        uint256 validAmount = safeSubtract(totalEarn, totalWithdraw);
        if (_amount > validAmount) {
            revert();
        }
        totalWithdraw += _amount;
        _sendTo.transfer(_amount);
    }
    
    function setContract(address _dataContract, address _worldContract, address _tradeContract, address _castleContract, address _paymentContract) onlyModerators external {
        dataContract = _dataContract;
        worldContract = _worldContract;
        tradeContract = _tradeContract;
        castleContract = _castleContract;
        paymentContract = _paymentContract;
    }
    
    function setConfig(uint8 _ancestorBuffPercentage, uint8 _gasonBuffPercentage, uint8 _typeBuffPercentage, 
        uint8 _maxLevel, uint8 _maxRandomRound, uint8 _minHpDeducted, uint _winTokenReward) onlyModerators external{
        ancestorBuffPercentage = _ancestorBuffPercentage;
        gasonBuffPercentage = _gasonBuffPercentage;
        typeBuffPercentage = _typeBuffPercentage;
        maxLevel = _maxLevel;
        maxRandomRound = _maxRandomRound;
        minHpDeducted = _minHpDeducted;
        winTokenReward = _winTokenReward;
    }
    
    function setCastleConfig(uint8 _castleMaxLevelGap, uint16 _maxActiveCastle, uint _brickETHPrice, uint8 _castleExpAdjustment, uint32 _castleMinBrick) onlyModerators external {
        castleMaxLevelGap = _castleMaxLevelGap;
        maxActiveCastle = _maxActiveCastle;
        brickETHPrice = _brickETHPrice;
        castleExpAdjustment = _castleExpAdjustment;
        castleMinBrick = _castleMinBrick;
    }
    
    function genLevelExp() onlyModerators external {
        uint8 level = 1;
        uint32 requirement = 100;
        uint32 sum = requirement;
        while(level <= 100) {
            levelExps[level] = sum;
            level += 1;
            requirement = (requirement * 11) / 10 + 5;
            sum += requirement;
        }
    }
    
    // public 
    function getCacheClassSize(uint32 _classId) constant public returns(uint, uint, uint) {
        CacheClassInfo storage classInfo = cacheClasses[_classId];
        return (classInfo.types.length, classInfo.steps.length, classInfo.ancestors.length);
    }
    
    function getRandom(uint8 maxRan, uint8 index, address priAddress) constant public returns(uint8) {
        uint256 genNum = uint256(block.blockhash(block.number-1)) + uint256(priAddress);
        for (uint8 i = 0; i < index && i < 6; i ++) {
            genNum /= 256;
        }
        return uint8(genNum % maxRan);
    }
    
    function getLevel(uint32 exp) view public returns (uint8) {
        uint8 minIndex = 1;
        uint8 maxIndex = 100;
        uint8 currentIndex;
     
        while (minIndex < maxIndex) {
            currentIndex = (minIndex + maxIndex) / 2;
            if (exp < levelExps[currentIndex])
                maxIndex = currentIndex;
            else
                minIndex = currentIndex + 1;
        }

        return minIndex;
    }
    
    function getGainExp(uint8 level2, uint8 level, bool _win) pure public returns(uint32){
        uint8 halfLevel1 = level;
        if (level > level2 + 3) {
            halfLevel1 = (level2 + 3) / 2;
        } else {
            halfLevel1 = level / 2;
        }
        uint32 gainExp = 1;
        uint256 rate = (21 ** uint256(halfLevel1)) * 1000 / (20 ** uint256(halfLevel1));
        rate = rate * rate;
        if ((level > level2 + 3 && level2 + 3 > 2 * halfLevel1) || (level <= level2 + 3 && level > 2 * halfLevel1)) rate = rate * 21 / 20;
        if (_win) {
            gainExp = uint32(30 * rate / 1000000);
        } else {
            gainExp = uint32(10 * rate / 1000000);
        }
        
        if (level2 >= level + 5) {
            gainExp /= uint32(2) ** ((level2 - level) / 5);
        }
        return gainExp;
    }
    
    function getMonsterLevel(uint64 _objId) constant external returns(uint32, uint8) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        uint32 _ = 0;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, _, _, obj.createTime) = data.getMonsterObj(_objId);
     
        return (obj.exp, getLevel(obj.exp));
    }
    
    function getMonsterCP(uint64 _objId) constant external returns(uint64) {
        uint16[6] memory stats;
        uint32 classId = 0;
        uint32 exp = 0;
        (classId, exp, stats) = getCurrentStats(_objId);
        
        uint256 total;
        for(uint i=0; i < STAT_COUNT; i+=1) {
            total += stats[i];
        }
        return uint64(total/STAT_COUNT);
    }
    
    function isOnBattle(uint64 _objId) constant external returns(bool) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        EtheremonCastleContract castle = EtheremonCastleContract(castleContract);
        uint32 castleId;
        uint castleIndex = 0;
        uint256 price = 0;
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(_objId);
        (castleId, castleIndex, price) = castle.getCastleBasicInfo(obj.trainer);
        if (castleId > 0 && castleIndex > 0)
            return castle.isOnCastle(castleId, _objId);
        return false;
    }
    
    function isValidOwner(uint64 _objId, address _owner) constant public returns(bool) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        (obj.monsterId, obj.classId, obj.trainer, obj.exp, obj.createIndex, obj.lastClaimIndex, obj.createTime) = data.getMonsterObj(_objId);
        return (obj.trainer == _owner && obj.classId != 21);
    }
    
    function getObjExp(uint64 _objId) constant public returns(uint32, uint32) {
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        MonsterObjAcc memory obj;
        uint32 _ = 0;
        (_objId, obj.classId, obj.trainer, obj.exp, _, _, obj.createTime) = data.getMonsterObj(_objId);
        return (obj.classId, obj.exp);
    }
    
    function getCurrentStats(uint64 _objId) constant public returns(uint32, uint8, uint16[6]){
        EtheremonDataBase data = EtheremonDataBase(dataContract);
        uint16[6] memory stats;
        uint32 classId;
        uint32 exp;
        (classId, exp) = getObjExp(_objId);
        if (classId == 0)
            return (classId, 0, stats);
        
        uint i = 0;
        uint8 level = getLevel(exp);
        for(i=0; i < STAT_COUNT; i+=1) {
            stats[i] = data.getElementInArrayType(ArrayType.STAT_BASE, _objId, i);
        }
        for(i=0; i < cacheClasses[classId].steps.length; i++) {
            stats[i] += uint16(safeMult(cacheClasses[classId].steps[i], level*3));
        }
        return (classId, level, stats);
    }
    
    function safeDeduct(uint16 a, uint16 b) pure private returns(uint16){
        if (a > b) {
            return a - b;
        }
        return 0;
    }
    
    function calHpDeducted(uint16 _attack, uint16 _specialAttack, uint16 _defense, uint16 _specialDefense, bool _lucky) view public returns(uint16){
        if (_lucky) {
            _attack = _attack * 13 / 10;
            _specialAttack = _specialAttack * 13 / 10;
        }
        uint16 hpDeducted = safeDeduct(_attack, _defense * 3 /4);
        uint16 hpSpecialDeducted = safeDeduct(_specialAttack, _specialDefense* 3 / 4);
        if (hpDeducted < minHpDeducted && hpSpecialDeducted < minHpDeducted)
            return minHpDeducted;
        if (hpDeducted > hpSpecialDeducted)
            return hpDeducted;
        return hpSpecialDeducted;
    }
    
    function getAncestorBuff(uint32 _classId, SupporterData _support) constant private returns(uint16){
        // check ancestors
        uint i =0;
        uint8 countEffect = 0;
        uint ancestorSize = cacheClasses[_classId].ancestors.length;
        if (ancestorSize > 0) {
            uint32 ancestorClass = 0;
            for (i=0; i < ancestorSize; i ++) {
                ancestorClass = cacheClasses[_classId].ancestors[i];
                if (ancestorClass == _support.classId1 || ancestorClass == _support.classId2 || ancestorClass == _support.classId3) {
                    countEffect += 1;
                }
            }
        }
        return countEffect * ancestorBuffPercentage;
    }
    
    function getGasonSupport(uint32 _classId, SupporterData _sup) constant private returns(uint16 defenseSupport) {
        uint i = 0;
        uint8 classType = 0;
        defenseSupport = 0;
        for (i = 0; i < cacheClasses[_classId].types.length; i++) {
            classType = cacheClasses[_classId].types[i];
             if (_sup.isGason1) {
                if (classType == _sup.type1) {
                    defenseSupport += gasonBuffPercentage;
                    continue;
                }
            }
            if (_sup.isGason2) {
                if (classType == _sup.type2) {
                    defenseSupport += gasonBuffPercentage;
                    continue;
                }
            }
            if (_sup.isGason3) {
                if (classType == _sup.type3) {
                    defenseSupport += gasonBuffPercentage;
                    continue;
                }
            }
        }
    }
    
    function getTypeSupport(uint32 _aClassId, uint32 _bClassId) constant private returns (uint16 aAttackSupport, uint16 bAttackSupport) {
        // check types 
        bool aHasAdvantage;
        bool bHasAdvantage;
        for (uint i = 0; i < cacheClasses[_aClassId].types.length; i++) {
            for (uint j = 0; j < cacheClasses[_bClassId].types.length; j++) {
                if (typeAdvantages[cacheClasses[_aClassId].types[i]] == cacheClasses[_bClassId].types[j]) {
                    aHasAdvantage = true;
                }
                if (typeAdvantages[cacheClasses[_bClassId].types[j]] == cacheClasses[_aClassId].types[i]) {
                    bHasAdvantage = true;
                }
            }
        }
        
        if (aHasAdvantage)
            aAttackSupport += typeBuffPercentage;
        if (bHasAdvantage)
            bAttackSupport += typeBuffPercentage;
    }
    
    function calculateBattleStats(AttackData att) constant private returns(uint8 aLevel, uint16[6] aStats, uint8 bLevel, uint16[6] bStats) {
        uint32 aClassId = 0;
        (aClassId, aLevel, aStats) = getCurrentStats(att.aa);
        uint32 bClassId = 0;
        (bClassId, bLevel, bStats) = getCurrentStats(att.ba);
        
        // check gasonsupport
        (att.aAttackSupport, att.bAttackSupport) = getTypeSupport(aClassId, bClassId);
        att.aAttackSupport += getAncestorBuff(aClassId, att.asup);
        att.bAttackSupport += getAncestorBuff(bClassId, att.bsup);
        
        uint16 aDefenseBuff = getGasonSupport(aClassId, att.asup);
        uint16 bDefenseBuff = getGasonSupport(bClassId, att.bsup);
        
        // add attack
        aStats[1] += aStats[1] * att.aAttackSupport / 100;
        aStats[3] += aStats[3] * att.aAttackSupport / 100;
        bStats[1] += bStats[1] * att.bAttackSupport / 100;
        bStats[3] += bStats[3] * att.bAttackSupport / 100;
        
        // add offense
        aStats[2] += aStats[2] * aDefenseBuff / 100;
        aStats[4] += aStats[4] * aDefenseBuff / 100;
        bStats[2] += bStats[2] * bDefenseBuff / 100;
        bStats[4] += bStats[4] * bDefenseBuff / 100;
        
    }
    
    function attack(AttackData att) constant private returns(uint8 aLevel, uint8 bLevel, uint8 ran, bool win) {
        uint16[6] memory aStats;
        uint16[6] memory bStats;
        (aLevel, aStats, bLevel, bStats) = calculateBattleStats(att);
        
        ran = getRandom(maxRandomRound+2, att.index, lastAttacker);
        uint16 round = 0;
        while (round < maxRandomRound && aStats[0] > 0 && bStats[0] > 0) {
            if (aStats[5] > bStats[5]) {
                if (round % 2 == 0) {
                    // a attack 
                    bStats[0] = safeDeduct(bStats[0], calHpDeducted(aStats[1], aStats[3], bStats[2], bStats[4], round==ran));
                } else {
                    aStats[0] = safeDeduct(aStats[0], calHpDeducted(bStats[1], bStats[3], aStats[2], aStats[4], round==ran));
                }
                
            } else {
                if (round % 2 != 0) {
                    bStats[0] = safeDeduct(bStats[0], calHpDeducted(aStats[1], aStats[3], bStats[2], bStats[4], round==ran));
                } else {
                    aStats[0] = safeDeduct(aStats[0], calHpDeducted(bStats[1], bStats[3], aStats[2], aStats[4], round==ran));
                }
            }
            round+= 1;
        }
        
        win = aStats[0] >= bStats[0];
    }
    
    function updateCastle(uint32 _castleId, address _castleOwner, bool win) requireCastleContract private{
        EtheremonCastleContract castle = EtheremonCastleContract(castleContract);
        uint32 totalWin;
        uint32 totalLose;
        uint32 brickNumber;
        (totalWin, totalLose, brickNumber) = castle.getCastleWinLose(_castleId);
        EtheremonPaymentInterface payment = EtheremonPaymentInterface(paymentContract);
        
        // if castle win, ignore
        if (win) {
            if (totalWin < brickNumber) {
                 payment.giveBattleBonus(_castleOwner, winTokenReward);
            }
        } else {
            if (totalWin/winBrickReturn > brickNumber) {
                brickNumber = 2 * brickNumber;
            } else {
                brickNumber += totalWin/winBrickReturn;
            }
            if (brickNumber <= totalLose + 1) {
                castle.removeCastleFromActive(_castleId);
                // destroy
            }
            payment.giveBattleBonus(msg.sender, winTokenReward);
        }
    }
    
    function hasValidParam(address _trainer, uint64 _a1, uint64 _a2, uint64 _a3, uint64 _s1, uint64 _s2, uint64 _s3) constant public returns(bool) {
        if (_a1 == 0 || _a2 == 0 || _a3 == 0)
            return false;
        if (_a1 == _a2 || _a1 == _a3 || _a1 == _s1 || _a1 == _s2 || _a1 == _s3)
            return false;
        if (_a2 == _a3 || _a2 == _s1 || _a2 == _s2 || _a2 == _s3)
            return false;
        if (_a3 == _s1 || _a3 == _s2 || _a3 == _s3)
            return false;
        if (_s1 > 0 && (_s1 == _s2 || _s1 == _s3))
            return false;
        if (_s2 > 0 && (_s2 == _s3))
            return false;
        
        if (!isValidOwner(_a1, _trainer) || !isValidOwner(_a2, _trainer) || !isValidOwner(_a3, _trainer))
            return false;
        if (_s1 > 0 && !isValidOwner(_s1, _trainer))
            return false;
        if (_s2 > 0 && !isValidOwner(_s2, _trainer))
            return false;
        if (_s3 > 0 && !isValidOwner(_s3, _trainer))
            return false;
        return true;
    }
    
    function createCastleInternal(CastleData _castleData) private {
        EtheremonCastleContract castle = EtheremonCastleContract(castleContract);
        uint32 castleId;
        uint castleIndex = 0;
        uint32 numberBrick = 0;
        (castleId, castleIndex, numberBrick) = castle.getCastleBasicInfo(_castleData.trainer);
        if (castleId > 0 || castleIndex > 0)
            revert();

        if (castle.countActiveCastle() >= uint(maxActiveCastle))
            revert();
        castleId = castle.addCastle(_castleData.trainer, _castleData.name, _castleData.a1, _castleData.a2, _castleData.a3, 
            _castleData.s1, _castleData.s2, _castleData.s3, _castleData.brickNumber);
        EventCreateCastle(_castleData.trainer, castleId);
    }
    
    // public
    
    function createCastle(string _name, uint64 _a1, uint64 _a2, uint64 _a3, uint64 _s1, uint64 _s2, uint64 _s3) isActive requireDataContract 
        requireTradeContract requireCastleContract payable external {
        
        if (!hasValidParam(msg.sender, _a1, _a2, _a3, _s1, _s2, _s3))
            revert();
        
        EtheremonTradeInterface trade = EtheremonTradeInterface(tradeContract);
        if (trade.isOnTrading(_a1) || trade.isOnTrading(_a2) || trade.isOnTrading(_a3) || 
            trade.isOnTrading(_s1) || trade.isOnTrading(_s2) || trade.isOnTrading(_s3))
            revert();
        
        uint32 numberBrick = uint32(msg.value / brickETHPrice);
        if (numberBrick < castleMinBrick) {
            revert();
        }
        
        CastleData memory castleData;
        castleData.trainer = msg.sender;
        castleData.name = _name;
        castleData.brickNumber = numberBrick;
        castleData.a1 = _a1;
        castleData.a2 = _a2;
        castleData.a3 = _a3;
        castleData.s1 = _s1;
        castleData.s2 = _s2;
        castleData.s3 = _s3;
        createCastleInternal(castleData);
        totalEarn += msg.value;
    }
    
    function createCastleWithToken(address _trainer, uint32 _noBrick, string _name, uint64 _a1, uint64 _a2, uint64 _a3, uint64 _s1, uint64 _s2, uint64 _s3) isActive requireDataContract
        requireTradeContract requireCastleContract requirePaymentContract external {
        // only accept request from payment contract
        if (msg.sender != paymentContract)
            revert();
    
        if (!hasValidParam(_trainer, _a1, _a2, _a3, _s1, _s2, _s3))
            revert();
        
        EtheremonTradeInterface trade = EtheremonTradeInterface(tradeContract);
        if (trade.isOnTrading(_a1) || trade.isOnTrading(_a2) || trade.isOnTrading(_a3) || 
            trade.isOnTrading(_s1) || trade.isOnTrading(_s2) || trade.isOnTrading(_s3))
            revert();
        
        if (_noBrick < castleMinBrick) {
            revert();
        }
        
        CastleData memory castleData;
        castleData.trainer = _trainer;
        castleData.name = _name;
        castleData.brickNumber = _noBrick;
        castleData.a1 = _a1;
        castleData.a2 = _a2;
        castleData.a3 = _a3;
        castleData.s1 = _s1;
        castleData.s2 = _s2;
        castleData.s3 = _s3;
        createCastleInternal(castleData);
    }
    
    function renameCastle(uint32 _castleId, string _name) isActive requireCastleContract external {
        EtheremonCastleContract castle = EtheremonCastleContract(castleContract);
        uint index;
        address owner;
        uint256 price;
        (index, owner, price) = castle.getCastleBasicInfoById(_castleId);
        if (owner != msg.sender)
            revert();
        castle.renameCastle(_castleId, _name);
    }
    
    function removeCastle(uint32 _castleId) isActive requireCastleContract external {
        EtheremonCastleContract castle = EtheremonCastleContract(castleContract);
        uint index;
        address owner;
        uint256 price;
        (index, owner, price) = castle.getCastleBasicInfoById(_castleId);
        if (owner != msg.sender)
            revert();
        if (index > 0) {
            castle.removeCastleFromActive(_castleId);
        }
        EventRemoveCastle(_castleId);
    }
    
    function getSupporterInfo(uint64 s1, uint64 s2, uint64 s3) constant public returns(SupporterData sData) {
        uint temp;
        uint32 __;
        EtheremonGateway gateway = EtheremonGateway(worldContract);
        if (s1 > 0)
            (sData.classId1, __, sData.isGason1, temp, temp) = gateway.getObjBattleInfo(s1);
        if (s2 > 0)
            (sData.classId2, __, sData.isGason2, temp, temp) = gateway.getObjBattleInfo(s2);
        if (s3 > 0)
            (sData.classId3, __, sData.isGason3, temp, temp) = gateway.getObjBattleInfo(s3);

        EtheremonDataBase data = EtheremonDataBase(dataContract);
        if (sData.isGason1) {
            sData.type1 = data.getElementInArrayType(ArrayType.CLASS_TYPE, uint64(sData.classId1), 0);
        }
        
        if (sData.isGason2) {
            sData.type2 = data.getElementInArrayType(ArrayType.CLASS_TYPE, uint64(sData.classId2), 0);
        }
        
        if (sData.isGason3) {
            sData.type3 = data.getElementInArrayType(ArrayType.CLASS_TYPE, uint64(sData.classId3), 0);
        }
    }
    
    function attackCastle(uint32 _castleId, uint64 _aa1, uint64 _aa2, uint64 _aa3, uint64 _as1, uint64 _as2, uint64 _as3) isActive requireDataContract 
        requireTradeContract requireCastleContract requirePaymentContract external {
        if (!hasValidParam(msg.sender, _aa1, _aa2, _aa3, _as1, _as2, _as3))
            revert();
        
        EtheremonCastleContract castle = EtheremonCastleContract(castleContract);
        BattleLogData memory log;
        (log.castleIndex, log.castleOwner, log.temp[0]) = castle.getCastleBasicInfoById(_castleId);
        if (log.castleIndex == 0 || log.castleOwner == msg.sender)
            revert();
        
        EtheremonGateway gateway = EtheremonGateway(worldContract);
        BattleMonsterData memory b;
        (b.a1, b.a2, b.a3, b.s1, b.s2, b.s3) = castle.getCastleObjInfo(_castleId);
        lastAttacker = msg.sender;

        // init data
        uint8 countWin = 0;
        AttackData memory att;
        att.asup = getSupporterInfo(b.s1, b.s2, b.s3);
        att.bsup = getSupporterInfo(_as1, _as2, _as3);
        
        att.index = 0;
        att.aa = b.a1;
        att.ba = _aa1;
        (log.monsterLevel[0], log.monsterLevel[3], log.randoms[0], log.win) = attack(att);
        gateway.increaseMonsterExp(att.aa, getGainExp(log.monsterLevel[0], log.monsterLevel[3], log.win)*castleExpAdjustment/100);
        gateway.increaseMonsterExp(att.ba, getGainExp(log.monsterLevel[3], log.monsterLevel[0], !log.win));
        if (log.win)
            countWin += 1;
        
        
        att.index = 1;
        att.aa = b.a2;
        att.ba = _aa2;
        (log.monsterLevel[1], log.monsterLevel[4], log.randoms[1], log.win) = attack(att);
        gateway.increaseMonsterExp(att.aa, getGainExp(log.monsterLevel[1], log.monsterLevel[4], log.win)*castleExpAdjustment/100);
        gateway.increaseMonsterExp(att.ba, getGainExp(log.monsterLevel[4], log.monsterLevel[1], !log.win));
        if (log.win)
            countWin += 1;   

        att.index = 2;
        att.aa = b.a3;
        att.ba = _aa3;
        (log.monsterLevel[2], log.monsterLevel[5], log.randoms[2], log.win) = attack(att);
        gateway.increaseMonsterExp(att.aa, getGainExp(log.monsterLevel[2], log.monsterLevel[5], log.win)*castleExpAdjustment/100);
        gateway.increaseMonsterExp(att.ba, getGainExp(log.monsterLevel[5], log.monsterLevel[2], !log.win));
        if (log.win)
            countWin += 1; 
        
        if ((log.monsterLevel[0] + log.monsterLevel[1] + log.monsterLevel[2])/3 + castleMaxLevelGap < (log.monsterLevel[3] + log.monsterLevel[4] + log.monsterLevel[5])/3)
            revert();
        
        updateCastle(_castleId, log.castleOwner, countWin>1);
        if (countWin>1) {
            log.result = BattleResult.CASTLE_WIN;
        } else {
            log.result = BattleResult.CASTLE_LOSE;
        }
        
        log.temp[0] = levelExps[log.monsterLevel[0]]-1;
        log.temp[1] = levelExps[log.monsterLevel[1]]-1;
        log.temp[2] = levelExps[log.monsterLevel[2]]-1;
        log.battleId = castle.addBattleLog(_castleId, msg.sender, log.randoms[0], log.randoms[1], log.randoms[2], 
            uint8(log.result), log.temp[0], log.temp[1], log.temp[2]);
        
        log.temp[0] = levelExps[log.monsterLevel[3]]-1;
        log.temp[1] = levelExps[log.monsterLevel[4]]-1;
        log.temp[2] = levelExps[log.monsterLevel[5]]-1;
        castle.addBattleLogMonsterInfo(log.battleId, _aa1, _aa2, _aa3, _as1, _as2, _as3, log.temp[0], log.temp[1], log.temp[2]);
    
        EventAttackCastle(msg.sender, _castleId, uint8(log.result));
    }
    
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[{"name":"_objId","type":"uint64"}],"name":"getMonsterCP","outputs":[{"name":"","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dataContract","outputs":[{"name":"","type":"address"}],"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":"worldContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_trainer","type":"address"},{"name":"_a1","type":"uint64"},{"name":"_a2","type":"uint64"},{"name":"_a3","type":"uint64"},{"name":"_s1","type":"uint64"},{"name":"_s2","type":"uint64"},{"name":"_s3","type":"uint64"}],"name":"hasValidParam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_objId","type":"uint64"}],"name":"getObjExp","outputs":[{"name":"","type":"uint32"},{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"brickETHPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_attack","type":"uint16"},{"name":"_specialAttack","type":"uint16"},{"name":"_defense","type":"uint16"},{"name":"_specialDefense","type":"uint16"},{"name":"_lucky","type":"bool"}],"name":"calHpDeducted","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_dataContract","type":"address"},{"name":"_worldContract","type":"address"},{"name":"_tradeContract","type":"address"},{"name":"_castleContract","type":"address"},{"name":"_paymentContract","type":"address"}],"name":"setContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_ancestorBuffPercentage","type":"uint8"},{"name":"_gasonBuffPercentage","type":"uint8"},{"name":"_typeBuffPercentage","type":"uint8"},{"name":"_maxLevel","type":"uint8"},{"name":"_maxRandomRound","type":"uint8"},{"name":"_minHpDeducted","type":"uint8"},{"name":"_winTokenReward","type":"uint256"}],"name":"setConfig","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_type1","type":"uint8"},{"name":"_type2","type":"uint8"}],"name":"setTypeAdvantage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"genLevelExp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"setTypeAdvantages","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_castleMaxLevelGap","type":"uint8"},{"name":"_maxActiveCastle","type":"uint16"},{"name":"_brickETHPrice","type":"uint256"},{"name":"_castleExpAdjustment","type":"uint8"},{"name":"_castleMinBrick","type":"uint32"}],"name":"setCastleConfig","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_objId","type":"uint64"}],"name":"isOnBattle","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"maxRan","type":"uint8"},{"name":"index","type":"uint8"},{"name":"priAddress","type":"address"}],"name":"getRandom","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"level2","type":"uint8"},{"name":"level","type":"uint8"},{"name":"_win","type":"bool"}],"name":"getGainExp","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_castleId","type":"uint32"},{"name":"_name","type":"string"}],"name":"renameCastle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalWithdraw","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_castleId","type":"uint32"},{"name":"_aa1","type":"uint64"},{"name":"_aa2","type":"uint64"},{"name":"_aa3","type":"uint64"},{"name":"_as1","type":"uint64"},{"name":"_as2","type":"uint64"},{"name":"_as3","type":"uint64"}],"name":"attackCastle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_isMaintaining","type":"bool"}],"name":"UpdateMaintaining","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"castleMinBrick","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_a1","type":"uint64"},{"name":"_a2","type":"uint64"},{"name":"_a3","type":"uint64"},{"name":"_s1","type":"uint64"},{"name":"_s2","type":"uint64"},{"name":"_s3","type":"uint64"}],"name":"createCastle","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"totalModerators","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_classId","type":"uint32"}],"name":"getCacheClassSize","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","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":true,"inputs":[{"name":"s1","type":"uint64"},{"name":"s2","type":"uint64"},{"name":"s3","type":"uint64"}],"name":"getSupporterInfo","outputs":[{"components":[{"name":"classId1","type":"uint32"},{"name":"isGason1","type":"bool"},{"name":"type1","type":"uint8"},{"name":"classId2","type":"uint32"},{"name":"isGason2","type":"bool"},{"name":"type2","type":"uint8"},{"name":"classId3","type":"uint32"},{"name":"isGason3","type":"bool"},{"name":"type3","type":"uint8"}],"name":"sData","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"castleMaxLevelGap","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"winBrickReturn","outputs":[{"name":"","type":"uint8"}],"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":"NO_MONSTER","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_objId","type":"uint64"}],"name":"getCurrentStats","outputs":[{"name":"","type":"uint32"},{"name":"","type":"uint8"},{"name":"","type":"uint16[6]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ancestorBuffPercentage","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"typeBuffPercentage","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"castleExpAdjustment","outputs":[{"name":"","type":"uint8"}],"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":"_classId","type":"uint32"}],"name":"setCacheClassInfo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"winTokenReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paymentContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxActiveCastle","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_trainer","type":"address"},{"name":"_noBrick","type":"uint32"},{"name":"_name","type":"string"},{"name":"_a1","type":"uint64"},{"name":"_a2","type":"uint64"},{"name":"_a3","type":"uint64"},{"name":"_s1","type":"uint64"},{"name":"_s2","type":"uint64"},{"name":"_s3","type":"uint64"}],"name":"createCastleWithToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"exp","type":"uint32"}],"name":"getLevel","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_classId1","type":"uint32"},{"name":"_classId2","type":"uint32"},{"name":"_classId3","type":"uint32"},{"name":"_classId4","type":"uint32"},{"name":"_classId5","type":"uint32"},{"name":"_classId6","type":"uint32"},{"name":"_classId7","type":"uint32"},{"name":"_classId8","type":"uint32"}],"name":"fastSetCacheClassInfo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_oldModerator","type":"address"}],"name":"RemoveModerator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"maxLevel","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minHpDeducted","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_objId","type":"uint64"}],"name":"getMonsterLevel","outputs":[{"name":"","type":"uint32"},{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_castleId","type":"uint32"}],"name":"removeCastle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gasonBuffPercentage","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"STAT_COUNT","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_objId","type":"uint64"},{"name":"_owner","type":"address"}],"name":"isValidOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalEarn","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"castleContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxRandomRound","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","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":"tradeContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_dataContract","type":"address"},{"name":"_worldContract","type":"address"},{"name":"_tradeContract","type":"address"},{"name":"_castleContract","type":"address"},{"name":"_paymentContract","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":false,"name":"castleId","type":"uint32"}],"name":"EventCreateCastle","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"attacker","type":"address"},{"indexed":false,"name":"castleId","type":"uint32"},{"indexed":false,"name":"result","type":"uint8"}],"name":"EventAttackCastle","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"castleId","type":"uint32"}],"name":"EventRemoveCastle","type":"event"}]

606060405260008060146101000a81548161ffff021916908361ffff1602179055506001600260006101000a81548160ff021916908315150217905550600a8060006101000a81548160ff021916908360ff160217905550600a8060016101000a81548160ff021916908360ff1602179055506014600a60026101000a81548160ff021916908360ff1602179055506064600a60036101000a81548160ff021916908360ff160217905550601e600a60046101000a81548161ffff021916908361ffff1602179055506004600a60066101000a81548160ff021916908360ff1602179055506008600a60076101000a81548160ff021916908360ff1602179055506005600a60086101000a81548163ffffffff021916908363ffffffff1602179055506096600a600c6101000a81548160ff021916908360ff1602179055506005600a600d6101000a81548160ff021916908360ff160217905550660e35fa931a0000600b55600a600c60006101000a81548160ff021916908360ff1602179055506305f5e100600d556000600e556000600f556000601060006101000a815481600160a060020a030219169083600160a060020a0316021790555034156101c657600080fd5b60405160a080620058ac833981016040528080519190602001805191906020018051919060200180519190602001805160008054600160a060020a03338116600160a060020a0319928316179092556003805499831699821699909917909855600280549782166101000261010060a860020a031990981697909717909655600480549587169588169590951790945550506005805491841691851691909117905560068054929091169190921617905561562580620002876000396000f30060606040526004361061029a5763ffffffff60e060020a6000350416630672859b811461029f5780630d668818146102da57806314d0f1ba14610309578063187584801461033c5780631bab09081461034f5780631cd98235146103985780631f296600146103d857806320046e91146103fd57806320eb2a871461044557806328064a831461047e5780633171cec4146104b857806333ced321146104d757806333d24dc4146104ea5780633409b532146104fd57806335f097f3146105315780633a34f09a146105505780633eb38fc51461059157806343b37b45146105ce578063455fd623146105f657806347cf89711461060957806348ef5aa81461064f5780634a3d3c09146106675780634aaff0061461067a5780634efb023e146106b9578063500e4297146106cc578063522f68151461070c57806354f0bde71461072e578063638f8da4146107595780636b2a26911461076c5780636c81fd6d1461077f57806373d65c001461079e578063775e38f7146107b157806384be816c146107c457806385bbb53a14610832578063891fe103146108455780638a2cb24d146108585780638da5cb5b1461086b5780638fd8f7831461087e5780639216b7ad1461089a5780639c91dd56146108ad578063a0c66b43146108c0578063b04e7668146108d3578063b2cad9b714610934578063b76d26d414610950578063b85d627514610996578063cc06c359146109b5578063cfa83079146109c8578063d2169d2f146109db578063d4c1516114610a1c578063d542557114610a38578063d98e14bd14610a4b578063da5671ad14610a5e578063dffd722f14610a89578063eb83f01514610a9c578063ebfa3c1b14610aaf578063ee4e441614610ac2578063f285329214610ad5578063ffa640d814610af4575b600080fd5b34156102aa57600080fd5b6102be6001604060020a0360043516610b07565b6040516001604060020a03909116815260200160405180910390f35b34156102e557600080fd5b6102ed610b67565b604051600160a060020a03909116815260200160405180910390f35b341561031457600080fd5b610328600160a060020a0360043516610b76565b604051901515815260200160405180910390f35b341561034757600080fd5b6102ed610b8b565b341561035a57600080fd5b610328600160a060020a03600435166001604060020a0360243581169060443581169060643581169060843581169060a43581169060c43516610b9f565b34156103a357600080fd5b6103b76001604060020a0360043516610e9a565b60405163ffffffff9283168152911660208201526040908101905180910390f35b34156103e357600080fd5b6103eb610f87565b60405190815260200160405180910390f35b341561040857600080fd5b61042e61ffff600435811690602435811690604435811690606435166084351515610f8d565b60405161ffff909116815260200160405180910390f35b341561045057600080fd5b61047c600160a060020a0360043581169060243581169060443581169060643581169060843516611039565b005b341561048957600080fd5b61047c60ff60043581169060243581169060443581169060643581169060843581169060a4351660c435611107565b34156104c357600080fd5b61047c60ff600435811690602435166111cf565b34156104e257600080fd5b61047c611237565b34156104f557600080fd5b61047c6112e5565b341561050857600080fd5b61047c60ff60043581169061ffff6024351690604435906064351663ffffffff6084351661160e565b341561053c57600080fd5b6103286001604060020a03600435166116f7565b341561055b57600080fd5b61057b60ff60043581169060243516600160a060020a0360443516611929565b60405160ff909116815260200160405180910390f35b341561059c57600080fd5b6105b560ff600435811690602435166044351515611983565b60405163ffffffff909116815260200160405180910390f35b34156105d957600080fd5b61047c6004803563ffffffff169060248035908101910135611a96565b341561060157600080fd5b6103eb611bfc565b341561061457600080fd5b61047c63ffffffff600435166001604060020a0360243581169060443581169060643581169060843581169060a43581169060c43516611c02565b341561065a57600080fd5b61047c60043515156127e3565b341561067257600080fd5b6105b5612811565b61047c60246004803582810192910135906001604060020a03903581169060443581169060643581169060843581169060a43581169060c43516612829565b34156106c457600080fd5b61042e612c5c565b34156106d757600080fd5b6106e863ffffffff60043516612c7e565b60405180848152602001838152602001828152602001935050505060405180910390f35b341561071757600080fd5b61047c600160a060020a0360043516602435612ca3565b341561073957600080fd5b6103eb6001604060020a0360043581169060243581169060443516612d57565b341561076457600080fd5b61057b6131d6565b341561077757600080fd5b61057b6131f0565b341561078a57600080fd5b61047c600160a060020a0360043516613204565b34156107a957600080fd5b61057b6132ae565b34156107bc57600080fd5b61057b6132b3565b34156107cf57600080fd5b6107e36001604060020a03600435166132b8565b60405163ffffffff8416815260ff83166020820152604081018260c080838360005b8381101561081d578082015183820152602001610805565b50505050905001935050505060405180910390f35b341561083d57600080fd5b61057b6134a5565b341561085057600080fd5b61057b6134ae565b341561086357600080fd5b61057b6134bd565b341561087657600080fd5b6102ed6134d6565b341561088957600080fd5b61047c63ffffffff600435166134e5565b34156108a557600080fd5b6103eb613aa6565b34156108b857600080fd5b6102ed613aac565b34156108cb57600080fd5b61042e613abb565b34156108de57600080fd5b61047c60048035600160a060020a0316906024803563ffffffff16916044359182019101356064356001604060020a039081169060843581169060a43581169060c43581169060e4358116906101043516613acd565b341561093f57600080fd5b61057b63ffffffff60043516613f18565b341561095b57600080fd5b61047c63ffffffff60043581169060243581169060443581169060643581169060843581169060a43581169060c43581169060e43516613f7b565b34156109a157600080fd5b61047c600160a060020a0360043516614046565b34156109c057600080fd5b61057b6140f0565b34156109d357600080fd5b61057b614100565b34156109e657600080fd5b6109fa6001604060020a0360043516614109565b60405163ffffffff909216825260ff1660208201526040908101905180910390f35b3415610a2757600080fd5b61047c63ffffffff60043516614206565b3415610a4357600080fd5b61057b614379565b3415610a5657600080fd5b61057b614387565b3415610a6957600080fd5b6103286001604060020a0360043516600160a060020a036024351661438c565b3415610a9457600080fd5b6103eb6144aa565b3415610aa757600080fd5b6102ed6144b0565b3415610aba57600080fd5b61057b6144bf565b3415610acd57600080fd5b6103286144d2565b3415610ae057600080fd5b61047c600160a060020a03600435166144db565b3415610aff57600080fd5b6102ed614532565b6000610b1161525c565b6000808080610b1f876132b8565b965090945060ff169250600090505b6006811015610b5957848160068110610b4357fe5b602002015161ffff169190910190600101610b2e565b506006900495945050505050565b600354600160a060020a031681565b60016020526000908152604090205460ff1681565b6002546101009004600160a060020a031681565b60006001604060020a0387161580610bbe57506001604060020a038616155b80610bd057506001604060020a038516155b15610bdd57506000610e8f565b856001604060020a0316876001604060020a03161480610c0e5750846001604060020a0316876001604060020a0316145b80610c2a5750836001604060020a0316876001604060020a0316145b80610c465750826001604060020a0316876001604060020a0316145b80610c625750816001604060020a0316876001604060020a0316145b15610c6f57506000610e8f565b846001604060020a0316866001604060020a03161480610ca05750836001604060020a0316866001604060020a0316145b80610cbc5750826001604060020a0316866001604060020a0316145b80610cd85750816001604060020a0316866001604060020a0316145b15610ce557506000610e8f565b836001604060020a0316856001604060020a03161480610d165750826001604060020a0316856001604060020a0316145b80610d325750816001604060020a0316856001604060020a0316145b15610d3f57506000610e8f565b6000846001604060020a0316118015610d845750826001604060020a0316846001604060020a03161480610d845750816001604060020a0316846001604060020a0316145b15610d9157506000610e8f565b6000836001604060020a0316118015610dbb5750816001604060020a0316836001604060020a0316145b15610dc857506000610e8f565b610dd2878961438c565b1580610de55750610de3868961438c565b155b80610df75750610df5858961438c565b155b15610e0457506000610e8f565b6000846001604060020a0316118015610e245750610e22848961438c565b155b15610e3157506000610e8f565b6000836001604060020a0316118015610e515750610e4f838961438c565b155b15610e5e57506000610e8f565b6000826001604060020a0316118015610e7e5750610e7c828961438c565b155b15610e8b57506000610e8f565b5060015b979650505050505050565b6000806000610ea7615284565b600354600160a060020a031691506000826307202460878360405160e0015260405160e060020a63ffffffff84160281526001604060020a03909116600482015260240160e060405180830381600087803b1515610f0457600080fd5b6102c65a03f11515610f1557600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160e08a0152505063ffffffff9182166080880152600160a060020a0390921660408701529190911660208501908152919750915051826080015194509450505050915091565b600b5481565b60008060008315610fb357600a61ffff600d8a0216049750600a61ffff600d8902160496505b610fc888600461ffff60038a02165b04614541565b9150610fdd87600461ffff6003890216610fc2565b600c5490915060ff1661ffff83161080156110005750600c5460ff1661ffff8216105b1561101257600c5460ff16925061102e565b8061ffff168261ffff16111561102a5781925061102e565b8092505b505095945050505050565b60005433600160a060020a03908116911614806110745750600160a060020a03331660009081526001602081905260409091205460ff161515145b151561107f57600080fd5b60038054600160a060020a0396871673ffffffffffffffffffffffffffffffffffffffff1991821617909155600280549587166101000274ffffffffffffffffffffffffffffffffffffffff00199096169590951790945560048054938616938516939093179092556005805491851691841691909117905560068054919093169116179055565b60005433600160a060020a03908116911614806111425750600160a060020a03331660009081526001602081905260409091205460ff161515145b151561114d57600080fd5b600a805460ff1990811660ff998a161761ff001916610100988a16989098029790971762ff0000191662010000968916969096029590951763ff00000019166301000000948816949094029390931766ff000000000000191666010000000000009287169290920291909117909255600c805490931691909316179055600d55565b60005433600160a060020a039081169116148061120a5750600160a060020a03331660009081526001602081905260409091205460ff161515145b151561121557600080fd5b60ff9182166000908152600760205260409020805460ff191691909216179055565b600080548190819033600160a060020a03908116911614806112775750600160a060020a03331660009081526001602081905260409091205460ff161515145b151561128257600080fd5b506001915060649050805b606460ff8416116112e05760ff83166000908152600960205260409020805463ffffffff191663ffffffff83811691909117909155600190930192600a90600b840216046005019150818101905061128d565b505050565b60005433600160a060020a03908116911614806113205750600160a060020a03331660009081526001602081905260409091205460ff161515145b151561132b57600080fd5b600760208190527fb39221ace053465ec3453ce2b36430bd138b997ecea25c1043da0c366812b828805460ff19908116600e179091557fb7c774451310d1be4108bc180d1b52823cb0ee0274a6c0081bcaf94f115fb96d8054821660101790557f3be6fd20d5acfde5b873b48692cd31f4d3c7e8ee8a813af4696af8859e5ca6c68054821660081790557fb805995a7ec585a251200611a61d179cfd7fb105e1ab17dc415a7336783786f78054821660091790557fbcdda56b5d08466ec462cbbe0adfa57cb0a15fcc8940ef68f702f21b787bc9358054821660021790557f55c5b153ab560fcde54a63b18c7f53d75501706907cef8767fbded79ab9997c780548216600b1790557fb7c49cceb9f85950584035457a41ebbd8cf93b9b612733ad25aa9731ac43aad68054821660031790557f4b1bf46c9f1bd48ff8274d40bad76a6615cb6c59a637d451a3994194b2db86be8054821660051790557ff1f3e9c34634a546b3672c043f73844d83d55591bbe61b8e7e3a72bca1a812bf80548216600f1790557fb7511a2dbe1513c8574eaafb5266301ff1bbf641d4144b093d6d1b500334bf2f8054821660129081179091557f74b6357e277c778e8ad9a2761a935d45336ec91439b9e1b117eda2efdfe38fad805483169093179092557fc6af84bcd7a912c26772dce2b27a335c9acc50e9113bac42fd0b48deecc0f30c8054821660061790557fde7415c6a2f6d5051213edef7c4742786ca35b02a0e77e53b1b2e1ff1a228a6b8054821660111790557f6695255c0c22b4090576b0ff35e852eba3dd4afabff28976da48e1280061728d80548216600d1790557ffdb0fc5c292af6bc7c9afb28ca8e0549b4de965653a829548475c76a1d5c400c80548216600c1790557f7fecc9f0b925868a8c62ee842da0498074146a036d84a1041d9b5286786bbbf38054821660011790556000919091527ff2e2385bc2a5be32198cd1e425186910eb1a233b2b2a22be149cee4dc72d016280549091166004179055565b60005433600160a060020a03908116911614806116495750600160a060020a03331660009081526001602081905260409091205460ff161515145b151561165457600080fd5b600a8054600b949094556dff00000000000000000000000000199093166d010000000000000000000000000060ff968716021765ffff00000000191664010000000061ffff9590951694909402939093176cff00000000000000000000000019166c010000000000000000000000009190941602929092176bffffffff000000000000000019166801000000000000000063ffffffff9290921691909102179055565b600080600080600080611708615284565b600354600554600160a060020a03918216975016945060009250829150856307202460898460405160e0015260405160e060020a63ffffffff84160281526001604060020a03909116600482015260240160e060405180830381600087803b151561177257600080fd5b6102c65a03f1151561178357600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160e08901525063ffffffff90811660c088015290811660a08701529081166080860152600160a060020a0391821660408601908152921660208501526001604060020a0390921683529086169063f8a74501905160006040516060015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401606060405180830381600087803b151561184a57600080fd5b6102c65a03f1151561185b57600080fd5b50505060405180519060200180519060200180519296509094505063ffffffff908116925060009085161180156118925750600083115b156119195784600160a060020a031663dc268db9858a60006040516020015260405163ffffffff84811660e060020a0282529290921660048301526001604060020a03166024820152604401602060405180830381600087803b15156118f757600080fd5b6102c65a03f1151561190857600080fd5b50505060405180519050965061191e565b600096505b505050505050919050565b6000600019430140600160a060020a03831601815b8460ff168160ff16108015611956575060068160ff16105b1561196a576101008204915060010161193e565b8560ff168281151561197857fe5b069695505050505050565b600082818060ff60038801811690841611156119aa57600260ff60038901160492506119b4565b600260ff87160492505b600191508260ff1660140a8360ff1660150a6103e8028115156119d357fe5b048002905060ff6003880181169087161180156119fb57508260020260ff168760030160ff16115b80611a2257508660030160ff168660ff1611158015611a2257508260020260ff168660ff16115b15611a31576014601582020490505b8415611a4757620f4240601e8202049150611a53565b620f4240600a82020491505b60ff60058701811690881610611a8c57600560ff878903160460ff1660020a63ffffffff168263ffffffff16811515611a8857fe5b0491505b5095945050505050565b60025460009081908190819060ff1615611aaf57600080fd5b600554600160a060020a03161515611ac657600080fd5b600554600160a060020a031693508363f31dec5a8860006040516060015260405163ffffffff83811660e060020a028252919091166004820152602401606060405180830381600087803b1515611b1c57600080fd5b6102c65a03f11515611b2d57600080fd5b50505060405180519060200180519060200180519295509093505063ffffffff16905033600160a060020a0390811690831614611b6957600080fd5b83600160a060020a03166343b37b458888886040518463ffffffff1660e060020a028152600401808463ffffffff1663ffffffff1681526020018060200182810382528484828181526020019250808284378201915050945050505050600060405180830381600087803b1515611bdf57600080fd5b6102c65a03f11515611bf057600080fd5b50505050505050505050565b600f5481565b6000611c0c6152d0565b6000611c1661532f565b6000611c20615364565b60025460ff1615611c3057600080fd5b600354600160a060020a03161515611c4757600080fd5b600454600160a060020a03161515611c5e57600080fd5b600554600160a060020a03161515611c7557600080fd5b600654600160a060020a03161515611c8c57600080fd5b611c9b338d8d8d8d8d8d610b9f565b1515611ca657600080fd5b600554600160a060020a031695508563f31dec5a8e60006040516060015260405163ffffffff83811660e060020a028252919091166004820152602401606060405180830381600087803b1515611cfc57600080fd5b6102c65a03f11515611d0d57600080fd5b505050604051805190602001805190602001805190506080880188606081015163ffffffff93909316909252600160a060020a039290921690525260808501511580611d6b5750600160a060020a0333168551600160a060020a0316145b15611d7557600080fd5b600254600160a060020a036101009091048116945086166301d439458e600060405160c0015260405163ffffffff83811660e060020a02825291909116600482015260240160c060405180830381600087803b1515611dd357600080fd5b6102c65a03f11515611de457600080fd5b50505060405180519060200180519060200180519060200180519060200180519060200180516001604060020a0390811660a08b015291821660808a0152509081166060880190815291811660408801529182166020870152911684526010805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a031617905560009250611e81905184608001518560a00151612d57565b6020820152611e91898989612d57565b6080820152600060c082015282516001604060020a0390811682528c166060820152611ebc81614566565b8860a0015160a08a015160600160c08b015192151560e08c015260ff9384169092529282169052919091169052600160a060020a038416635643a7118251600a546064906c01000000000000000000000000900460ff16611f3360a08b0151518b60a0015160035b60200201518c60e00151611983565b0263ffffffff16811515611f4357fe5b0460405163ffffffff84811660e060020a0282526001604060020a0393909316600482015291166024820152604401600060405180830381600087803b1515611f8b57600080fd5b6102c65a03f11515611f9c57600080fd5b50505083600160a060020a0316635643a7118260600151611fd78860a00151606001518960a0015160005b60200201518a60e0015115611983565b60405163ffffffff84811660e060020a0282526001604060020a0393909316600482015291166024820152604401600060405180830381600087803b151561201e57600080fd5b6102c65a03f1151561202f57600080fd5b5050508460e0015115612043576001820191505b600160c082015260208301516001604060020a0390811682528b16606082015261206c81614566565b8860a0015160200160a08a015160800160c08b015192151560e08c015260ff9384166020909301929092529282169052919091169052600160a060020a038416635643a7118251600a546064906c01000000000000000000000000900460ff166120e460a08b0151602001518b60a001516004611f24565b0263ffffffff168115156120f457fe5b0460405163ffffffff84811660e060020a0282526001604060020a0393909316600482015291166024820152604401600060405180830381600087803b151561213c57600080fd5b6102c65a03f1151561214d57600080fd5b50505083600160a060020a0316635643a711826060015161217c8860a00151608001518960a001516001611fc7565b60405163ffffffff84811660e060020a0282526001604060020a0393909316600482015291166024820152604401600060405180830381600087803b15156121c357600080fd5b6102c65a03f115156121d457600080fd5b5050508460e00151156121e8576001820191505b600260c082015260408301516001604060020a0390811682528a16606082015261221181614566565b8860a0015160400160a08a015160a00160c08b015192151560e08c015260ff9384166040909301929092529282169052919091169052600160a060020a038416635643a7118251600a546064906c01000000000000000000000000900460ff1661228960a08b0151604001518b60a001516005611f24565b0263ffffffff1681151561229957fe5b0460405163ffffffff84811660e060020a0282526001604060020a0393909316600482015291166024820152604401600060405180830381600087803b15156122e157600080fd5b6102c65a03f115156122f257600080fd5b50505083600160a060020a0316635643a71182606001516123218860a0015160a001518960a001516002611fc7565b60405163ffffffff84811660e060020a0282526001604060020a0393909316600482015291166024820152604401600060405180830381600087803b151561236857600080fd5b6102c65a03f1151561237957600080fd5b5050508460e001511561238d576001820191505b60038560a0015160a001518660a00151608001518760a0015160600151010160ff168115156123b857fe5b0460ff16600a600d9054906101000a900460ff1660038760a00151604001518860a00151602001518960a0015151010160ff168115156123f457fe5b040160ff16101561240457600080fd5b6124168d865160018560ff161161470b565b60018260ff16111561242f576000610100860152612438565b60016101008601525b6001600960008760a001515160ff16815260208101919091526040016000205463ffffffff1603606086015163ffffffff91909116905260016009600060a08801516020015160ff16815260208101919091526040016000205463ffffffff1603606086015163ffffffff9190911660209091015260016009600060a08801516040015160ff16815260208101919091526040016000205463ffffffff1603606086015163ffffffff91909116604090910152600160a060020a038616631f674b5a8e3360c0890151518960c00151602001518a60c00151604001518b6101000151600281111561252557fe5b8c60600151518d60600151602001518e606001516040015160006040516020015260405163ffffffff8b811660e060020a028252998a166004820152600160a060020a0398909816602489015260ff968716604489015294861660648801529285166084870152931660a485015291841660c484015290831660e483015290911661010482015261012401602060405180830381600087803b15156125c957600080fd5b6102c65a03f115156125da57600080fd5b50505060405180516001604060020a031660208701525060016009600060a08801516060015160ff16815260208101919091526040016000205463ffffffff1603606086015163ffffffff91909116905260016009600060a08801516080015160ff16815260208101919091526040016000205463ffffffff1603606086015163ffffffff9190911660209091015260016009600060a088015160a0015160ff16815260208101919091526040016000205463ffffffff1603606086015163ffffffff90911660409190910152600160a060020a0386166330a8087060208701518e8e8e8e8e8e8d60600151518e60600151602001518f606001516040015160405163ffffffff8c811660e060020a0282526001604060020a039b8c166004830152998b166024820152978a1660448901529589166064880152938816608487015291871660a486015290951660c484015293831660e4830152928216610104820152911661012482015261014401600060405180830381600087803b151561276257600080fd5b6102c65a03f1151561277357600080fd5b50505033600160a060020a03167f26194856c6c579d36bc6b21531c958237d96b3f18856c8a745fd16e0133f1e8a8e87610100015160028111156127b357fe5b60405163ffffffff909216825260ff1660208201526040908101905180910390a250505050505050505050505050565b60005433600160a060020a039081169116146127fe57600080fd5b6002805460ff1916911515919091179055565b600a5468010000000000000000900463ffffffff1681565b60008061283461539b565b60025460ff161561284457600080fd5b600354600160a060020a0316151561285b57600080fd5b600454600160a060020a0316151561287257600080fd5b600554600160a060020a0316151561288957600080fd5b612898338a8a8a8a8a8a610b9f565b15156128a357600080fd5b600454600160a060020a031692508263a847a71c8a60006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b15156128ff57600080fd5b6102c65a03f1151561291057600080fd5b5050506040518051905080612993575082600160a060020a031663a847a71c8960006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b151561297757600080fd5b6102c65a03f1151561298857600080fd5b505050604051805190505b80612a0c575082600160a060020a031663a847a71c8860006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b15156129f057600080fd5b6102c65a03f11515612a0157600080fd5b505050604051805190505b80612a85575082600160a060020a031663a847a71c8760006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b1515612a6957600080fd5b6102c65a03f11515612a7a57600080fd5b505050604051805190505b80612afe575082600160a060020a031663a847a71c8660006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b1515612ae257600080fd5b6102c65a03f11515612af357600080fd5b505050604051805190505b80612b77575082600160a060020a031663a847a71c8560006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b1515612b5b57600080fd5b6102c65a03f11515612b6c57600080fd5b505050604051805190505b15612b8157600080fd5b600b5434811515612b8e57fe5b600a54919004925063ffffffff6801000000000000000090910481169083161015612bb857600080fd5b600160a060020a03331681528a8a806020601f820181900481020160405190810160405281815292919060208401838380828437505050506020840192909252505063ffffffff821660408201526001604060020a03808a166060830152888116608083015287811660a083015286811660c083015285811660e08301528416610100820152612c4781614993565b5050600e805434019055505050505050505050565b60005474010000000000000000000000000000000000000000900461ffff1681565b63ffffffff166000908152600860205260409020805460018201546002909201549092565b6000805433600160a060020a0390811691161480612cdf5750600160a060020a03331660009081526001602081905260409091205460ff161515145b1515612cea57600080fd5b30600160a060020a031631821115612d0157600080fd5b612d0f600e54600f54614c5f565b905080821115612d1e57600080fd5b600f805483019055600160a060020a03831682156108fc0283604051600060405180830381858888f1935050505015156112e057600080fd5b612d5f6153ee565b60025460009081906101009004600160a060020a0316816001604060020a03881681901115612e295781600160a060020a031662119f3489600060405160a0015260405160e060020a63ffffffff84160281526001604060020a03909116600482015260240160a060405180830381600087803b1515612dde57600080fd5b6102c65a03f11515612def57600080fd5b50505060405180519060200180519060200180519060200180519060200180515050901515602089015263ffffffff909216875290945092505b6000876001604060020a03161115612edf5781600160a060020a031662119f3488600060405160a0015260405160e060020a63ffffffff84160281526001604060020a03909116600482015260240160a060405180830381600087803b1515612e9157600080fd5b6102c65a03f11515612ea257600080fd5b50505060405180519060200180519060200180519060200180519060200180515050901515608089015263ffffffff909216606088015290945092505b6000866001604060020a03161115612f955781600160a060020a031662119f3487600060405160a0015260405160e060020a63ffffffff84160281526001604060020a03909116600482015260240160a060405180830381600087803b1515612f4757600080fd5b6102c65a03f11515612f5857600080fd5b5050506040518051906020018051906020018051906020018051906020018051505090151560e089015263ffffffff90921660c088015290945092505b50600354600160a060020a031660208501511561305857600160a060020a0381166362b21ad76000875163ffffffff16600080604051602001526040518463ffffffff1660e060020a02815260040180846004811115612ff157fe5b60ff168152602001836001604060020a03166001604060020a031681526020018281526020019350505050602060405180830381600087803b151561303557600080fd5b6102c65a03f1151561304657600080fd5b505050604051805160ff166040870152505b8460800151156131115780600160a060020a03166362b21ad76000876060015163ffffffff16600080604051602001526040518463ffffffff1660e060020a028152600401808460048111156130aa57fe5b60ff168152602001836001604060020a03166001604060020a031681526020018281526020019350505050602060405180830381600087803b15156130ee57600080fd5b6102c65a03f115156130ff57600080fd5b505050604051805160ff1660a0870152505b8460e00151156131cb5780600160a060020a03166362b21ad760008760c0015163ffffffff16600080604051602001526040518463ffffffff1660e060020a0281526004018084600481111561316357fe5b60ff168152602001836001604060020a03166001604060020a031681526020018281526020019350505050602060405180830381600087803b15156131a757600080fd5b6102c65a03f115156131b857600080fd5b505050604051805160ff16610100870152505b505050509392505050565b600a546d0100000000000000000000000000900460ff1681565b600a54670100000000000000900460ff1681565b60005433600160a060020a0390811691161461321f57600080fd5b600160a060020a03811660009081526001602052604090205460ff1615156132ab57600160a060020a03811660009081526001602081905260408220805460ff191682179055815461ffff7401000000000000000000000000000000000000000080830482169093011690910275ffff0000000000000000000000000000000000000000199091161790555b50565b601881565b600381565b6000806132c361525c565b60006132cd61525c565b600354600160a060020a0316915060008080806132e98a610e9a565b909450925063ffffffff8416151561330d5783600086819150985098509850613498565b6000915061331a83613f18565b9050600091505b60068210156133f05785600160a060020a03166362b21ad760038c856000604051602001526040518463ffffffff1660e060020a0281526004018084600481111561336857fe5b60ff168152602001836001604060020a03166001604060020a031681526020018281526020019350505050602060405180830381600087803b15156133ac57600080fd5b6102c65a03f115156133bd57600080fd5b505050604051805160ff1690508583600681106133d657fe5b61ffff909216602092909202015260019190910190613321565b600091505b63ffffffff841660009081526008602052604090206001015482101561348e5763ffffffff84166000908152600860205260409020600101805461346791908490811061343e57fe5b6000918252602091829020828204015460ff929091066101000a90048116906003840216614c73565b85836006811061347357fe5b6020020181815161ffff9101169052506001909101906133f5565b8381869850985098505b5050505050509193909250565b600a5460ff1681565b600a5462010000900460ff1681565b600a546c01000000000000000000000000900460ff1681565b600054600160a060020a031681565b6000806000806134f361543a565b6134fb61543a565b61350361543a565b60005433600160a060020a039081169116148061353e5750600160a060020a03331660009081526001602081905260409091205460ff161515145b151561354957600080fd5b600354600160a060020a0316151561356057600080fd5b6002546101009004600160a060020a0316151561357c57600080fd5b60035460025463ffffffff8a16600081815260086020526040808220600160a060020a039586169c506101009094049094169950975090955088916341b0eb53918891829051602001526040518363ffffffff1660e060020a028152600401808360048111156135e857fe5b60ff168152602001826001604060020a03166001604060020a0316815260200192505050602060405180830381600087803b151561362557600080fd5b6102c65a03f1151561363657600080fd5b505050604051805190509450846040518059106136505750595b908082528060200260200182016040525092505b600085111561373f5786600160a060020a03166362b21ad760008a63ffffffff16600189036000604051602001526040518463ffffffff1660e060020a028152600401808460048111156136b457fe5b60ff168152602001836001604060020a03166001604060020a031681526020018281526020019350505050602060405180830381600087803b15156136f857600080fd5b6102c65a03f1151561370957600080fd5b5050506040518051905083600187038151811061372257fe5b60ff90921660209283029091019091015260001990940193613664565b8383805161375192916020019061544c565b5086600160a060020a03166341b0eb5360018a63ffffffff166000604051602001526040518363ffffffff1660e060020a0281526004018083600481111561379557fe5b60ff168152602001826001604060020a03166001604060020a0316815260200192505050602060405180830381600087803b15156137d257600080fd5b6102c65a03f115156137e357600080fd5b505050604051805190509450846040518059106137fd5750595b908082528060200260200182016040525091505b60008511156138ec5786600160a060020a03166362b21ad760018a63ffffffff16600189036000604051602001526040518463ffffffff1660e060020a0281526004018084600481111561386157fe5b60ff168152602001836001604060020a03166001604060020a031681526020018281526020019350505050602060405180830381600087803b15156138a557600080fd5b6102c65a03f115156138b657600080fd5b505050604051805190508260018703815181106138cf57fe5b60ff90921660209283029091019091015260001990940193613811565b6001840182805161390192916020019061544c565b5085600160a060020a03166388e9abb689600080604051602001526040518363ffffffff1660e060020a028152600401808363ffffffff1663ffffffff16815260200182600181111561395057fe5b60ff16815260200192505050602060405180830381600087803b151561397557600080fd5b6102c65a03f1151561398657600080fd5b505050604051805190509450846040518059106139a05750595b908082528060200260200182016040525090505b6000851115613a865785600160a060020a0316635b626339896000600189036000604051602001526040518463ffffffff1660e060020a028152600401808463ffffffff1663ffffffff168152602001836001811115613a1057fe5b60ff1681526020018281526020019350505050602060405180830381600087803b1515613a3c57600080fd5b6102c65a03f11515613a4d57600080fd5b50505060405180519050816001870381518110613a6657fe5b63ffffffff909216602092830290910190910152600019909401936139b4565b60028401818051613a9b9291602001906154f2565b505050505050505050565b600d5481565b600654600160a060020a031681565b600a54640100000000900461ffff1681565b6000613ad761539b565b60025460ff1615613ae757600080fd5b600354600160a060020a03161515613afe57600080fd5b600454600160a060020a03161515613b1557600080fd5b600554600160a060020a03161515613b2c57600080fd5b600654600160a060020a03161515613b4357600080fd5b60065433600160a060020a03908116911614613b5e57600080fd5b613b6d8c898989898989610b9f565b1515613b7857600080fd5b600454600160a060020a031691508163a847a71c8960006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b1515613bd457600080fd5b6102c65a03f11515613be557600080fd5b5050506040518051905080613c68575081600160a060020a031663a847a71c8860006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b1515613c4c57600080fd5b6102c65a03f11515613c5d57600080fd5b505050604051805190505b80613ce1575081600160a060020a031663a847a71c8760006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b1515613cc557600080fd5b6102c65a03f11515613cd657600080fd5b505050604051805190505b80613d5a575081600160a060020a031663a847a71c8660006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b1515613d3e57600080fd5b6102c65a03f11515613d4f57600080fd5b505050604051805190505b80613dd3575081600160a060020a031663a847a71c8560006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b1515613db757600080fd5b6102c65a03f11515613dc857600080fd5b505050604051805190505b80613e4c575081600160a060020a031663a847a71c8460006040516020015260405160e060020a63ffffffff84160281526001604060020a039091166004820152602401602060405180830381600087803b1515613e3057600080fd5b6102c65a03f11515613e4157600080fd5b505050604051805190505b15613e5657600080fd5b600a5463ffffffff680100000000000000009091048116908c161015613e7b57600080fd5b600160a060020a038c1681528989806020601f820181900481020160405190810160405281815292919060208401838380828437505050506020840192909252505063ffffffff8b1660408201526001604060020a038089166060830152878116608083015286811660a083015285811660c083015284811660e08301528316610100820152613f0a81614993565b505050505050505050505050565b600060016064825b8160ff168360ff161015613f7257600260ff848401160460ff811660009081526009602052604090205490915063ffffffff9081169086161015613f6657809150613f6d565b8060010192505b613f20565b50909392505050565b60005433600160a060020a0390811691161480613fb65750600160a060020a03331660009081526001602081905260409091205460ff161515145b1515613fc157600080fd5b600354600160a060020a03161515613fd857600080fd5b6002546101009004600160a060020a03161515613ff457600080fd5b613ffd886134e5565b614006876134e5565b61400f866134e5565b614018856134e5565b614021846134e5565b61402a836134e5565b614033826134e5565b61403c816134e5565b5050505050505050565b60005433600160a060020a0390811691161461406157600080fd5b600160a060020a03811660009081526001602081905260409091205460ff16151514156132ab57600160a060020a03166000908152600160205260408120805460ff19169055805475ffff0000000000000000000000000000000000000000198116740100000000000000000000000000000000000000009182900461ffff9081166000190116909102179055565b600a546301000000900460ff1681565b600c5460ff1681565b6000806000614116615284565b600354600160a060020a031691506000826307202460878360405160e0015260405160e060020a63ffffffff84160281526001604060020a03909116600482015260240160e060405180830381600087803b151561417357600080fd5b6102c65a03f1151561418457600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160e08a0152505063ffffffff91821660808801908152600160a060020a039093166040880152921660208601526001604060020a0390921684529150516141fa8360800151613f18565b94509450505050915091565b60025460009081908190819060ff161561421f57600080fd5b600554600160a060020a0316151561423657600080fd5b600554600160a060020a031693508363f31dec5a8660006040516060015260405163ffffffff83811660e060020a028252919091166004820152602401606060405180830381600087803b151561428c57600080fd5b6102c65a03f1151561429d57600080fd5b50505060405180519060200180519060200180519295509093505063ffffffff16905033600160a060020a03908116908316146142d957600080fd5b600083111561433f5783600160a060020a0316634377c1cf8660405163ffffffff83811660e060020a028252919091166004820152602401600060405180830381600087803b151561432a57600080fd5b6102c65a03f1151561433b57600080fd5b5050505b8463ffffffff167f7896e0932299b049700f86ae09c1e775b823c8527fb25549987819578913046a60405160405180910390a25050505050565b600a54610100900460ff1681565b600681565b600080614397615284565b600354600160a060020a0316915081630720246086600060405160e0015260405160e060020a63ffffffff84160281526001604060020a03909116600482015260240160e060405180830381600087803b15156143f357600080fd5b6102c65a03f1151561440457600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805160e08901525063ffffffff90811660c088015290811660a08701529081166080860152600160a060020a0391821660408601908152921660208501526001604060020a0390921683529085169051600160a060020a031614801561449f5750806020015163ffffffff16601514155b92505b505092915050565b600e5481565b600554600160a060020a031681565b600a546601000000000000900460ff1681565b60025460ff1681565b60005433600160a060020a039081169116146144f657600080fd5b600160a060020a038116156132ab5760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600454600160a060020a031681565b60008161ffff168361ffff16111561455c5750808203614560565b5060005b92915050565b60008060008061457461525c565b61457c61525c565b600061458788614c9e565b600a54939a5090985090945092506145bf906601000000000000900460ff1660020160c08a0151601054600160a060020a0316611929565b9450600090505b600a546601000000000000900460ff1661ffff82161080156145ed57506000835161ffff16115b80156145fe57506000825161ffff16115b156146f15760a082015161ffff1660a084015161ffff1611156146b357600261ffff82160661ffff16600014156146755761466a8260005b60200201516146656020860151606087015160408701518760045b60200201518b60ff168861ffff1614610f8d565b614541565b61ffff1682526146ae565b61469b8360005b6020020151614665602085015160608601516040880151886004614651565b8360005b61ffff90921660209290920201525b6146e9565b600261ffff82160661ffff16156146d7576146cf826000614636565b82600061469f565b6146e283600061467c565b61ffff1683525b6001016145c6565b815161ffff16835161ffff16101593505050509193509193565b6005546000908190819081908190600160a060020a0316151561472d57600080fd5b600554600160a060020a031694508463bb583f198960006040516060015260405163ffffffff83811660e060020a028252919091166004820152602401606060405180830381600087803b151561478357600080fd5b6102c65a03f1151561479457600080fd5b505050604051805190602001805190602001805160065493975091955090935050600160a060020a03169050851561484a578163ffffffff168463ffffffff1610156148455780600160a060020a0316635fee0aac88600d5460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561483057600080fd5b6102c65a03f1151561484157600080fd5b5050505b61403c565b600a5463ffffffff83811691670100000000000000900460ff1690861681151561487057fe5b0463ffffffff161115614888578160020291506148af565b600a54670100000000000000900460ff1663ffffffff85168115156148a957fe5b04820191505b63ffffffff6001840181169083161161491f5784600160a060020a0316634377c1cf8960405163ffffffff83811660e060020a028252919091166004820152602401600060405180830381600087803b151561490a57600080fd5b6102c65a03f1151561491b57600080fd5b5050505b80600160a060020a0316635fee0aac33600d5460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561497557600080fd5b6102c65a03f1151561498657600080fd5b5050505050505050505050565b600554600160a060020a0316600080808363f8a74501865160006040516060015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401606060405180830381600087803b15156149f257600080fd5b6102c65a03f11515614a0357600080fd5b505050604051805190602001805190602001805192955090935090915050600063ffffffff84161180614a365750600082115b15614a4057600080fd5b600a54640100000000900461ffff16600160a060020a03851663d7ebf53d6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515614a9557600080fd5b6102c65a03f11515614aa657600080fd5b50505060405180519050101515614abc57600080fd5b600160a060020a03841663b5e5a50a86518760200151886060015189608001518a60a001518b60c001518c60e001518d61010001518e6040015160006040516020015260405163ffffffff8b811660e060020a028252600160a060020a038b16600483019081526001604060020a038a811660448501528981166064850152888116608485015287811660a485015286811660c4850152851660e4840152908316610104830152610120602483019081529091610124018a818151815260200191508051906020019080838360005b83811015614ba3578082015183820152602001614b8b565b50505050905090810190601f168015614bd05780820380516001836020036101000a031916815260200191505b509a5050505050505050505050602060405180830381600087803b1515614bf657600080fd5b6102c65a03f11515614c0757600080fd5b5050506040518051935085905051600160a060020a03167fb67c02473855217c5523d6db57e34ef9aeea067dffec2a3e33dc642f751dc1498460405163ffffffff909116815260200160405180910390a25050505050565b60008082841015614c6c57fe5b5050900390565b6000828202831580614c8f5750828482811515614c8c57fe5b04145b1515614c9757fe5b9392505050565b6000614ca861525c565b6000614cb261525c565b6000808080614cc189516132b8565b9099509750935060009250614cd960608a01516132b8565b90975095509250614cea8484614ea5565b61ffff90811660a08c01521660408a0152614d098460208b015161506b565b896040018181510161ffff16905250614d268360808b015161506b565b8960a0018181510161ffff16905250614d438460208b0151615161565b9150614d53838a60800151615161565b90506064896040015160208901510261ffff16811515614d6f57fe5b04602088018181510161ffff16905250606460408a015160608901510261ffff16811515614d9957fe5b04606088018181510161ffff16905250606460a08a015160208701510261ffff16811515614dc357fe5b04602086018181510161ffff16905250606460a08a015160608701510261ffff16811515614ded57fe5b04606086018181510161ffff1690525060648260408901510261ffff16811515614e1357fe5b04604088018181510161ffff1690525060648260808901510261ffff16811515614e3957fe5b04608088018181510161ffff1690525060648160408701510261ffff16811515614e5f57fe5b04604086018181510161ffff1690525060648160808701510261ffff16811515614e8557fe5b04608086018181510161ffff169052509698959750939550919392505050565b600080808080805b63ffffffff8816600090815260086020526040902054821015615030575060005b63ffffffff87166000908152600860205260409020548110156150255763ffffffff87166000908152600860205260409020805482908110614f0c57fe5b60009182526020808320818304015463ffffffff8c16845260088252604084208054929093066101000a900460ff1692600792909186908110614f4b57fe5b60009182526020808320818304015460ff928290066101000a9004821684528301939093526040909101902054161415614f8457600193505b63ffffffff88166000908152600860205260409020805483908110614fa557fe5b60009182526020808320818304015463ffffffff8b16845260088252604084208054929093066101000a900460ff1692600792909185908110614fe457fe5b60009182526020808320818304015460ff928290066101000a900482168452830193909352604090910190205416141561501d57600192505b600101614ece565b600190910190614ead565b831561504857600a5462010000900460ff1695909501945b821561506057600a5462010000900460ff1694909401935b505050509250929050565b63ffffffff821660009081526008602052604081206002015481908190818082111561514a575060009250825b8184101561514a5763ffffffff871660009081526008602052604090206002018054859081106150c457fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff169050856000015163ffffffff168163ffffffff1614806151195750856060015163ffffffff168163ffffffff16145b8061513357508560c0015163ffffffff168163ffffffff16145b1561513f576001830192505b600190930192615098565b600a5460ff90811684021694505050505092915050565b600080805b63ffffffff85166000908152600860205260409020548210156144a25763ffffffff851660009081526008602052604090208054839081106151a457fe5b6000918252602091829020828204015460ff918390066101000a9004169150840151156151f257836040015160ff168160ff1614156151f257600a54610100900460ff169290920191615251565b836080015115615223578360a0015160ff168160ff16141561522357600a54610100900460ff169290920191615251565b8360e00151156152515783610100015160ff168160ff16141561525157600a54610100900460ff1692909201915b600190910190615166565b60c06040519081016040526006815b60008152600019909101906020018161526b5790505090565b610100604051908101604090815260008083526020830181905290820152606081016152ae61543a565b8152600060208201819052604082018190526060820181905260809091015290565b610240604051908101604090815260008083526020830181905290820152606081016152fa61559d565b81526020016000815260200161530e61525c565b815260200161531b61559d565b815260006020820181905260409091015290565b60c06040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a082015290565b6102e060405190810160405260008152602081016153806153ee565b8152600060208201819052604082015260600161531b6153ee565b61012060405190810160405260008152602081016153b761543a565b815260006020820181905260408201819052606082018190526080820181905260a0820181905260c0820181905260e09091015290565b6101206040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820181905260c0820181905260e0820181905261010082015290565b60206040519081016040526000815290565b82805482825590600052602060002090601f016020900481019282156154e25791602002820160005b838211156154b357835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302615475565b80156154e05782816101000a81549060ff02191690556001016020816000010492830192600103026154b3565b505b506154ee9291506155b7565b5090565b828054828255906000526020600020906007016008900481019282156155915791602002820160005b8382111561555f57835183826101000a81548163ffffffff021916908363ffffffff160217905550926020019260040160208160030104928301926001030261551b565b801561558f5782816101000a81549063ffffffff021916905560040160208160030104928301926001030261555f565b505b506154ee9291506155d8565b60606040519081016040526000815260026020820161526b565b6155d591905b808211156154ee57805460ff191681556001016155bd565b90565b6155d591905b808211156154ee57805463ffffffff191681556001016155de5600a165627a7a723058202b831979f501351109f328cbe367bba312e320eddc5fb9538da8ec0394b041310029000000000000000000000000abc1c404424bdf24c19a5cc5ef8f47781d18eb3e0000000000000000000000001fc7bd85293f3982f40d52698df8d26be89360d60000000000000000000000004ba72f0f8dad13709ee28a992869e79d0fe4703000000000000000000000000075aa01dc00f6aeefe14bd58a5b6cbb091c6dc57b000000000000000000000000721da477f68c71788a262d58853fe6977d86535e

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

000000000000000000000000abc1c404424bdf24c19a5cc5ef8f47781d18eb3e0000000000000000000000001fc7bd85293f3982f40d52698df8d26be89360d60000000000000000000000004ba72f0f8dad13709ee28a992869e79d0fe4703000000000000000000000000075aa01dc00f6aeefe14bd58a5b6cbb091c6dc57b000000000000000000000000721da477f68c71788a262d58853fe6977d86535e

-----Decoded View---------------
Arg [0] : _dataContract (address): 0xabc1c404424bdf24c19a5cc5ef8f47781d18eb3e
Arg [1] : _worldContract (address): 0x1fc7bd85293f3982f40d52698df8d26be89360d6
Arg [2] : _tradeContract (address): 0x4ba72f0f8dad13709ee28a992869e79d0fe47030
Arg [3] : _castleContract (address): 0x75aa01dc00f6aeefe14bd58a5b6cbb091c6dc57b
Arg [4] : _paymentContract (address): 0x721da477f68c71788a262d58853fe6977d86535e

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 000000000000000000000000abc1c404424bdf24c19a5cc5ef8f47781d18eb3e
Arg [1] : 0000000000000000000000001fc7bd85293f3982f40d52698df8d26be89360d6
Arg [2] : 0000000000000000000000004ba72f0f8dad13709ee28a992869e79d0fe47030
Arg [3] : 00000000000000000000000075aa01dc00f6aeefe14bd58a5b6cbb091c6dc57b
Arg [4] : 000000000000000000000000721da477f68c71788a262d58853fe6977d86535e


Swarm Source

bzzr://2b831979f501351109f328cbe367bba312e320eddc5fb9538da8ec0394b04131
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.