Contract Overview
Balance: 0.16223783 Ether
Ether Value: $14.05 (@ $86.58/ETH)
Transactions: 215 txns
Misc:
Address Watch: Add To Watch List
Contract Creator: 0x686472a553271af53bf4bf92d6353d266a80cb51at txn 0x4f1a77c1c16e655cb57eeb7a648b0db854fccd5ef23531897c4783c071bcdc12
Token Balance:
 Latest 25 transactions from a total of 215 transactions

TxHash Age From To Value [TxFee]
0x08f9a9443402ce33adfd8661d7675012d860ca40041a6321628df839b3f1782588 days 7 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.0225963
0x0293b904e09322f5abc8ba742f7f366207d79b811bea8c80846b19728d6e5270140 days 10 hrs ago0x8e124e172d23c915a48f573c4a77b2da5662b152  IN   0xa44e464b13280340904ffef0a65b8a00334604300 Ether0.000084628
0xd01ec39b78eb28f151be2a2be71d5ea85ec4ca28aa4b322f7de437e010c94ea0140 days 10 hrs ago0x686472a553271af53bf4bf92d6353d266a80cb51  IN   0xa44e464b13280340904ffef0a65b8a00334604300 Ether0.000081939
0x67825084126c0a56184a7882757a8dbee672878744c0bbe504b4b7b0e6e9396b141 days 21 hrs ago0x4c3eb0aa279a5029b131f976e2ae8a5addf2eb73  IN   0xa44e464b13280340904ffef0a65b8a00334604300 Ether0.00088528
0xfd32dc0aaeeaa226465412a7aeefb1e696e7227a3fa9d88de22eb6402bbc7126143 days 11 hrs ago0x0c7aa5825879cdea1071dd693f78f38840355745  IN   0xa44e464b13280340904ffef0a65b8a00334604300 Ether0.000510702
0x9ce4ed45b358ee630d88262292a45e66e406adc8f51a0a9df0fa2da92dd6101a143 days 11 hrs ago0x0c7aa5825879cdea1071dd693f78f38840355745  IN   0xa44e464b13280340904ffef0a65b8a00334604300 Ether0.000510702
0x20088b21d4958fb22a0bd169d3f56f691d23472683af88f4c64526bfeb5d9f09146 days 10 hrs ago0x0c7aa5825879cdea1071dd693f78f38840355745  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.00054297
0xe48eddc4f6e83321e445cc9727244d03aa7879d9b542fbf360a36f558a6a8615146 days 11 hrs ago0x0c7aa5825879cdea1071dd693f78f38840355745  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.000361924
0xa57f2a8f5928f59e301e9bb53ccfefa11f96e0a9ee3dca5dc94e5a12781b226e146 days 13 hrs ago0x0c7aa5825879cdea1071dd693f78f38840355745  IN   0xa44e464b13280340904ffef0a65b8a00334604300 Ether0.000088582
0x4c3a7224ddb591ce2c4000042124b88931ed0d816247b6e2304f68098cdace13146 days 13 hrs ago0x0c7aa5825879cdea1071dd693f78f38840355745  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.00042187
0xd391d2f3768902c63be6af73d699d162a67b364050a7f4bb4c25d1435fbac0da146 days 15 hrs ago0x0c7aa5825879cdea1071dd693f78f38840355745  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.000869832
0x93d523570daec63e50d8266d2867c43ac9242e7b9749423e683682be7805ac62148 days 7 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.00489975
0x92897f8919d30af7c2c4c54b1c2c224042ef1c44f3cbd03bab1b14aeede7f5eb148 days 7 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300.01 Ether0.00111812
0xfd8626239aabe9a5f3cbe0c8a79050d5b65bc0e3fc2323462fb313246b15c987148 days 7 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.0195936
0x56f67710523bdcb35f90d4dade24e3452b667660f8d7ac0adc133b38111108be148 days 7 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.01945062
0x7877411ba0dedcb0a9b861f7aa9d03f61a5daf2799e6a3d220885c28f3645765148 days 7 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300.0112 Ether0.00978355
0x89977187bae3e40cbced7cbf5f1a169dc495b1cb866aba74df0766f46e0daa46148 days 7 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300.037 Ether0.0035453
0xc65f59e628a0929927c7372a32607cb0f0d8d7be5fb932053c5071d7007f78fb148 days 7 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300 Ether0.002296476
0x3a498f909806af1a3f2820663098b4269c7a71fa756a23cd54a0fe8088daea50148 days 7 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.00549888
0x76f22939a0d557748e920bfc33222fd5ff219f118fbe3a97918ba646af6fb881148 days 7 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300 Ether0.000043424
0x96f5259332bcc5d8d481a03d58062c4ffa0c8227aa195f0b36ab07c5d980c86e163 days 2 hrs ago0x0ec2a967e643dcb69d87da855a46887232010f93  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.00304944
0xf1e191dbfca0d12756a7b18d0c3adb306877f18c1461bf47440121c133196671167 days 3 hrs ago0x8e124e172d23c915a48f573c4a77b2da5662b152  IN   0xa44e464b13280340904ffef0a65b8a00334604300 Ether0.00106764
0xff65eebf148a9a48ed3eb976f94240a4419c41c29e46ed2280478c63c6ffea8e167 days 10 hrs ago0x686472a553271af53bf4bf92d6353d266a80cb51  IN   0xa44e464b13280340904ffef0a65b8a00334604300 Ether0.000041375
0x353efc6bf0f9714ad089bc11e5e106edafe344543af4dadd2f9f7a6e650233f5169 days 20 hrs ago0x28fb13eb570c23bf65f606431a6cc3ff34f41af0  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.002199552
0x7b76dae6ee79b462ac3b29e414b6a56a814411666c330b1f69130356cc85322e170 days 1 hr ago0x28fb13eb570c23bf65f606431a6cc3ff34f41af0  IN   0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether0.00289944
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 16 Internal Transactions

ParentTxHash Block Age From To Value
0x0293b904e09322f5abc8ba742f7f366207d79b811bea8c80846b19728d6e52706033757140 days 10 hrs ago0xa44e464b13280340904ffef0a65b8a00334604300x8e124e172d23c915a48f573c4a77b2da5662b1520.023082 Ether
0xd01ec39b78eb28f151be2a2be71d5ea85ec4ca28aa4b322f7de437e010c94ea06033723140 days 10 hrs ago0xa44e464b13280340904ffef0a65b8a00334604300x686472a553271af53bf4bf92d6353d266a80cb510.06778017 Ether
0xf1e191dbfca0d12756a7b18d0c3adb306877f18c1461bf47440121c1331966715876938167 days 3 hrs ago0xa44e464b13280340904ffef0a65b8a00334604300x8e124e172d23c915a48f573c4a77b2da5662b1520.18415 Ether
0xfd940e651f9708fc203281a8c8af862a7e46e28dcf1d666a150e5ec74d5eb2135863561169 days 10 hrs ago0x8ce8e3d21d8e4e3a83a4913b06460569180823660xa44e464b13280340904ffef0a65b8a00334604300.005 Ether
0xad8a86f4b9878343b744808f892fea08a7b41b9511a67b290bd71546124d9de55862190169 days 16 hrs ago0x98a28205f65235122dc55513aa817d15276d64c00xa44e464b13280340904ffef0a65b8a00334604300.005 Ether
0x6091d817696836a6f868b9a03f46287f57f72526f0a2ec060313805d7bfa88cf5856390170 days 16 hrs ago0x90d5e3005012cb146bcb04dd600ae6571cf695a70xa44e464b13280340904ffef0a65b8a00334604300.005 Ether
0x728763bb83dd76e23ac07b1d1c5000d4c7c892e2ca30f8e78766283d911676615856152170 days 17 hrs ago0x90d5e3005012cb146bcb04dd600ae6571cf695a70xa44e464b13280340904ffef0a65b8a00334604300.005 Ether
0xf537ff98c34a705a2cceca1ce08454bf4c8928a2b479b0fb68249b1cfbf018275856051170 days 18 hrs ago0x90d5e3005012cb146bcb04dd600ae6571cf695a70xa44e464b13280340904ffef0a65b8a00334604300.005 Ether
0x54c7fb86d14ef6780f53936e5a1164fbdc67a73131fc5c2324b6875037de31cf5855000170 days 22 hrs ago0x0e247a1af8cd280e594e68a9cd233e9f37e39b9f0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether
0x6fb040213846c4356b2fa17e85ef55506f1a4f735b2bf05b5052ece49d69be9a5854757170 days 23 hrs ago0x0e247a1af8cd280e594e68a9cd233e9f37e39b9f0xa44e464b13280340904ffef0a65b8a00334604300.005 Ether
0x0fd61deeb6b9d160a6cb07cc7d6df431c4031199c2d482ed2a2aed290818fca35854610171 days 19 mins ago0x148989973767054f7c5013a47a5a252ab50776280xa44e464b13280340904ffef0a65b8a00334604300.005 Ether
0x6a7c8af7dee4390564d7a0709565f0a77fdc50c2b98857aada998e7cdc0aad1e5852733171 days 8 hrs ago0xb77bd100f617a490d7eaa4f99bb64b10834347770xa44e464b13280340904ffef0a65b8a00334604300.005 Ether
0x5a6fd4c6e983d061172a1f440087e7ed8e5cb777be5d5db0ff2467fc204330dc5655765205 days 19 hrs ago0xa44e464b13280340904ffef0a65b8a00334604300x4c3eb0aa279a5029b131f976e2ae8a5addf2eb730.0025 Ether
0x2befa09f274cd49401c8c59e24ad338eb29e4bc1c0c570b0c127783253a4c68f5620759212 days 15 mins ago0xa44e464b13280340904ffef0a65b8a00334604300xc7ded8d808fc92e2f1696bf8b130e3f9984c75290.01625 Ether
0xb035355cf90870e0d1748a77ae42684f45b819bfed7befca05d298803f4c94ad5613924213 days 4 hrs ago0xa44e464b13280340904ffef0a65b8a00334604300x686472a553271af53bf4bf92d6353d266a80cb510.0297 Ether
0xb6e4b05745b668d355f3767807ad6b6ed59ab8b6be9f6cd43d81584a658357dc5611449213 days 15 hrs ago0xa44e464b13280340904ffef0a65b8a00334604300x8e124e172d23c915a48f573c4a77b2da5662b1520.0225 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: MyCryptoChampCore
Compiler Text: v0.4.23+commit.124ca40d
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity 0.4.23;


/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address internal contractOwner;

  constructor () internal {
    if(contractOwner == address(0)){
      contractOwner = msg.sender;
    }
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == contractOwner);
    _;
  }
  

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    contractOwner = newOwner;
  }

}


/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
  bool private paused = false;

  /**
   * @dev Modifier to allow actions only when the contract IS paused
     @dev If is paused msg.value is send back
   */
  modifier whenNotPaused() {
    if(paused == true && msg.value > 0){
      msg.sender.transfer(msg.value);
    }
    require(!paused);
    _;
  }


  /**
   * @dev Called by the owner to pause, triggers stopped state
   */
  function triggerPause() onlyOwner external {
    paused = !paused;
  }

}


/// @title A contract for creating new champs and making withdrawals
contract ChampFactory is Pausable{

    event NewChamp(uint256 champID, address owner);

    using SafeMath for uint; //SafeMath for overflow prevention

    /*
     * Variables
     */
    struct Champ {
        uint256 id; //same as position in Champ[]
        uint256 attackPower;
        uint256 defencePower;
        uint256 cooldownTime; //how long does it take to be ready attack again
        uint256 readyTime; //if is smaller than block.timestamp champ is ready to fight
        uint256 winCount;
        uint256 lossCount;
        uint256 position; //position in leaderboard. subtract 1 and you got position in leaderboard[]
        uint256 price; //selling price
        uint256 withdrawCooldown; //if you one of the 800 best champs and withdrawCooldown is less as block.timestamp then you get ETH reward
        uint256 eq_sword; 
        uint256 eq_shield; 
        uint256 eq_helmet; 
        bool forSale; //is champ for sale?
    }
    
    struct AddressInfo {
        uint256 withdrawal;
        uint256 champsCount;
        uint256 itemsCount;
        string name;
    }

    //Item struct
    struct Item {
        uint8 itemType; // 1 - Sword | 2 - Shield | 3 - Helmet
        uint8 itemRarity; // 1 - Common | 2 - Uncommon | 3 - Rare | 4 - Epic | 5 - Legendery | 6 - Forged
        uint256 attackPower;
        uint256 defencePower;
        uint256 cooldownReduction;
        uint256 price;
        uint256 onChampId; //can not be used to decide if item is on champ, because champ's id can be 0, 'bool onChamp' solves it.
        bool onChamp; 
        bool forSale; //is item for sale?
    }
    
    mapping (address => AddressInfo) public addressInfo;
    mapping (uint256 => address) public champToOwner;
    mapping (uint256 => address) public itemToOwner;
    mapping (uint256 => string) public champToName;
    
    Champ[] public champs;
    Item[] public items;
    uint256[] public leaderboard;
    
    uint256 internal createChampFee = 5 finney;
    uint256 internal lootboxFee = 5 finney;
    uint256 internal pendingWithdrawal = 0;
    uint256 private randNonce = 0; //being used in generating random numbers
    uint256 public champsForSaleCount;
    uint256 public itemsForSaleCount;
    

    /*
     * Modifiers
     */
    /// @dev Checks if msg.sender is owner of champ
    modifier onlyOwnerOfChamp(uint256 _champId) {
        require(msg.sender == champToOwner[_champId]);
        _;
    }
    

    /// @dev Checks if msg.sender is NOT owner of champ
    modifier onlyNotOwnerOfChamp(uint256 _champId) {
        require(msg.sender != champToOwner[_champId]);
        _;
    }
    

    /// @notice Checks if amount was sent
    modifier isPaid(uint256 _price){
        require(msg.value >= _price);
        _;
    }


    /// @notice People are allowed to withdraw only if min. balance (0.01 gwei) is reached
    modifier contractMinBalanceReached(){
        require( (address(this).balance).sub(pendingWithdrawal) > 1000000 );
        _;
    }


    /// @notice Checks if withdraw cooldown passed 
    modifier isChampWithdrawReady(uint256 _id){
        require(champs[_id].withdrawCooldown < block.timestamp);
        _;
    }


    /// @notice Distribute input funds between contract owner and players
    modifier distributeInput(address _affiliateAddress){

        //contract owner
        uint256 contractOwnerWithdrawal = (msg.value / 100) * 50; // 50%
        addressInfo[contractOwner].withdrawal += contractOwnerWithdrawal;
        pendingWithdrawal += contractOwnerWithdrawal;

        //affiliate
        //checks if _affiliateAddress is set & if affiliate address is not buying player
        if(_affiliateAddress != address(0) && _affiliateAddress != msg.sender){
            uint256 affiliateBonus = (msg.value / 100) * 25; //provision is 25%
            addressInfo[_affiliateAddress].withdrawal += affiliateBonus;
            pendingWithdrawal += affiliateBonus;
        }

        _;
    }



    /*
     * View
     */
    /// @notice Gets champs by address
    /// @param _owner Owner address
    function getChampsByOwner(address _owner) external view returns(uint256[]) {
        uint256[] memory result = new uint256[](addressInfo[_owner].champsCount);
        uint256 counter = 0;
        for (uint256 i = 0; i < champs.length; i++) {
            if (champToOwner[i] == _owner) {
                result[counter] = i;
                counter++;
            }
        }
        return result;
    }


    /// @notice Gets total champs count
    function getChampsCount() external view returns(uint256){
        return champs.length;
    }
    

    /// @notice Gets champ's reward in wei
    function getChampReward(uint256 _position) public view returns(uint256) {
        if(_position <= 800){
            //percentageMultipier = 10,000
            //maxReward = 2000 = .2% * percentageMultipier
            //subtractPerPosition = 2 = .0002% * percentageMultipier
            //2000 - (2 * (_position - 1))
            uint256 rewardPercentage = uint256(2000).sub(2 * (_position - 1));

            //available funds are all funds - already pending
            uint256 availableWithdrawal = address(this).balance.sub(pendingWithdrawal);

            //calculate reward for champ's position
            //1000000 = percentageMultipier * 100
            return availableWithdrawal / 1000000 * rewardPercentage;
        }else{
            return uint256(0);
        }
    }


    /*
     * Internal
     */
    /// @notice Generates random modulus
    /// @param _modulus Max random modulus
    function randMod(uint256 _modulus) internal returns(uint256) {
        randNonce++;
        return uint256(keccak256(randNonce, blockhash(block.number - 1))) % _modulus;
    }
    


    /*
     * External
     */
    /// @notice Creates new champ
    /// @param _affiliateAddress Affiliate address (optional)
    function createChamp(address _affiliateAddress) external payable 
    whenNotPaused
    isPaid(createChampFee) 
    distributeInput(_affiliateAddress) 
    {

        /* 
        Champ memory champ = Champ({
             id: 0,
             attackPower: 2 + randMod(4),
             defencePower: 1 + randMod(4),
             cooldownTime: uint256(1 days) - uint256(randMod(9) * 1 hours),
             readyTime: 0,
             winCount: 0,
             lossCount: 0,
             position: leaderboard.length + 1, //Last place in leaderboard is new champ's position. Used in new champ struct bellow. +1 to avoid zero position.
             price: 0,
             withdrawCooldown: uint256(block.timestamp), 
             eq_sword: 0,
             eq_shield: 0, 
             eq_helmet: 0, 
             forSale: false 
        });   
        */

        // This line bellow is about 30k gas cheaper than lines above. They are the same. Lines above are just more readable.
        uint256 id = champs.push(Champ(0, 2 + randMod(4), 1 + randMod(4), uint256(1 days)  - uint256(randMod(9) * 1 hours), 0, 0, 0, leaderboard.length + 1, 0, uint256(block.timestamp), 0,0,0, false)) - 1;     
        
        
        champs[id].id = id; //sets id in Champ struct  
        leaderboard.push(id); //push champ on the last place in leaderboard  
        champToOwner[id] = msg.sender; //sets owner of this champ - msg.sender
        addressInfo[msg.sender].champsCount++;

        emit NewChamp(id, msg.sender);

    }


    /// @notice Change "CreateChampFee". If ETH price will grow up it can expensive to create new champ.
    /// @param _fee New "CreateChampFee"
    /// @dev Only owner of contract can change "CreateChampFee"
    function setCreateChampFee(uint256 _fee) external onlyOwner {
        createChampFee = _fee;
    }
    

    /// @notice Change champ's name
    function changeChampsName(uint _champId, string _name) external 
    onlyOwnerOfChamp(_champId){
        champToName[_champId] = _name;
    }


    /// @notice Change players's name
    function changePlayersName(string _name) external {
        addressInfo[msg.sender].name = _name;
    }


    /// @notice Withdraw champ's reward
    /// @param _id Champ id
    /// @dev Move champ reward to pending withdrawal to his wallet. 
    function withdrawChamp(uint _id) external 
    onlyOwnerOfChamp(_id) 
    contractMinBalanceReached  
    isChampWithdrawReady(_id) 
    whenNotPaused {
        Champ storage champ = champs[_id];
        require(champ.position <= 800);

        champ.withdrawCooldown = block.timestamp + 1 days; //one withdrawal 1 per day

        uint256 withdrawal = getChampReward(champ.position);
        addressInfo[msg.sender].withdrawal += withdrawal;
        pendingWithdrawal += withdrawal;
    }
    

    /// @dev Send all pending funds of caller's address
    function withdrawToAddress(address _address) external 
    whenNotPaused {
        address playerAddress = _address;
        if(playerAddress == address(0)){ playerAddress = msg.sender; }
        uint256 share = addressInfo[playerAddress].withdrawal; //gets pending funds
        require(share > 0); //is it more than 0?

        //first sets players withdrawal pending to 0 and subtract amount from playerWithdrawals then transfer funds to avoid reentrancy
        addressInfo[playerAddress].withdrawal = 0; //set player's withdrawal pendings to 0 
        pendingWithdrawal = pendingWithdrawal.sub(share); //subtract share from total pendings 
        
        playerAddress.transfer(share); //transfer
    }
    
}



/// @title  Moderates items and creates new ones
contract Items is ChampFactory {

    event NewItem(uint256 itemID, address owner);

    constructor () internal {
        //item -> nothing
        items.push(Item(0, 0, 0, 0, 0, 0, 0, false, false));
    }

    /*
     * Modifiers
     */
    /// @notice Checks if sender is owner of item
    modifier onlyOwnerOfItem(uint256 _itemId) {
        require(_itemId != 0);
        require(msg.sender == itemToOwner[_itemId]);
        _;
    }
    

    /// @notice Checks if sender is NOT owner of item
    modifier onlyNotOwnerOfItem(uint256 _itemId) {
        require(msg.sender != itemToOwner[_itemId]);
        _;
    }


    /*
     * View
     */
    ///@notice Check if champ has something on
    ///@param _type Sword, shield or helmet
    function hasChampSomethingOn(uint _champId, uint8 _type) internal view returns(bool){
        Champ storage champ = champs[_champId];
        if(_type == 1){
            return (champ.eq_sword == 0) ? false : true;
        }
        if(_type == 2){
            return (champ.eq_shield == 0) ? false : true;
        }
        if(_type == 3){
            return (champ.eq_helmet == 0) ? false : true;
        }
    }


    /// @notice Gets items by address
    /// @param _owner Owner address
    function getItemsByOwner(address _owner) external view returns(uint256[]) {
        uint256[] memory result = new uint256[](addressInfo[_owner].itemsCount);
        uint256 counter = 0;
        for (uint256 i = 0; i < items.length; i++) {
            if (itemToOwner[i] == _owner) {
                result[counter] = i;
                counter++;
            }
        }
        return result;
    }


    /*
     * Public
     */
    ///@notice Takes item off champ
    function takeOffItem(uint _champId, uint8 _type) public 
        onlyOwnerOfChamp(_champId) {
            uint256 itemId;
            Champ storage champ = champs[_champId];
            if(_type == 1){
                itemId = champ.eq_sword; //Get item ID
                if (itemId > 0) { //0 = nothing
                    champ.eq_sword = 0; //take off sword
                }
            }
            if(_type == 2){
                itemId = champ.eq_shield; //Get item ID
                if(itemId > 0) {//0 = nothing
                    champ.eq_shield = 0; //take off shield
                }
            }
            if(_type == 3){
                itemId = champ.eq_helmet; //Get item ID
                if(itemId > 0) { //0 = nothing
                    champ.eq_helmet = 0; //take off 
                }
            }
            if(itemId > 0){
                items[itemId].onChamp = false; //item is free to use, is not on champ
            }
    }



    /*
     * External
     */
    ///@notice Puts item on champ
    function putOn(uint256 _champId, uint256 _itemId) external 
        onlyOwnerOfChamp(_champId) 
        onlyOwnerOfItem(_itemId) {
            Champ storage champ = champs[_champId];
            Item storage item = items[_itemId];

            //checks if items is on some other champ
            if(item.onChamp){
                takeOffItem(item.onChampId, item.itemType); //take off from champ
            }

            item.onChamp = true; //item is on champ
            item.onChampId = _champId; //champ's id

            //put on
            if(item.itemType == 1){
                //take off actual sword 
                if(champ.eq_sword > 0){
                    takeOffItem(champ.id, 1);
                }
                champ.eq_sword = _itemId; //put on sword
            }
            if(item.itemType == 2){
                //take off actual shield 
                if(champ.eq_shield > 0){
                    takeOffItem(champ.id, 2);
                }
                champ.eq_shield = _itemId; //put on shield
            }
            if(item.itemType == 3){
                //take off actual helmet 
                if(champ.eq_helmet > 0){
                    takeOffItem(champ.id, 3);
                }
                champ.eq_helmet = _itemId; //put on helmet
            }
    }



    /// @notice Opens loot box and generates new item
    function openLootbox(address _affiliateAddress) external payable 
    whenNotPaused
    isPaid(lootboxFee) 
    distributeInput(_affiliateAddress) {

        uint256 pointToCooldownReduction;
        uint256 randNum = randMod(1001); //random number <= 1000
        uint256 pointsToShare; //total points given
        uint256 itemID;

        //sets up item
        Item memory item = Item({
            itemType: uint8(uint256(randMod(3) + 1)), //generates item type - max num is 2 -> 0 + 1 SWORD | 1 + 1 SHIELD | 2 + 1 HELMET;
            itemRarity: uint8(0),
            attackPower: 0,
            defencePower: 0,
            cooldownReduction: 0,
            price: 0,
            onChampId: 0,
            onChamp: false,
            forSale: false
        });
        
        // Gets Rarity of item
        // 45% common
        // 27% uncommon
        // 19% rare
        // 7%  epic
        // 2%  legendary
        if(450 > randNum){
            pointsToShare = 25 + randMod(9); //25 basic + random number max to 8
            item.itemRarity = uint8(1);
        }else if(720 > randNum){
            pointsToShare = 42 + randMod(17); //42 basic + random number max to 16
            item.itemRarity = uint8(2);
        }else if(910 > randNum){
            pointsToShare = 71 + randMod(25); //71 basic + random number max to 24
            item.itemRarity = uint8(3);
        }else if(980 > randNum){
            pointsToShare = 119 + randMod(33); //119 basic + random number max to 32
            item.itemRarity = uint8(4);
        }else{
            pointsToShare = 235 + randMod(41); //235 basic + random number max to 40
            item.itemRarity = uint8(5);
        }
        

        //Gets type of item
        if(item.itemType == uint8(1)){ //ITEM IS SWORDS
            item.attackPower = pointsToShare / 10 * 7; //70% attackPower
            pointsToShare -= item.attackPower; //points left;
                
            item.defencePower = pointsToShare / 10 * randMod(6); //up to 15% defencePower
            pointsToShare -= item.defencePower; //points left;
                
            item.cooldownReduction = pointsToShare * uint256(1 minutes); //rest of points is cooldown reduction
            item.itemType = uint8(1);
        }
        
        if(item.itemType == uint8(2)){ //ITEM IS SHIELD
            item.defencePower = pointsToShare / 10 * 7; //70% defencePower
            pointsToShare -= item.defencePower; //points left;
                
            item.attackPower = pointsToShare / 10 * randMod(6); //up to 15% attackPowerPower
            pointsToShare -= item.attackPower; //points left;
                
            item.cooldownReduction = pointsToShare * uint256(1 minutes); //rest of points is cooldown reduction
            item.itemType = uint8(2);
        }
        
        if(item.itemType == uint8(3)){ //ITEM IS HELMET
            pointToCooldownReduction = pointsToShare / 10 * 7; //70% cooldown reduction
            item.cooldownReduction = pointToCooldownReduction * uint256(1 minutes); //points to time
            pointsToShare -= pointToCooldownReduction; //points left;
                
            item.attackPower = pointsToShare / 10 * randMod(6); //up to 15% attackPower
            pointsToShare -= item.attackPower; //points left;
                
            item.defencePower = pointsToShare; //rest of points is defencePower
            item.itemType = uint8(3);
        }

        itemID = items.push(item) - 1;
        
        itemToOwner[itemID] = msg.sender; //sets owner of this item - msg.sender
        addressInfo[msg.sender].itemsCount++; //every address has count of items    

        emit NewItem(itemID, msg.sender);    

    }

    /// @notice Change "lootboxFee". 
    /// @param _fee New "lootboxFee"
    /// @dev Only owner of contract can change "lootboxFee"
    function setLootboxFee(uint _fee) external onlyOwner {
        lootboxFee = _fee;
    }
}



/// @title Moderates buying and selling items
contract ItemMarket is Items {

    event TransferItem(address from, address to, uint256 itemID);

    /*
     * Modifiers
     */
    ///@notice Checks if item is for sale
    modifier itemIsForSale(uint256 _id){
        require(items[_id].forSale);
        _;
    }

    ///@notice Checks if item is NOT for sale
    modifier itemIsNotForSale(uint256 _id){
        require(items[_id].forSale == false);
        _;
    }

    ///@notice If item is for sale then cancel sale
    modifier ifItemForSaleThenCancelSale(uint256 _itemID){
      Item storage item = items[_itemID];
      if(item.forSale){
          _cancelItemSale(item);
      }
      _;
    }


    ///@notice Distribute sale eth input
    modifier distributeSaleInput(address _owner) { 
        uint256 contractOwnerCommision; //1%
        uint256 playerShare; //99%
        
        if(msg.value > 100){
            contractOwnerCommision = (msg.value / 100);
            playerShare = msg.value - contractOwnerCommision;
        }else{
            contractOwnerCommision = 0;
            playerShare = msg.value;
        }

        addressInfo[_owner].withdrawal += playerShare;
        addressInfo[contractOwner].withdrawal += contractOwnerCommision;
        pendingWithdrawal += playerShare + contractOwnerCommision;
        _;
    }



    /*
     * View
     */
    function getItemsForSale() view external returns(uint256[]){
        uint256[] memory result = new uint256[](itemsForSaleCount);
        if(itemsForSaleCount > 0){
            uint256 counter = 0;
            for (uint256 i = 0; i < items.length; i++) {
                if (items[i].forSale == true) {
                    result[counter]=i;
                    counter++;
                }
            }
        }
        return result;
    }
    
     /*
     * Private
     */
    ///@notice Cancel sale. Should not be called without checking if item is really for sale.
    function _cancelItemSale(Item storage item) private {
      //No need to overwrite item's price
      item.forSale = false;
      itemsForSaleCount--;
    }


    /*
     * Internal
     */
    /// @notice Transfer item
    function transferItem(address _from, address _to, uint256 _itemID) internal 
      ifItemForSaleThenCancelSale(_itemID) {
        Item storage item = items[_itemID];

        //take off      
        if(item.onChamp && _to != champToOwner[item.onChampId]){
          takeOffItem(item.onChampId, item.itemType);
        }

        addressInfo[_to].itemsCount++;
        addressInfo[_from].itemsCount--;
        itemToOwner[_itemID] = _to;

        emit TransferItem(_from, _to, _itemID);
    }



    /*
     * Public
     */
    /// @notice Calls transfer item
    /// @notice Address _from is msg.sender. Cannot be used is market, bc msg.sender is buyer
    function giveItem(address _to, uint256 _itemID) public 
      onlyOwnerOfItem(_itemID) {
        transferItem(msg.sender, _to, _itemID);
    }
    

    /// @notice Calcels item's sale
    function cancelItemSale(uint256 _id) public 
    itemIsForSale(_id) 
    onlyOwnerOfItem(_id){
      Item storage item = items[_id];
       _cancelItemSale(item);
    }


    /*
     * External
     */
    /// @notice Sets item for sale
    function setItemForSale(uint256 _id, uint256 _price) external 
      onlyOwnerOfItem(_id) 
      itemIsNotForSale(_id) {
        Item storage item = items[_id];
        item.forSale = true;
        item.price = _price;
        itemsForSaleCount++;
    }
    
    
    /// @notice Buys item
    function buyItem(uint256 _id) external payable 
      whenNotPaused 
      onlyNotOwnerOfItem(_id) 
      itemIsForSale(_id) 
      isPaid(items[_id].price) 
      distributeSaleInput(itemToOwner[_id]) 
      {
        transferItem(itemToOwner[_id], msg.sender, _id);
    }
    
}



/// @title Manages forging
contract ItemForge is ItemMarket {

	event Forge(uint256 forgedItemID);

	///@notice Forge items together
	function forgeItems(uint256 _parentItemID, uint256 _childItemID) external 
	onlyOwnerOfItem(_parentItemID) 
	onlyOwnerOfItem(_childItemID) 
	ifItemForSaleThenCancelSale(_parentItemID) 
	ifItemForSaleThenCancelSale(_childItemID) {

		//checks if items are not the same
        require(_parentItemID != _childItemID);
        
		Item storage parentItem = items[_parentItemID];
		Item storage childItem = items[_childItemID];

		//take child item off, because child item will be burned
		if(childItem.onChamp){
			takeOffItem(childItem.onChampId, childItem.itemType);
		}

		//update parent item
		parentItem.attackPower = (parentItem.attackPower > childItem.attackPower) ? parentItem.attackPower : childItem.attackPower;
		parentItem.defencePower = (parentItem.defencePower > childItem.defencePower) ? parentItem.defencePower : childItem.defencePower;
		parentItem.cooldownReduction = (parentItem.cooldownReduction > childItem.cooldownReduction) ? parentItem.cooldownReduction : childItem.cooldownReduction;
		parentItem.itemRarity = uint8(6);

		//burn child item
		transferItem(msg.sender, address(0), _childItemID);

		emit Forge(_parentItemID);
	}

}


/// @title Manages attacks in game
contract ChampAttack is ItemForge {
    
    event Attack(uint256 winnerChampID, uint256 defeatedChampID, bool didAttackerWin);

    /*
     * Modifiers
     */
     /// @notice Is champ ready to fight again?
    modifier isChampReady(uint256 _champId) {
      require (champs[_champId].readyTime <= block.timestamp);
      _;
    }


    /// @notice Prevents from self-attack
    modifier notSelfAttack(uint256 _champId, uint256 _targetId) {
        require(_champId != _targetId); 
        _;
    }


    /// @notice Checks if champ does exist
    modifier targetExists(uint256 _targetId){
        require(champToOwner[_targetId] != address(0)); 
        _;
    }


    /*
     * View
     */
    /// @notice Gets champ's attack power, defence power and cooldown reduction with items on
    function getChampStats(uint256 _champId) public view returns(uint256,uint256,uint256){
        Champ storage champ = champs[_champId];
        Item storage sword = items[champ.eq_sword];
        Item storage shield = items[champ.eq_shield];
        Item storage helmet = items[champ.eq_helmet];

        //AP
        uint256 totalAttackPower = champ.attackPower + sword.attackPower + shield.attackPower + helmet.attackPower; //Gets champs AP

        //DP
        uint256 totalDefencePower = champ.defencePower + sword.defencePower + shield.defencePower + helmet.defencePower; //Gets champs  DP

        //CR
        uint256 totalCooldownReduction = sword.cooldownReduction + shield.cooldownReduction + helmet.cooldownReduction; //Gets  CR

        return (totalAttackPower, totalDefencePower, totalCooldownReduction);
    }


    /*
     * Pure
     */
    /// @notice Subtracts ability points. Helps to not cross minimal attack ability points -> 2
    /// @param _playerAttackPoints Actual player's attack points
    /// @param _x Amount to subtract 
    function subAttack(uint256 _playerAttackPoints, uint256 _x) internal pure returns (uint256) {
        return (_playerAttackPoints <= _x + 2) ? 2 : _playerAttackPoints - _x;
    }
    

    /// @notice Subtracts ability points. Helps to not cross minimal defence ability points -> 1
    /// @param _playerDefencePoints Actual player's defence points
    /// @param _x Amount to subtract 
    function subDefence(uint256 _playerDefencePoints, uint256 _x) internal pure returns (uint256) {
        return (_playerDefencePoints <= _x) ? 1 : _playerDefencePoints - _x;
    }
    

    /*
     * Private
     */
    /// @dev Is called from from Attack function after the winner is already chosen
    /// @dev Updates abilities, champ's stats and swaps positions
    function _attackCompleted(Champ storage _winnerChamp, Champ storage _defeatedChamp, uint256 _pointsGiven, uint256 _pointsToAttackPower) private {
        /*
         * Updates abilities after fight
         */
        //winner abilities update
        _winnerChamp.attackPower += _pointsToAttackPower; //increase attack power
        _winnerChamp.defencePower += _pointsGiven - _pointsToAttackPower; //max point that was given - already given to AP
                
        //defeated champ's abilities update
        //checks for not cross minimal AP & DP points
        _defeatedChamp.attackPower = subAttack(_defeatedChamp.attackPower, _pointsToAttackPower); //decrease attack power
        _defeatedChamp.defencePower = subDefence(_defeatedChamp.defencePower, _pointsGiven - _pointsToAttackPower); // decrease defence power



        /*
         * Update champs' wins and losses
         */
        _winnerChamp.winCount++;
        _defeatedChamp.lossCount++;
            


        /*
         * Swap positions
         */
        if(_winnerChamp.position > _defeatedChamp.position) { //require loser to has better (lower) postion than attacker
            uint256 winnerPosition = _winnerChamp.position;
            uint256 loserPosition = _defeatedChamp.position;
        
            _defeatedChamp.position = winnerPosition;
            _winnerChamp.position = loserPosition;
        
            //position in champ struct is always one point bigger than in leaderboard array
            leaderboard[winnerPosition - 1] = _defeatedChamp.id;
            leaderboard[loserPosition - 1] = _winnerChamp.id;
        }
    }
    
    
    /// @dev Gets pointsGiven and pointsToAttackPower
    function _getPoints(uint256 _pointsGiven) private returns (uint256 pointsGiven, uint256 pointsToAttackPower){
        return (_pointsGiven, randMod(_pointsGiven+1));
    }



    /*
     * External
     */
    /// @notice Attack function
    /// @param _champId Attacker champ
    /// @param _targetId Target champ
    function attack(uint256 _champId, uint256 _targetId) external 
    onlyOwnerOfChamp(_champId) 
    isChampReady(_champId) 
    notSelfAttack(_champId, _targetId) 
    targetExists(_targetId) {
        Champ storage myChamp = champs[_champId]; 
        Champ storage enemyChamp = champs[_targetId]; 
        uint256 pointsGiven; //total points that will be divided between AP and DP
        uint256 pointsToAttackPower; //part of points that will be added to attack power, the rest of points go to defence power
        uint256 myChampAttackPower;  
        uint256 enemyChampDefencePower; 
        uint256 myChampCooldownReduction;
        
        (myChampAttackPower,,myChampCooldownReduction) = getChampStats(_champId);
        (,enemyChampDefencePower,) = getChampStats(_targetId);


        //if attacker's AP is more than target's DP then attacker wins
        if (myChampAttackPower > enemyChampDefencePower) {
            
            //this should demotivate players from farming on way weaker champs than they are
            //the bigger difference between AP & DP is, the reward is smaller
            if(myChampAttackPower - enemyChampDefencePower < 5){
                
                //big experience - 3 ability points
                (pointsGiven, pointsToAttackPower) = _getPoints(3);
                
                
            }else if(myChampAttackPower - enemyChampDefencePower < 10){
                
                //medium experience - 2 ability points
                (pointsGiven, pointsToAttackPower) = _getPoints(2);
                
            }else{
                
                //small experience - 1 ability point to random ability (attack power or defence power)
                (pointsGiven, pointsToAttackPower) = _getPoints(1);
                
            }
            
            _attackCompleted(myChamp, enemyChamp, pointsGiven, pointsToAttackPower);

            emit Attack(myChamp.id, enemyChamp.id, true);

        } else {
            
            //1 ability point to random ability (attack power or defence power)
            (pointsGiven, pointsToAttackPower) = _getPoints(1);

            _attackCompleted(enemyChamp, myChamp, pointsGiven, pointsToAttackPower);

            emit Attack(enemyChamp.id, myChamp.id, false);
             
        }
        
        //Trigger cooldown for attacker
        myChamp.readyTime = uint256(block.timestamp + myChamp.cooldownTime - myChampCooldownReduction);

    }
    
}


/// @title Moderates buying and selling champs
contract ChampMarket is ChampAttack {

    event TransferChamp(address from, address to, uint256 champID);

    /*
     * Modifiers
     */
    ///@notice Require champ to be sale
    modifier champIsForSale(uint256 _id){
        require(champs[_id].forSale);
        _;
    }
    

    ///@notice Require champ NOT to be for sale
    modifier champIsNotForSale(uint256 _id){
        require(champs[_id].forSale == false);
        _;
    }
    

    ///@notice If champ is for sale then cancel sale
    modifier ifChampForSaleThenCancelSale(uint256 _champID){
      Champ storage champ = champs[_champID];
      if(champ.forSale){
          _cancelChampSale(champ);
      }
      _;
    }
    

    /*
     * View
     */
    ///@notice Gets all champs for sale
    function getChampsForSale() view external returns(uint256[]){
        uint256[] memory result = new uint256[](champsForSaleCount);
        if(champsForSaleCount > 0){
            uint256 counter = 0;
            for (uint256 i = 0; i < champs.length; i++) {
                if (champs[i].forSale == true) {
                    result[counter]=i;
                    counter++;
                }
            }
        }
        return result;
    }
    
    
    /*
     * Private
     */
     ///@dev Cancel sale. Should not be called without checking if champ is really for sale.
     function _cancelChampSale(Champ storage champ) private {
        //cancel champ's sale
        //no need waste gas to overwrite his price.
        champ.forSale = false;
        champsForSaleCount--;
     }
     

    /*
     * Internal
     */
    /// @notice Transfer champ
    function transferChamp(address _from, address _to, uint256 _champId) internal ifChampForSaleThenCancelSale(_champId){
        Champ storage champ = champs[_champId];

        //transfer champ
        addressInfo[_to].champsCount++;
        addressInfo[_from].champsCount--;
        champToOwner[_champId] = _to;

        //transfer items
        if(champ.eq_sword != 0) { transferItem(_from, _to, champ.eq_sword); }
        if(champ.eq_shield != 0) { transferItem(_from, _to, champ.eq_shield); }
        if(champ.eq_helmet != 0) { transferItem(_from, _to, champ.eq_helmet); }

        emit TransferChamp(_from, _to, _champId);
    }



    /*
     * Public
     */
    /// @notice Champ is no more for sale
    function cancelChampSale(uint256 _id) public 
      champIsForSale(_id) 
      onlyOwnerOfChamp(_id) {
        Champ storage champ = champs[_id];
        _cancelChampSale(champ);
    }


    /*
     * External
     */
    /// @notice Gift champ
    /// @dev Address _from is msg.sender
    function giveChamp(address _to, uint256 _champId) external 
      onlyOwnerOfChamp(_champId) {
        transferChamp(msg.sender, _to, _champId);
    }


    /// @notice Sets champ for sale
    function setChampForSale(uint256 _id, uint256 _price) external 
      onlyOwnerOfChamp(_id) 
      champIsNotForSale(_id) {
        Champ storage champ = champs[_id];
        champ.forSale = true;
        champ.price = _price;
        champsForSaleCount++;
    }
    
    
    /// @notice Buys champ
    function buyChamp(uint256 _id) external payable 
      whenNotPaused 
      onlyNotOwnerOfChamp(_id) 
      champIsForSale(_id) 
      isPaid(champs[_id].price) 
      distributeSaleInput(champToOwner[_id]) {
        transferChamp(champToOwner[_id], msg.sender, _id);
    }
    
}



/// @title Only used for deploying all contracts
contract MyCryptoChampCore is ChampMarket {
	/* 
		© Copyright 2018 - Patrik Mojzis
		Redistributing and modifying is prohibited.
		
		https://mycryptochamp.io/

		What is MyCryptoChamp?
		- Blockchain game about upgrading champs by fighting, getting better items,
		  trading them and the best 800 champs are daily rewarded by real Ether.

		Feel free to ask any questions
		[email protected]
	*/
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"getItemsForSale","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"itemsForSaleCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"itemToOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"champsForSaleCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"addressInfo","outputs":[{"name":"withdrawal","type":"uint256"},{"name":"champsCount","type":"uint256"},{"name":"itemsCount","type":"uint256"},{"name":"name","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"getItemsByOwner","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getChampsCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_affiliateAddress","type":"address"}],"name":"openLootbox","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"withdrawChamp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_parentItemID","type":"uint256"},{"name":"_childItemID","type":"uint256"}],"name":"forgeItems","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_champId","type":"uint256"}],"name":"getChampStats","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_champId","type":"uint256"},{"name":"_itemId","type":"uint256"}],"name":"putOn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getChampsForSale","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"cancelChampSale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"buyChamp","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"changePlayersName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_champId","type":"uint256"}],"name":"giveChamp","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"triggerPause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"champToName","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_affiliateAddress","type":"address"}],"name":"createChamp","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"_position","type":"uint256"}],"name":"getChampReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"}],"name":"withdrawToAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_price","type":"uint256"}],"name":"setItemForSale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_champId","type":"uint256"},{"name":"_name","type":"string"}],"name":"changeChampsName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"leaderboard","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"items","outputs":[{"name":"itemType","type":"uint8"},{"name":"itemRarity","type":"uint8"},{"name":"attackPower","type":"uint256"},{"name":"defencePower","type":"uint256"},{"name":"cooldownReduction","type":"uint256"},{"name":"price","type":"uint256"},{"name":"onChampId","type":"uint256"},{"name":"onChamp","type":"bool"},{"name":"forSale","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"cancelItemSale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"champs","outputs":[{"name":"id","type":"uint256"},{"name":"attackPower","type":"uint256"},{"name":"defencePower","type":"uint256"},{"name":"cooldownTime","type":"uint256"},{"name":"readyTime","type":"uint256"},{"name":"winCount","type":"uint256"},{"name":"lossCount","type":"uint256"},{"name":"position","type":"uint256"},{"name":"price","type":"uint256"},{"name":"withdrawCooldown","type":"uint256"},{"name":"eq_sword","type":"uint256"},{"name":"eq_shield","type":"uint256"},{"name":"eq_helmet","type":"uint256"},{"name":"forSale","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setCreateChampFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_itemID","type":"uint256"}],"name":"giveItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_champId","type":"uint256"},{"name":"_type","type":"uint8"}],"name":"takeOffItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setLootboxFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_champId","type":"uint256"},{"name":"_targetId","type":"uint256"}],"name":"attack","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"buyItem","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_price","type":"uint256"}],"name":"setChampForSale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"getChampsByOwner","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"champToOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"champID","type":"uint256"}],"name":"TransferChamp","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"winnerChampID","type":"uint256"},{"indexed":false,"name":"defeatedChampID","type":"uint256"},{"indexed":false,"name":"didAttackerWin","type":"bool"}],"name":"Attack","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"forgedItemID","type":"uint256"}],"name":"Forge","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"itemID","type":"uint256"}],"name":"TransferItem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"itemID","type":"uint256"},{"indexed":false,"name":"owner","type":"address"}],"name":"NewItem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"champID","type":"uint256"},{"indexed":false,"name":"owner","type":"address"}],"name":"NewChamp","type":"event"}]

  Contract Creation Code Switch To Opcodes View
608060405260008060146101000a81548160ff0219169083151502179055506611c37937e080006008556611c37937e080006009556000600a556000600b55600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156100d557336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600661012060405190810160405280600060ff168152602001600060ff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001600015158152509080600181540180825580915050906001820390600052602060002090600702016000909192909190915060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160010155606082015181600201556080820151816003015560a0820151816004015560c0820151816005015560e08201518160060160006101000a81548160ff0219169083151502179055506101008201518160060160016101000a81548160ff02191690831515021790555050505061458a8061021d6000396000f3006080604052600436106101d8576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063064ddd04146101dd578063132ac1dd146102495780631a4d96cd146102745780631abd409d146102e15780632126fcb21461030c5780632c67a8e5146103dd578063317ab6dc1461047557806333dddc3a146104a057806333fb1e05146104d657806341d9cc431461050357806344f06bc71461053a5780634506e64d1461058957806346d6b1e8146105c05780634a800b981461062c5780634f72e1c31461065957806354c9cc44146106795780635e1d832d146106b45780636833f60d14610701578063736e077b14610718578063780bbe60146107be57806394b5c9f3146107f4578063a92bd72c14610835578063acf50f5514610878578063bcb98ba2146108af578063bf368399146108f4578063bfb231d214610935578063bfc38592146109c2578063c5af6257146109ef578063d0220b1c14610a8f578063d86afbbb14610abc578063db9f16a814610b09578063dcf219f214610b43578063e1fa763814610b70578063e7fb74c714610ba7578063ef2d44c314610bc7578063f0c41bb214610bfe578063f2fde38b14610c96578063f81b25c914610cd9575b600080fd5b3480156101e957600080fd5b506101f2610d46565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561023557808201518184015260208101905061021a565b505050509050019250505060405180910390f35b34801561025557600080fd5b5061025e610e18565b6040518082815260200191505060405180910390f35b34801561028057600080fd5b5061029f60048036038101908080359060200190929190505050610e1e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102ed57600080fd5b506102f6610e51565b6040518082815260200191505060405180910390f35b34801561031857600080fd5b5061034d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e57565b6040518085815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561039f578082015181840152602081019050610384565b50505050905090810190601f1680156103cc5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156103e957600080fd5b5061041e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f1f565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610461578082015181840152602081019050610446565b505050509050019250505060405180910390f35b34801561048157600080fd5b5061048a611054565b6040518082815260200191505060405180910390f35b6104d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611061565b005b3480156104e257600080fd5b5061050160048036038101908080359060200190929190505050611761565b005b34801561050f57600080fd5b506105386004803603810190808035906020019092919080359060200190929190505050611981565b005b34801561054657600080fd5b5061056560048036038101908080359060200190929190505050611c6c565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561059557600080fd5b506105be6004803603810190808035906020019092919080359060200190929190505050611d5f565b005b3480156105cc57600080fd5b506105d5611fbd565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106185780820151818401526020810190506105fd565b505050509050019250505060405180910390f35b34801561063857600080fd5b506106576004803603810190808035906020019092919050505061208f565b005b61067760048036038101908080359060200190929190505050612167565b005b34801561068557600080fd5b506106b2600480360381019080803590602001908201803590602001919091929391929390505050612447565b005b3480156106c057600080fd5b506106ff600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061249d565b005b34801561070d57600080fd5b5061071661251b565b005b34801561072457600080fd5b50610743600480360381019080803590602001909291905050506125a2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610783578082015181840152602081019050610768565b50505050905090810190601f1680156107b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6107f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612652565b005b34801561080057600080fd5b5061081f60048036038101908080359060200190929190505050612b4a565b6040518082815260200191505060405180910390f35b34801561084157600080fd5b50610876600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612bc9565b005b34801561088457600080fd5b506108ad6004803603810190808035906020019092919080359060200190929190505050612d97565b005b3480156108bb57600080fd5b506108f260048036038101908080359060200190929190803590602001908201803590602001919091929391929390505050612eb6565b005b34801561090057600080fd5b5061091f60048036038101908080359060200190929190505050612f4d565b6040518082815260200191505060405180910390f35b34801561094157600080fd5b5061096060048036038101908080359060200190929190505050612f70565b604051808a60ff1660ff1681526020018960ff1660ff1681526020018881526020018781526020018681526020018581526020018481526020018315151515815260200182151515158152602001995050505050505050505060405180910390f35b3480156109ce57600080fd5b506109ed60048036038101908080359060200190929190505050613001565b005b3480156109fb57600080fd5b50610a1a600480360381019080803590602001909291905050506130e9565b604051808f81526020018e81526020018d81526020018c81526020018b81526020018a8152602001898152602001888152602001878152602001868152602001858152602001848152602001838152602001821515151581526020019e50505050505050505050505050505060405180910390f35b348015610a9b57600080fd5b50610aba60048036038101908080359060200190929190505050613171565b005b348015610ac857600080fd5b50610b07600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506131d6565b005b348015610b1557600080fd5b50610b4160048036038101908080359060200190929190803560ff169060200190929190505050613264565b005b348015610b4f57600080fd5b50610b6e600480360381019080803590602001909291905050506133b6565b005b348015610b7c57600080fd5b50610ba5600480360381019080803590602001909291908035906020019092919050505061341b565b005b610bc560048036038101908080359060200190929190505050613700565b005b348015610bd357600080fd5b50610bfc60048036038101908080359060200190929190803590602001909291905050506139e0565b005b348015610c0a57600080fd5b50610c3f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613aef565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610c82578082015181840152602081019050610c67565b505050509050019250505060405180910390f35b348015610ca257600080fd5b50610cd7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613c24565b005b348015610ce557600080fd5b50610d0460048036038101908080359060200190929190505050613cfe565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606080600080600d54604051908082528060200260200182016040528015610d7d5781602001602082028038833980820191505090505b5092506000600d541115610e0f5760009150600090505b600680549050811015610e0e5760011515600682815481101515610db457fe5b906000526020600020906007020160060160019054906101000a900460ff1615151415610e0157808383815181101515610dea57fe5b906020019060200201818152505081806001019250505b8080600101915050610d94565b5b82935050505090565b600d5481565b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b6001602052806000526040600020600091509050806000015490806001015490806002015490806003018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f155780601f10610eea57610100808354040283529160200191610f15565b820191906000526020600020905b815481529060010190602001808311610ef857829003601f168201915b5050505050905084565b606080600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154604051908082528060200260200182016040528015610f965781602001602082028038833980820191505090505b50925060009150600090505b600680549050811015611049578473ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561103c5780838381518110151561102557fe5b906020019060200201818152505081806001019250505b8080600101915050610fa2565b829350505050919050565b6000600580549050905090565b60008060008061106f614462565b60011515600060149054906101000a900460ff1615151480156110925750600034115b156110df573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156110dd573d6000803e3d6000fd5b505b600060149054906101000a900460ff161515156110fb57600080fd5b60095480341015151561110d57600080fd5b86600080603260643481151561111f57fe5b0402915081600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254019250508190555081600a60008282540192505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561120d57503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561128557601960643481151561122057fe5b0402905080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254019250508190555080600a600082825401925050819055505b6112906103e9613d31565b97506101206040519081016040528060016112ab6003613d31565b0160ff168152602001600060ff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001600015158152509450876101c21115611324576113076009613d31565b60190196506001856020019060ff16908160ff16815250506113dd565b876102d01115611355576113386011613d31565b602a0196506002856020019060ff16908160ff16815250506113dc565b8761038e1115611386576113696019613d31565b60470196506003856020019060ff16908160ff16815250506113db565b876103d411156113b75761139a6021613d31565b60770196506004856020019060ff16908160ff16815250506113da565b6113c16029613d31565b60eb0196506005856020019060ff16908160ff16815250505b5b5b5b600160ff16856000015160ff16141561145d576007600a888115156113fe57fe5b040285604001818152505084604001518703965061141c6006613d31565b600a8881151561142857fe5b0402856060018181525050846060015187039650603c87028560800181815250506001856000019060ff16908160ff16815250505b600260ff16856000015160ff1614156114dd576007600a8881151561147e57fe5b040285606001818152505084606001518703965061149c6006613d31565b600a888115156114a857fe5b0402856040018181525050846040015187039650603c87028560800181815250506002856000019060ff16908160ff16815250505b600360ff16856000015160ff16141561155c576007600a888115156114fe57fe5b04029850603c8902856080018181525050888703965061151e6006613d31565b600a8881151561152a57fe5b0402856040018181525050846040015187039650868560600181815250506003856000019060ff16908160ff16815250505b60016006869080600181540180825580915050906001820390600052602060002090600702016000909192909190915060008201518160000160006101000a81548160ff021916908360ff16021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160010155606082015181600201556080820151816003015560a0820151816004015560c0820151816005015560e08201518160060160006101000a81548160ff0219169083151502179055506101008201518160060160016101000a81548160ff0219169083151502179055505050039550336003600088815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600081548092919060010191905055507f0c4ad8244c49e226fa47310564e3a7d0bb97b9808742e9159b5fd2e62033f8848633604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150505050505050505050565b600080826002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117d257600080fd5b620f4240611802600a543073ffffffffffffffffffffffffffffffffffffffff1631613d8790919063ffffffff16565b11151561180e57600080fd5b834260058281548110151561181f57fe5b90600052602060002090600e02016009015410151561183d57600080fd5b60011515600060149054906101000a900460ff1615151480156118605750600034115b156118ad573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156118ab573d6000803e3d6000fd5b505b600060149054906101000a900460ff161515156118c957600080fd5b6005858154811015156118d857fe5b90600052602060002090600e020193506103208460070154111515156118fd57600080fd5b62015180420184600901819055506119188460070154612b4a565b925082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254019250508190555082600a600082825401925050819055505050505050565b600080836000811415151561199557600080fd5b6003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0257600080fd5b8360008114151515611a1357600080fd5b6003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8057600080fd5b856000600682815481101515611a9257fe5b906000526020600020906007020190508060060160019054906101000a900460ff1615611ac357611ac281613da0565b5b866000600682815481101515611ad557fe5b906000526020600020906007020190508060060160019054906101000a900460ff1615611b0657611b0581613da0565b5b888a14151515611b1557600080fd5b60068a815481101515611b2457fe5b90600052602060002090600702019750600689815481101515611b4357fe5b906000526020600020906007020196508660060160009054906101000a900460ff1615611b8a57611b8987600501548860000160009054906101000a900460ff16613264565b5b8660010154886001015411611ba3578660010154611ba9565b87600101545b88600101819055508660020154886002015411611bca578660020154611bd0565b87600201545b88600201819055508660030154886003015411611bf1578660030154611bf7565b87600301545b886003018190555060068860000160016101000a81548160ff021916908360ff160217905550611c293360008b613dd3565b7f97ae4fc518063fd36c075c2181bd907a5da869f4647d8ccba298121925f100d48a6040518082815260200191505060405180910390a150505050505050505050565b60008060008060008060008060008060058b815481101515611c8a57fe5b90600052602060002090600e02019650600687600a0154815481101515611cad57fe5b90600052602060002090600702019550600687600b0154815481101515611cd057fe5b90600052602060002090600702019450600687600c0154815481101515611cf357fe5b90600052602060002090600702019350836001015485600101548760010154896001015401010192508360020154856002015487600201548960020154010101915083600301548560030154876003015401019050828282995099509950505050505050509193909250565b600080836002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dd057600080fd5b8360008114151515611de157600080fd5b6003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e4e57600080fd5b600586815481101515611e5d57fe5b90600052602060002090600e02019350600685815481101515611e7c57fe5b906000526020600020906007020192508260060160009054906101000a900460ff1615611ec357611ec283600501548460000160009054906101000a900460ff16613264565b5b60018360060160006101000a81548160ff02191690831515021790555085836005018190555060018360000160009054906101000a900460ff1660ff161415611f2d57600084600a01541115611f2357611f2284600001546001613264565b5b8484600a01819055505b60028360000160009054906101000a900460ff1660ff161415611f7157600084600b01541115611f6757611f6684600001546002613264565b5b8484600b01819055505b60038360000160009054906101000a900460ff1660ff161415611fb557600084600c01541115611fab57611faa84600001546003613264565b5b8484600c01819055505b505050505050565b606080600080600c54604051908082528060200260200182016040528015611ff45781602001602082028038833980820191505090505b5092506000600c5411156120865760009150600090505b600580549050811015612085576001151560058281548110151561202b57fe5b90600052602060002090600e0201600d0160009054906101000a900460ff16151514156120785780838381518110151561206157fe5b906020019060200201818152505081806001019250505b808060010191505061200b565b5b82935050505090565b6000816005818154811015156120a157fe5b90600052602060002090600e0201600d0160009054906101000a900460ff1615156120cb57600080fd5b826002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561213957600080fd5b60058481548110151561214857fe5b90600052602060002090600e020192506121618361407b565b50505050565b60011515600060149054906101000a900460ff16151514801561218a5750600034115b156121d7573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156121d5573d6000803e3d6000fd5b505b600060149054906101000a900460ff161515156121f357600080fd5b806002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561226257600080fd5b8160058181548110151561227257fe5b90600052602060002090600e0201600d0160009054906101000a900460ff16151561229c57600080fd5b6005838154811015156122ab57fe5b90600052602060002090600e0201600801548034101515156122cc57600080fd5b6002600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008060643411156123255760643481151561231857fe5b049150813403905061232d565b600091503490505b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254019250508190555081600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282540192505081905550818101600a6000828254019250508190555061243e6002600089815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633896140ae565b50505050505050565b8181600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030191906124989291906144b9565b505050565b806002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561250b57600080fd5b6125163384846140ae565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561257657600080fd5b600060149054906101000a900460ff1615600060146101000a81548160ff021916908315150217905550565b60046020528060005260406000206000915090508054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561264a5780601f1061261f5761010080835404028352916020019161264a565b820191906000526020600020905b81548152906001019060200180831161262d57829003601f168201915b505050505081565b600060011515600060149054906101000a900460ff1615151480156126775750600034115b156126c4573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156126c2573d6000803e3d6000fd5b505b600060149054906101000a900460ff161515156126e057600080fd5b6008548034101515156126f257600080fd5b82600080603260643481151561270457fe5b0402915081600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254019250508190555081600a60008282540192505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156127f257503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561286a57601960643481151561280557fe5b0402905080600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254019250508190555080600a600082825401925050819055505b600160056101c0604051908101604052806000815260200161288c6004613d31565b600201815260200161289e6004613d31565b6001018152602001610e106128b36009613d31565b0262015180038152602001600081526020016000815260200160008152602001600160078054905001815260200160008152602001428152602001600081526020016000815260200160008152602001600015158152509080600181540180825580915050906001820390600052602060002090600e020160009091929091909150600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b015561018082015181600c01556101a082015181600d0160006101000a81548160ff0219169083151502179055505050039450846005868154811015156129f257fe5b90600052602060002090600e0201600001819055506007859080600181540180825580915050906001820390600052602060002001600090919290919091505550336002600087815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101600081548092919060010191905055507fc4021e7d72ad98c7d297782bf366036d8785ee293ef5867de13b1962643004d98533604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1505050505050565b600080600061032084111515612bbd57612b75600185036002026107d0613d8790919063ffffffff16565b9150612ba3600a543073ffffffffffffffffffffffffffffffffffffffff1631613d8790919063ffffffff16565b905081620f424082811515612bb457fe5b04029250612bc2565b600092505b5050919050565b60008060011515600060149054906101000a900460ff161515148015612bef5750600034115b15612c3c573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015612c3a573d6000803e3d6000fd5b505b600060149054906101000a900460ff16151515612c5857600080fd5b829150600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612c94573391505b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050600081111515612ce857600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550612d4581600a54613d8790919063ffffffff16565b600a819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612d91573d6000803e3d6000fd5b50505050565b60008260008114151515612daa57600080fd5b6003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612e1757600080fd5b8360001515600682815481101515612e2b57fe5b906000526020600020906007020160060160019054906101000a900460ff161515141515612e5857600080fd5b600685815481101515612e6757fe5b9060005260206000209060070201925060018360060160016101000a81548160ff021916908315150217905550838360040181905550600d600081548092919060010191905055505050505050565b826002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612f2457600080fd5b8282600460008781526020019081526020016000209190612f469291906144b9565b5050505050565b600781815481101515612f5c57fe5b906000526020600020016000915090505481565b600681815481101515612f7f57fe5b90600052602060002090600702016000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060010154908060020154908060030154908060040154908060050154908060060160009054906101000a900460ff16908060060160019054906101000a900460ff16905089565b60008160068181548110151561301357fe5b906000526020600020906007020160060160019054906101000a900460ff16151561303d57600080fd5b826000811415151561304e57600080fd5b6003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156130bb57600080fd5b6006848154811015156130ca57fe5b906000526020600020906007020192506130e383613da0565b50505050565b6005818154811015156130f857fe5b90600052602060002090600e020160009150905080600001549080600101549080600201549080600301549080600401549080600501549080600601549080600701549080600801549080600901549080600a01549080600b01549080600c01549080600d0160009054906101000a900460ff1690508e565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156131cc57600080fd5b8060088190555050565b80600081141515156131e757600080fd5b6003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561325457600080fd5b61325f338484613dd3565b505050565b600080836002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156132d557600080fd5b6005858154811015156132e457fe5b90600052602060002090600e0201915060018460ff16141561331c5781600a01549250600083111561331b57600082600a01819055505b5b60028460ff1614156133445781600b01549250600083111561334357600082600b01819055505b5b60038460ff16141561336c5781600c01549250600083111561336b57600082600c01819055505b5b60008311156133af57600060068481548110151561338657fe5b906000526020600020906007020160060160006101000a81548160ff0219169083151502179055505b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561341157600080fd5b8060098190555050565b6000806000806000806000886002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561349457600080fd5b89426005828154811015156134a557fe5b90600052602060002090600e020160040154111515156134c457600080fd5b8a8a8082141515156134d557600080fd5b8b600073ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561354557600080fd5b60058e81548110151561355457fe5b90600052602060002090600e02019b5060058d81548110151561357357fe5b90600052602060002090600e02019a5061358c8e611c6c565b9050809750819950505061359f8d611c6c565b90915050809750508688111561366c57600587890310156135d1576135c4600361430a565b809a50819b505050613607565b600a87890310156135f3576135e6600261430a565b809a50819b505050613606565b6135fd600161430a565b809a50819b5050505b5b6136138c8c8c8c614323565b7fa4fd22ab9dc45ec5d5abb406c0c43532ee37edc55234f85bf926ebc1b900d85a8c600001548c6000015460016040518084815260200183815260200182151515158152602001935050505060405180910390a16136df565b613676600161430a565b809a50819b50505061368a8b8d8c8c614323565b7fa4fd22ab9dc45ec5d5abb406c0c43532ee37edc55234f85bf926ebc1b900d85a8b600001548d6000015460006040518084815260200183815260200182151515158152602001935050505060405180910390a15b858c600301544201038c600401819055505050505050505050505050505050565b60011515600060149054906101000a900460ff1615151480156137235750600034115b15613770573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801561376e573d6000803e3d6000fd5b505b600060149054906101000a900460ff1615151561378c57600080fd5b806003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156137fb57600080fd5b8160068181548110151561380b57fe5b906000526020600020906007020160060160019054906101000a900460ff16151561383557600080fd5b60068381548110151561384457fe5b90600052602060002090600702016004015480341015151561386557600080fd5b6003600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008060643411156138be576064348115156138b157fe5b04915081340390506138c6565b600091503490505b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254019250508190555081600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282540192505081905550818101600a600082825401925050819055506139d76003600089815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163389613dd3565b50505050505050565b6000826002600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613a5057600080fd5b8360001515600582815481101515613a6457fe5b90600052602060002090600e0201600d0160009054906101000a900460ff161515141515613a9157600080fd5b600585815481101515613aa057fe5b90600052602060002090600e02019250600183600d0160006101000a81548160ff021916908315150217905550838360080181905550600c600081548092919060010191905055505050505050565b606080600080600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154604051908082528060200260200182016040528015613b665781602001602082028038833980820191505090505b50925060009150600090505b600580549050811015613c19578473ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613c0c57808383815181101515613bf557fe5b906020019060200201818152505081806001019250505b8080600101915050613b72565b829350505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613c7f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613cbb57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b6000815480929190600101919050555081600b54600143034060405180838152602001826000191660001916815260200192505050604051809103902060019004811515613d7f57fe5b069050919050565b6000828211151515613d9557fe5b818303905092915050565b60008160060160016101000a81548160ff021916908315150217905550600d600081548092919060019003919050555050565b6000816000600682815481101515613de757fe5b906000526020600020906007020190508060060160019054906101000a900460ff1615613e1857613e1781613da0565b5b600684815481101515613e2757fe5b906000526020600020906007020192508260060160009054906101000a900460ff168015613eb85750600260008460050154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b15613edd57613edc83600501548460000160009054906101000a900460ff16613264565b5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008154809291906001019190505550600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002016000815480929190600190039190505550846003600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fd9833a6b8a219b001f51805a4733ebf47fafa146ef3ce10ede12f261055bb79d868686604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050505050565b600081600d0160006101000a81548160ff021916908315150217905550600c600081548092919060019003919050555050565b60008160006005828154811015156140c257fe5b90600052602060002090600e0201905080600d0160009054906101000a900460ff16156140f3576140f28161407b565b5b60058481548110151561410257fe5b90600052602060002090600e02019250600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160008154809291906001019190505550600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016000815480929190600190039190505550846002600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600083600a015414151561422757614226868685600a0154613dd3565b5b600083600b015414151561424557614244868685600b0154613dd3565b5b600083600c015414151561426357614262868685600c0154613dd3565b5b7f8397af45df792784806b4427cbf9f8c23cb2cf57bb43ae8e30d27ca199e4e279868686604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050505050565b6000808261431a60018501613d31565b91509150915091565b600080828660010160008282540192505081905550828403866002016000828254019250508190555061435a856001015484614425565b85600101819055506143728560020154848603614445565b85600201819055508560050160008154809291906001019190505550846006016000815480929190600101919050555084600701548660070154111561441d57856007015491508460070154905081856007018190555080866007018190555084600001546007600184038154811015156143e957fe5b9060005260206000200181905550856000015460076001830381548110151561440e57fe5b90600052602060002001819055505b505050505050565b60006002820183111561443a5781830361443d565b60025b905092915050565b6000818311156144575781830361445a565b60015b905092915050565b61012060405190810160405280600060ff168152602001600060ff16815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106144fa57803560ff1916838001178555614528565b82800160010185558215614528579182015b8281111561452757823582559160200191906001019061450c565b5b5090506145359190614539565b5090565b61455b91905b8082111561455757600081600090555060010161453f565b5090565b905600a165627a7a72305820b40dade8f6c0f614133fbc9a2d5060fc8b354bf797f111499f7c4e0652842dec0029

   Swarm Source:
bzzr://b40dade8f6c0f614133fbc9a2d5060fc8b354bf797f111499f7c4e0652842dec

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.