Sponsored Link:   SHARPAY.io • Share button with blockchain profit • ICOBench TOP Project • 30% Bonus • Buy Now!
 Latest 25 txns from a total Of 39112 transactions
View All

TxHash Age From To Value [TxFee]
0xe90e7c90b97b24267c27f5e242c831f588e0461ccb1bd9e8b2b267944792da5f14 days 14 hrs ago0x47169f78750be1e6ec2deb2974458ac4f8751714  IN   0x141766882733cafa9033e8707548fdcac908db220 Ether0.0000151734
0xb4f72ed18f505ed9c3cfb67fdc2151f947acb2503ca5ef3d82a72cb9c1fb942017 days 22 hrs ago0x54176617abd7c1239699f00209ec744ada3245bd  IN   0x141766882733cafa9033e8707548fdcac908db220.008 Ether0.0000710117
0xdea4e434641953b1508771487a02795ac562458c58092db10186905a882fd91318 days 15 hrs ago0x54176617abd7c1239699f00209ec744ada3245bd  IN   0x141766882733cafa9033e8707548fdcac908db220.008 Ether0.0000710117
0xbebd228ae680e6b91e2adf4bad240c71e3eb9362829eda2499482683686bc9c119 days 39 mins ago0xa9a77d5e0ee091eee7eeb761c18b1324ac8f16dc  IN   0x141766882733cafa9033e8707548fdcac908db220.002 Ether0.0000467187
0xb728af03f85b18f68add8722b26432e6e1ed7ed9ef2c769c545872fff3fce9b821 days 9 hrs ago0x18a93274e26900b812913d42032751a3d50059ce  IN   0x141766882733cafa9033e8707548fdcac908db220.002 Ether0.0000467187
0xbafe04926bd9328f07c968d42707d19e42888416efae7bcc0d9a5ac1bda9ddde26 days 3 hrs ago0x18a93274e26900b812913d42032751a3d50059ce  IN   0x141766882733cafa9033e8707548fdcac908db220.002 Ether0.0000467187
0x27832abbc76c8ffb4e3ba427ce4991ab235fa07c4e71f88d1c0d6784f84b5f4939 days 16 hrs ago0x2b7f14ef2912ec4b94f245c92f521dd4a5193e42  IN   0x141766882733cafa9033e8707548fdcac908db220.002 Ether0.0000689657
0x37b308cdc51bc05c65a8cf82613f1f3f035baf78fea0997efd9a33ea25e6e89641 days 2 hrs ago0x2b7f14ef2912ec4b94f245c92f521dd4a5193e42  IN   0x141766882733cafa9033e8707548fdcac908db220.002 Ether0.0000689657
0x2b2e1d2197f9853fe04a4e238a0f7587ac555c01a0a6ce1b6e935c3913b615b946 days 20 hrs ago0xa93b8c89d89dc5fe774141ef959a71629eefbdf9  IN   0x141766882733cafa9033e8707548fdcac908db220.002 Ether0.000044494
0x0c31145b24e791fb149bb359c9e315594b16211ba7c2376efd8eae929a21560963 days 3 hrs ago0xe141249645c8f42f45d582a37f0b0b7a86d3c37a  IN   0x141766882733cafa9033e8707548fdcac908db220.003 Ether0.000002228
0x4f6ad5d512b7c8a9b2e10b49475c0f3b23918a39423b8defe21ebb8978fba7c863 days 20 hrs ago0xff3df09fad5c595aac3dd419198fdea8d4a329e4  IN   0x141766882733cafa9033e8707548fdcac908db220.002 Ether0.0000022247
0x68ea0aa52f7c6e5597cddce0db0127bddd31e8e7c4b0dc17ba3cc12e0ffff96b64 days 19 hrs ago0x78084d2e1999936e36344dffcde30457b5333ee8  IN   0x141766882733cafa9033e8707548fdcac908db220.004 Ether0.000046788
0xbc6d2a21c74516acdcacef0f9df62ab92ae187ec04b976b1a52ed05d238f98c664 days 21 hrs ago0x228d69cda292a297bf97e1924058e88d3f705391  IN   0x141766882733cafa9033e8707548fdcac908db220 Ether0.000046809
0x43484a0d5bff97557ba0c3d22bb19e90981d75b2ff31cbe0b69b62c6ff2672a364 days 21 hrs ago0x228d69cda292a297bf97e1924058e88d3f705391  IN   0x141766882733cafa9033e8707548fdcac908db220.004 Ether0.0000692664
0x1b3c3dcef274f94bdd2a5b58acb85b59ec3bb33ab8792a3679a09f9f0407107664 days 21 hrs ago0x228d69cda292a297bf97e1924058e88d3f705391  IN   0x141766882733cafa9033e8707548fdcac908db220.004 Ether0.0000692664
0x2b611516d28ced622a8b891b2143992176032ad3952834d2dca92ac4e3cb865d64 days 21 hrs ago0x228d69cda292a297bf97e1924058e88d3f705391  IN   0x141766882733cafa9033e8707548fdcac908db220 Ether0.0000283019
0x89b680d9e1da3c3323d48ab64e68abcc581e59d0f81c04e1695fb75145a88d5e64 days 21 hrs ago0x228d69cda292a297bf97e1924058e88d3f705391  IN   0x141766882733cafa9033e8707548fdcac908db220.004 Ether0.0000692664
0x3ad1af5af677fbeeba7b05cd82c79ca101f7f0b5d12a9882311d1bc0425a455d64 days 21 hrs ago0x228d69cda292a297bf97e1924058e88d3f705391  IN   0x141766882733cafa9033e8707548fdcac908db220.004 Ether0.0000245784
0x2603cd1297b63eb5c3e105c58220344660b5bb0d4296b11308e2c52795f2043d64 days 21 hrs ago0x228d69cda292a297bf97e1924058e88d3f705391  IN   0x141766882733cafa9033e8707548fdcac908db220.004 Ether0.0000245784
0x7474e0aa63d72c2c86681cb66d8d1bb306041c5b74717a35f15361cb7dbde17764 days 21 hrs ago0x228d69cda292a297bf97e1924058e88d3f705391  IN   0x141766882733cafa9033e8707548fdcac908db220.004 Ether0.0000469224
0xaeb52bc799376aa63bb6aa9809c779f4d1b3292318d4bce188d7e1d21df9f27a64 days 21 hrs ago0x228d69cda292a297bf97e1924058e88d3f705391  IN   0x141766882733cafa9033e8707548fdcac908db220.004 Ether0.0000022344
0x91bc8d40fb3e3e538dc1222f8c50074cb546e8873d80be9c2a84a88e9212e97365 days 3 mins ago0x38398d066df48cf668d5d82868bc6f71e0884abc  IN   0x141766882733cafa9033e8707548fdcac908db220.002 Ether0.0000467187
0x540e32825b5b55e161190f4e20c8932eb523d6656e387f7760367fbaef24bf4165 days 3 mins ago0x38398d066df48cf668d5d82868bc6f71e0884abc  IN   0x141766882733cafa9033e8707548fdcac908db220.002 Ether0.0000467187
0x5a0b2ca09d955f1611c839d9484afe1aed68a64aa0d6ec57b46f00236323c19665 days 3 mins ago0x38398d066df48cf668d5d82868bc6f71e0884abc  IN   0x141766882733cafa9033e8707548fdcac908db220.002 Ether0.0000467187
0xa183eb62aac28ede6fc4ddb72288c63c400e6947ebfdef9e562e3bc5b76a657670 days 19 hrs ago0xcac1a06b0b1a0ca93944882ea9892d15f53ef8e2  IN   0x141766882733cafa9033e8707548fdcac908db220 Ether0.0000385935
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click here to View More View All
ParentTxHash Block Age From To Value
0xe90e7c90b97b24267c27f5e242c831f588e0461ccb1bd9e8b2b267944792da5f557707914 days 14 hrs ago0x141766882733cafa9033e8707548fdcac908db220x47169f78750be1e6ec2deb2974458ac4f87517140.811680758801752465 Ether
0x2b611516d28ced622a8b891b2143992176032ad3952834d2dca92ac4e3cb865d528053864 days 21 hrs ago0x141766882733cafa9033e8707548fdcac908db220x228d69cda292a297bf97e1924058e88d3f7053910.012677941310277694 Ether
0xa183eb62aac28ede6fc4ddb72288c63c400e6947ebfdef9e562e3bc5b76a6576524578370 days 19 hrs ago0x141766882733cafa9033e8707548fdcac908db220xcac1a06b0b1a0ca93944882ea9892d15f53ef8e20.002417592739957558 Ether
0x8ddab6185fbf3507288ec4b52249b45890aebbf7a12809602f8db85c16930b2c523123473 days 6 hrs ago0x141766882733cafa9033e8707548fdcac908db220x2046f1424c62204fb0abec8d80769e077256f93b0.26844814966737515 Ether
0xd0bc6e4604cdd60bcadeb54c8bcb5cd2ce136436cc43b04cddaa302bdc3d9e21521886275 days 9 hrs ago0x141766882733cafa9033e8707548fdcac908db220x47169f78750be1e6ec2deb2974458ac4f875171416.871457231318960831 Ether
0x6c667594ef92f00e22b223fd6d82c9a962c418e0f95efbe540f4257b239f9aec520987876 days 21 hrs ago0x141766882733cafa9033e8707548fdcac908db220xcde993b6cc5cf39a3087fa166a81769f924146f60.0025162895076 Ether
0x345257cfcf95064ef11045881a5dce96173e693358c0d635259eb8bca48e38c2520774877 days 6 hrs ago0x141766882733cafa9033e8707548fdcac908db220xcd5106afe559b83802720b6825cd0cbe00a394b20.065904372701887378 Ether
0x2312d9afcd5e1d8d6457615b0d62afbcc1a95cb6a0b4c8e6e882e4d231ba3fad520774877 days 6 hrs ago0x141766882733cafa9033e8707548fdcac908db220xe8f55d359164fc43be0a49379f728a4fa01e522c0.013683273424858474 Ether
0xbfb5d3052b088c00f1e209c55bbb3279f89f5b35e4e72576872ac4780a6ea87e520774477 days 6 hrs ago0x141766882733cafa9033e8707548fdcac908db220xa03775790c4f9a44d6fad9304c53a8af443ab7fa0.149663529992450742 Ether
0x5e58109d0c25c754213d5ac07c596ff9097976cf078d64deabb16105a9b069ef520774277 days 6 hrs ago0x141766882733cafa9033e8707548fdcac908db220x6e3c51c5d21f88acf0f237e8db71e26692a451760.172396742051317459 Ether
0x078c99c654558c6867719f17d57dee491584995cce6466cbe920688f1f2bbac2520770177 days 6 hrs ago0x141766882733cafa9033e8707548fdcac908db220x41f29054e7c0bc59a8af10f3a6e7c0e53b334e050.471180369726726533 Ether
0x1d7c68b4196cf9099bce4f244ee9cdc67db982ec87153e1bc061bf8610d714b7520769177 days 6 hrs ago0x141766882733cafa9033e8707548fdcac908db220xf1ced8b74ff8d27805ea734525521defe35ef4750.021909056938915819 Ether
0x7bb7d695eeb6f162f68ed6d38985377a5cb0413d8d9234f4bdf8d86f3830e8c5520737277 days 7 hrs ago0x141766882733cafa9033e8707548fdcac908db220x6a0761ad0ab6891dab7c7958b61b9f6d060ad2960.003511571368715158 Ether
0x39f3215ab820ca6c1e54136465fc363b8825151cfd4e6937828d9e3034a51a1c520733177 days 8 hrs ago0x141766882733cafa9033e8707548fdcac908db220x95cb6c11ca8f8cf711d06dc05e9f5eb2da7e8caf0.00132 Ether
0x4c5dcb98399e0b55b43efdd6e36b26b1a2f1587fb9495f6e1528bce4a9b0b21d520569577 days 14 hrs ago0x141766882733cafa9033e8707548fdcac908db220x114f5e2704d9011ce1e23b91ee4b8fa1e87d112e0.038919966701996487 Ether
0x8caf5bd9ea0bbf0e31d3849432a1db56864e6c9ae673a81a78ad38e0a59dcdcb520556477 days 15 hrs ago0x141766882733cafa9033e8707548fdcac908db220x9c78ae1545b51c00ed2f9b64639eab300f8c4a170.0011 Ether
0x6efb102a3325f38ffce0a74f72168e1f911ad212ca810bfe782bcc026508697c520534777 days 16 hrs ago0x141766882733cafa9033e8707548fdcac908db220x3c30e0ce0bd53978d8bae895e6b378e033ed129e0.005617342480629036 Ether
0x9556f98a777f7202726be00ee7216f38e35ed8db67e367d08dd52e23f75aca53520389277 days 22 hrs ago0x141766882733cafa9033e8707548fdcac908db220x959b9d1fb6954e66c64a64a824d681e1282f56ee0.00753817267381733 Ether
0x47c6c68d758e59e8a789c763706a79079809be7bb1187ef500afe48a9fdef1a2520388577 days 22 hrs ago0x141766882733cafa9033e8707548fdcac908db220x8a39fe483b7c1a89cb5890b2ba25a1e3e874316d0.017761112044685921 Ether
0xfc3a964bdfc7ea6330d262293739ea776377ef685f61da56ce7302f3e90d40a7520228178 days 4 hrs ago0x141766882733cafa9033e8707548fdcac908db220x594caf23aa91ed201976e0e05e759cd7f94bf1a20.001785373090458546 Ether
0x1c4482907087de5d3ef7cebef643e8d80eb4906f3b2152d842037e3d307e111b520199878 days 5 hrs ago0x141766882733cafa9033e8707548fdcac908db220x26c16d6c72dfed1194acfe1b880c0a833ffa0ddb0.018022676502231305 Ether
0x5c32671e6f82abd1d07a9133f2d0061e5ff2d865894ded2b1bc50b48dd3b10eb519558879 days 8 hrs ago0x141766882733cafa9033e8707548fdcac908db220xd6fe8c3fa1f07802111418a8461188f2122ad09f0.032580737046361927 Ether
0x891970d2174d5495370fb7676720760fc82f187a143fdc5722c2fa69c443f6dc519476979 days 11 hrs ago0x141766882733cafa9033e8707548fdcac908db220x1e9d91f5ac43822aeef374f4cde47f5a672bcccc0.005099043235513393 Ether
0xdb8785a2346d447c95ce3fbcb30ef292af8dde3857e79ae2aee6d1575109750c519459779 days 12 hrs ago0x141766882733cafa9033e8707548fdcac908db220x004889f70832ae3664ba73628a7e69b8a9f3a34b0.037381587308672177 Ether
0x3455d8d3d5fe47690687f0f8d048a28eea019db4d545983b5f806072fef95f44519308179 days 18 hrs ago0x141766882733cafa9033e8707548fdcac908db220xcfcaea7e75d39ac236c9a6818ba297484eab43460.02636024029995116 Ether
[ Download CSV Export  ] 
Contract SelfDestruct called at TxHash 0xe90e7c90b97b24267c27f5e242c831f588e0461ccb1bd9e8b2b267944792da5f

Contract Source Code Verified (Exact match)
Contract Name: DungeonCoreBeta
Compiler Version: v0.4.19+commit.c4cbbb05
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.19;

/**
 * @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 public owner;

  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() public {
    owner = msg.sender;
  }

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

  /**
   * @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) onlyOwner public {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

/**
 * @title EjectableOwnable
 * @dev The EjectableOwnable contract provides the function to remove the ownership of the contract.
 */
contract EjectableOwnable is Ownable {

    /**
     * @dev Remove the ownership by setting the owner address to null,
     * after calling this function, all onlyOwner function will be be able to be called by anyone anymore,
     * the contract will achieve truly decentralisation.
    */
    function removeOwnership() onlyOwner public {
        owner = 0x0;
    }

}

/**
 * @title JointOwnable
 * @dev Extension for the Ownable contract, where the owner can assign at most 2 other addresses
 *  to manage some functions of the contract, using the eitherOwner modifier.
 *  Note that onlyOwner modifier would still be accessible only for the original owner.
 */
contract JointOwnable is Ownable {

  event AnotherOwnerAssigned(address indexed anotherOwner);

  address public anotherOwner1;
  address public anotherOwner2;

  /**
   * @dev Throws if called by any account other than the owner or anotherOwner.
   */
  modifier eitherOwner() {
    require(msg.sender == owner || msg.sender == anotherOwner1 || msg.sender == anotherOwner2);
    _;
  }

  /**
   * @dev Allows the current owner to assign another owner.
   * @param _anotherOwner The address to another owner.
   */
  function assignAnotherOwner1(address _anotherOwner) onlyOwner public {
    require(_anotherOwner != 0);
    AnotherOwnerAssigned(_anotherOwner);
    anotherOwner1 = _anotherOwner;
  }

  /**
   * @dev Allows the current owner to assign another owner.
   * @param _anotherOwner The address to another owner.
   */
  function assignAnotherOwner2(address _anotherOwner) onlyOwner public {
    require(_anotherOwner != 0);
    AnotherOwnerAssigned(_anotherOwner);
    anotherOwner2 = _anotherOwner;
  }

}

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {

  event Pause();
  event Unpause();

  bool public paused = false;

  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   */
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   */
  modifier whenPaused() {
    require(paused);
    _;
  }

  /**
   * @dev called by the owner to pause, triggers stopped state
   */
  function pause() onlyOwner whenNotPaused public {
    paused = true;
    Pause();
  }

  /**
   * @dev called by the owner to unpause, returns to normal state
   */
  function unpause() onlyOwner whenPaused public {
    paused = false;
    Unpause();
  }

}

/**
 * @title Destructible
 * @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner.
 */
contract Destructible is Ownable {

  function Destructible() public payable { }

  /**
   * @dev Transfers the current balance to the owner and terminates the contract.
   */
  function destroy() onlyOwner public {
    selfdestruct(owner);
  }

  function destroyAndSend(address _recipient) onlyOwner public {
    selfdestruct(_recipient);
  }

}

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  /**
  * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

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

}

/**
 * @title PullPayment
 * @dev Base contract supporting async send for pull payments. Inherit from this
 * contract and use asyncSend instead of send.
 */
contract PullPayment {

  using SafeMath for uint256;

  mapping(address => uint256) public payments;
  uint256 public totalPayments;

  /**
   * @dev withdraw accumulated balance, called by payee.
   */
  function withdrawPayments() public {
    address payee = msg.sender;
    uint256 payment = payments[payee];

    require(payment != 0);
    require(this.balance >= payment);

    totalPayments = totalPayments.sub(payment);
    payments[payee] = 0;

    assert(payee.send(payment));
  }

  /**
   * @dev Called by the payer to store the sent amount as credit to be pulled.
   * @param dest The destination address of the funds.
   * @param amount The amount to transfer.
   */
  function asyncSend(address dest, uint256 amount) internal {
    payments[dest] = payments[dest].add(amount);
    totalPayments = totalPayments.add(amount);
  }

}

/**
 * @title A simplified interface of ERC-721, but without approval functions
 */
contract ERC721 {

    // Events
    event Transfer(address indexed from, address indexed to, uint tokenId);

    // ERC20 compatible functions
    // function name() public view returns (string);
    // function symbol() public view returns (string);
    function totalSupply() public view returns (uint);
    function balanceOf(address _owner) public view returns (uint);

    // Functions that define ownership
    function ownerOf(uint _tokenId) external view returns (address);
    function transfer(address _to, uint _tokenId) external;

}

contract DungeonStructs {

    /**
     * @dev The main Dungeon struct. Every dungeon in the game is represented by this structure.
     * A dungeon is consists of an unlimited number of floors for your heroes to challenge,
     * the power level of a dungeon is encoded in the floorGenes. Some dungeons are in fact more "challenging" than others,
     * the secret formula for that is left for user to find out.
     *
     * Each dungeon also has a "training area", heroes can perform trainings and upgrade their stat,
     * and some dungeons are more effective in the training, which is also a secret formula!
     *
     * When player challenge or do training in a dungeon, the fee will be collected as the dungeon rewards,
     * which will be rewarded to the player who successfully challenged the current floor.
     *
     * Each dungeon fits in fits into three 256-bit words.
     */
    struct Dungeon {

        // Each dungeon has an ID which is the index in the storage array.

        // The timestamp of the block when this dungeon is created.
        uint32 creationTime;

        // The status of the dungeon, each dungeon can have 5 status, namely:
        // 0: Active | 1: Transport Only | 2: Challenge Only | 3: Train Only | 4: InActive
        uint8 status;

        // The dungeon's difficulty, the higher the difficulty,
        // normally, the "rarer" the seedGenes, the higher the diffculty,
        // and the higher the contribution fee it is to challenge, train, and transport to the dungeon,
        // the formula for the contribution fee is in DungeonChallenge and DungeonTraining contracts.
        // A dungeon's difficulty never change.
        uint8 difficulty;

        // The dungeon's capacity, maximum number of players allowed to stay on this dungeon.
        // The capacity of the newbie dungeon (Holyland) is set at 0 (which is infinity).
        // Using 16-bit unsigned integers can have a maximum of 65535 in capacity.
        // A dungeon's capacity never change.
        uint16 capacity;

        // The current floor number, a dungeon is consists of an umlimited number of floors,
        // when there is heroes successfully challenged a floor, the next floor will be
        // automatically generated. Using 32-bit unsigned integer can have a maximum of 4 billion floors.
        uint32 floorNumber;

        // The timestamp of the block when the current floor is generated.
        uint32 floorCreationTime;

        // Current accumulated rewards, successful challenger will get a large proportion of it.
        uint128 rewards;

        // The seed genes of the dungeon, it is used as the base gene for first floor,
        // some dungeons are rarer and some are more common, the exact details are,
        // of course, top secret of the game!
        // A dungeon's seedGenes never change.
        uint seedGenes;

        // The genes for current floor, it encodes the difficulty level of the current floor.
        // We considered whether to store the entire array of genes for all floors, but
        // in order to save some precious gas we're willing to sacrifice some functionalities with that.
        uint floorGenes;

    }

    /**
     * @dev The main Hero struct. Every hero in the game is represented by this structure.
     */
    struct Hero {

        // Each hero has an ID which is the index in the storage array.

        // The timestamp of the block when this dungeon is created.
        uint64 creationTime;

        // The timestamp of the block where a challenge is performed, used to calculate when a hero is allowed to engage in another challenge.
        uint64 cooldownStartTime;

        // Every time a hero challenge a dungeon, its cooldown index will be incremented by one.
        uint32 cooldownIndex;

        // The seed of the hero, the gene encodes the power level of the hero.
        // This is another top secret of the game! Hero's gene can be upgraded via
        // training in a dungeon.
        uint genes;

    }

}

/**
 * @title The ERC-721 compliance token contract for the Dungeon tokens.
 * @dev See the DungeonStructs contract to see the details of the Dungeon token data structure.
 */
contract DungeonToken is ERC721, DungeonStructs, Pausable, JointOwnable {

    /**
     * @notice Limits the number of dungeons the contract owner can ever create.
     */
    uint public constant DUNGEON_CREATION_LIMIT = 1024;

    /**
     * @dev The Mint event is fired whenever a new dungeon is created.
     */
    event Mint(address indexed owner, uint newTokenId, uint difficulty, uint capacity, uint seedGenes);

    /**
     * @dev The NewDungeonFloor event is fired whenever a new dungeon floor is added.
     */
    event NewDungeonFloor(uint timestamp, uint indexed dungeonId, uint32 newFloorNumber, uint128 newRewards , uint newFloorGenes);

    /**
     * @dev Transfer event as defined in current draft of ERC721. Emitted every time a token
     *  ownership (Dungeon Master) is assigned, including token creation.
     */
    event Transfer(address indexed from, address indexed to, uint tokenId);

    /**
     * @dev Name of token.
     */
    string public constant name = "Dungeon";

    /**
     * @dev Symbol of token.
     */
    string public constant symbol = "DUNG";

    /**
     * @dev An array containing the Dungeon struct, which contains all the dungeons in existance.
     *  The ID for each dungeon is the index of this array.
     */
    Dungeon[] public dungeons;

    /**
     * @dev A mapping from token IDs to the address that owns them.
     */
    mapping(uint => address) tokenIndexToOwner;

    /**
     * @dev A mapping from owner address to count of tokens that address owns.
     */
    mapping(address => uint) ownershipTokenCount;

    /**
     * Each non-fungible token owner can own more than one token at one time.
     * Because each token is referenced by its unique ID, however,
     * it can get difficult to keep track of the individual tokens that a user may own.
     * To do this, the contract keeps a record of the IDs of each token that each user owns.
     */
    mapping(address => uint[]) public ownerTokens;

    /**
     * @dev Returns the total number of tokens currently in existence.
     */
    function totalSupply() public view returns (uint) {
        return dungeons.length;
    }

    /**
     * @dev Returns the number of tokens owned by a specific address.
     * @param _owner The owner address to check.
     */
    function balanceOf(address _owner) public view returns (uint) {
        return ownershipTokenCount[_owner];
    }

    /**
     * @dev Checks if a given address is the current owner of a particular token.
     * @param _claimant The address we are validating against.
     * @param _tokenId Token ID
     */
    function _owns(address _claimant, uint _tokenId) internal view returns (bool) {
        return tokenIndexToOwner[_tokenId] == _claimant;
    }

    /**
     * @dev Returns the address currently assigned ownership of a given token.
     */
    function ownerOf(uint _tokenId) external view returns (address) {
        require(tokenIndexToOwner[_tokenId] != address(0));

        return tokenIndexToOwner[_tokenId];
    }

    /**
     * @dev Assigns ownership of a specific token to an address.
     */
    function _transfer(address _from, address _to, uint _tokenId) internal {
        // Increment the ownershipTokenCount.
        ownershipTokenCount[_to]++;

        // Transfer ownership.
        tokenIndexToOwner[_tokenId] = _to;

        // Add the _tokenId to ownerTokens[_to]
        ownerTokens[_to].push(_tokenId);

        // When creating new token, _from is 0x0, but we can't account that address.
        if (_from != address(0)) {
            ownershipTokenCount[_from]--;

            // Remove the _tokenId from ownerTokens[_from]
            uint[] storage fromTokens = ownerTokens[_from];
            bool iFound = false;

            for (uint i = 0; i < fromTokens.length - 1; i++) {
                if (iFound) {
                    fromTokens[i] = fromTokens[i + 1];
                } else if (fromTokens[i] == _tokenId) {
                    iFound = true;
                    fromTokens[i] = fromTokens[i + 1];
                }
            }

            fromTokens.length--;
        }

        // Emit the Transfer event.
        Transfer(_from, _to, _tokenId);
    }

    /**
     * @dev External function to transfers a token to another address.
     * @param _to The address of the recipient, can be a user or contract.
     * @param _tokenId The ID of the token to transfer.
     */
    function transfer(address _to, uint _tokenId) whenNotPaused external {
        // Safety check to prevent against an unexpected 0x0 default.
        require(_to != address(0));

        // Disallow transfers to this contract to prevent accidental misuse.
        require(_to != address(this));

        // You can only send your own token.
        require(_owns(msg.sender, _tokenId));

        // Reassign ownership, clear pending approvals, emit Transfer event.
        _transfer(msg.sender, _to, _tokenId);
    }

    /**
     * @dev Get an array of IDs of each token that an user owns.
     */
    function getOwnerTokens(address _owner) external view returns(uint[]) {
        return ownerTokens[_owner];
    }

    /**
     * @dev The external function that creates a new dungeon and stores it, only contract owners
     *  can create new token, and will be restricted by the DUNGEON_CREATION_LIMIT.
     *  Will generate a Mint event, a  NewDungeonFloor event, and a Transfer event.
     * @param _difficulty The difficulty of the new dungeon.
     * @param _capacity The capacity of the new dungeon.
     * @param _seedGenes The seed genes of the new dungeon.
     * @param _firstFloorGenes The genes of the first dungeon floor.
     * @return The dungeon ID of the new dungeon.
     */
    function createDungeon(uint _difficulty, uint _capacity, uint _seedGenes, uint _firstFloorGenes, address _owner) eitherOwner external returns (uint) {
        // Ensure the total supply is within the fixed limit.
        require(totalSupply() < DUNGEON_CREATION_LIMIT);

        // UPDATE STORAGE
        // Create a new dungeon.
        dungeons.push(Dungeon(uint32(now), 0, uint8(_difficulty), uint16(_capacity), 0, 0, 0, _seedGenes, 0));

        // Token id is the index in the storage array.
        uint newTokenId = dungeons.length - 1;

        // Emit the token mint event.
        Mint(_owner, newTokenId, _difficulty, _capacity, _seedGenes);

        // Initialize the fist floor, this will emit the NewDungeonFloor event.
        addDungeonNewFloor(newTokenId, 0, _firstFloorGenes);

        // This will assign ownership, and also emit the Transfer event.
        _transfer(0, _owner, newTokenId);

        return newTokenId;
    }

    /**
     * @dev The external function to set dungeon status by its ID,
     *  refer to DungeonStructs for more information about dungeon status.
     *  Only contract owners can alter dungeon state.
     */
    function setDungeonStatus(uint _id, uint _newStatus) eitherOwner tokenExists(_id) external {
        dungeons[_id].status = uint8(_newStatus);
    }

    /**
     * @dev The external function to add additional dungeon rewards by its ID,
     *  only contract owners can alter dungeon state.
     */
    function addDungeonRewards(uint _id, uint _additinalRewards) eitherOwner tokenExists(_id) external {
        dungeons[_id].rewards += uint128(_additinalRewards);
    }

    /**
     * @dev The external function to add another dungeon floor by its ID,
     *  only contract owners can alter dungeon state.
     *  Will generate both a NewDungeonFloor event.
     */
    function addDungeonNewFloor(uint _id, uint _newRewards, uint _newFloorGenes) eitherOwner tokenExists(_id) public {
        Dungeon storage dungeon = dungeons[_id];

        dungeon.floorNumber++;
        dungeon.floorCreationTime = uint32(now);
        dungeon.rewards = uint128(_newRewards);
        dungeon.floorGenes = _newFloorGenes;

        // Emit the NewDungeonFloor event.
        NewDungeonFloor(now, _id, dungeon.floorNumber, dungeon.rewards, dungeon.floorGenes);
    }


    /* ======== MODIFIERS ======== */

    /**
     * @dev Throws if _dungeonId is not created yet.
     */
    modifier tokenExists(uint _tokenId) {
        require(_tokenId < totalSupply());
        _;
    }

}

/**
 * @title The ERC-721 compliance token contract for the Hero tokens.
 * @dev See the DungeonStructs contract to see the details of the Hero token data structure.
 */
contract HeroToken is ERC721, DungeonStructs, Pausable, JointOwnable {

    /**
     * @dev The Mint event is fired whenever a new hero is created.
     */
    event Mint(address indexed owner, uint newTokenId, uint _genes);

    /**
     * @dev Transfer event as defined in current draft of ERC721. Emitted every time a token
     *  ownership is assigned, including token creation.
     */
    event Transfer(address indexed from, address indexed to, uint tokenId);

    /**
     * @dev Name of token.
     */
    string public constant name = "Hero";

    /**
     * @dev Symbol of token.
     */
    string public constant symbol = "HERO";

    /**
     * @dev An array containing the Hero struct, which contains all the heroes in existance.
     *  The ID for each hero is the index of this array.
     */
    Hero[] public heroes;

    /**
     * @dev A mapping from token IDs to the address that owns them.
     */
    mapping(uint => address) tokenIndexToOwner;

    /**
     * @dev A mapping from owner address to count of tokens that address owns.
     */
    mapping(address => uint) ownershipTokenCount;

    /**
     * Each non-fungible token owner can own more than one token at one time.
     * Because each token is referenced by its unique ID, however,
     * it can get difficult to keep track of the individual tokens that a user may own.
     * To do this, the contract keeps a record of the IDs of each token that each user owns.
     */
    mapping(address => uint[]) public ownerTokens;

    /**
     * @dev Returns the total number of tokens currently in existence.
     */
    function totalSupply() public view returns (uint) {
        return heroes.length;
    }

    /**
     * @dev Returns the number of tokens owned by a specific address.
     * @param _owner The owner address to check.
     */
    function balanceOf(address _owner) public view returns (uint) {
        return ownershipTokenCount[_owner];
    }

    /**
     * @dev Checks if a given address is the current owner of a particular token.
     * @param _claimant The address we are validating against.
     * @param _tokenId Token ID
     */
    function _owns(address _claimant, uint _tokenId) internal view returns (bool) {
        return tokenIndexToOwner[_tokenId] == _claimant;
    }

    /**
     * @dev Returns the address currently assigned ownership of a given token.
     */
    function ownerOf(uint _tokenId) external view returns (address) {
        require(tokenIndexToOwner[_tokenId] != address(0));

        return tokenIndexToOwner[_tokenId];
    }

    /**
     * @dev Assigns ownership of a specific token to an address.
     */
    function _transfer(address _from, address _to, uint _tokenId) internal {
        // Increment the ownershipTokenCount.
        ownershipTokenCount[_to]++;

        // Transfer ownership.
        tokenIndexToOwner[_tokenId] = _to;

        // Add the _tokenId to ownerTokens[_to]
        ownerTokens[_to].push(_tokenId);

        // When creating new token, _from is 0x0, but we can't account that address.
        if (_from != address(0)) {
            ownershipTokenCount[_from]--;

            // Remove the _tokenId from ownerTokens[_from]
            uint[] storage fromTokens = ownerTokens[_from];
            bool iFound = false;

            for (uint i = 0; i < fromTokens.length - 1; i++) {
                if (iFound) {
                    fromTokens[i] = fromTokens[i + 1];
                } else if (fromTokens[i] == _tokenId) {
                    iFound = true;
                    fromTokens[i] = fromTokens[i + 1];
                }
            }

            fromTokens.length--;
        }

        // Emit the Transfer event.
        Transfer(_from, _to, _tokenId);
    }

    /**
     * @dev External function to transfers a token to another address.
     * @param _to The address of the recipient, can be a user or contract.
     * @param _tokenId The ID of the token to transfer.
     */
    function transfer(address _to, uint _tokenId) whenNotPaused external {
        // Safety check to prevent against an unexpected 0x0 default.
        require(_to != address(0));

        // Disallow transfers to this contract to prevent accidental misuse.
        require(_to != address(this));

        // You can only send your own token.
        require(_owns(msg.sender, _tokenId));

        // Reassign ownership, clear pending approvals, emit Transfer event.
        _transfer(msg.sender, _to, _tokenId);
    }

    /**
     * @dev Get an array of IDs of each token that an user owns.
     */
    function getOwnerTokens(address _owner) external view returns(uint[]) {
        return ownerTokens[_owner];
    }

    /**
     * @dev An external function that creates a new hero and stores it,
     *  only contract owners can create new token.
     *  method doesn't do any checking and should only be called when the
     *  input data is known to be valid.
     * @param _genes The gene of the new hero.
     * @param _owner The inital owner of this hero.
     * @return The hero ID of the new hero.
     */
    function createHero(uint _genes, address _owner) eitherOwner external returns (uint) {
        // UPDATE STORAGE
        // Create a new hero.
        heroes.push(Hero(uint64(now), 0, 0, _genes));

        // Token id is the index in the storage array.
        uint newTokenId = heroes.length - 1;

        // Emit the token mint event.
        Mint(_owner, newTokenId, _genes);

        // This will assign ownership, and also emit the Transfer event.
        _transfer(0, _owner, newTokenId);

        return newTokenId;
    }

    /**
     * @dev The external function to set the hero genes by its ID,
     *  only contract owners can alter hero state.
     */
    function setHeroGenes(uint _id, uint _newGenes) eitherOwner tokenExists(_id) external {
        heroes[_id].genes = _newGenes;
    }

    /**
     * @dev Set the cooldownStartTime for the given hero. Also increments the cooldownIndex.
     */
    function triggerCooldown(uint _id) eitherOwner tokenExists(_id) external {
        Hero storage hero = heroes[_id];

        hero.cooldownStartTime = uint64(now);
        hero.cooldownIndex++;
    }


    /* ======== MODIFIERS ======== */

    /**
     * @dev Throws if _dungeonId is not created yet.
     */
    modifier tokenExists(uint _tokenId) {
        require(_tokenId < totalSupply());
        _;
    }

}

/**
 * SECRET
 */
contract ChallengeScienceInterface {

    /**
     * @dev given genes of current floor and dungeon seed, return a genetic combination - may have a random factor.
     * @param _floorGenes Genes of floor.
     * @param _seedGenes Seed genes of dungeon.
     * @return The resulting genes.
     */
    function mixGenes(uint _floorGenes, uint _seedGenes) external returns (uint);

}

/**
 * SECRET
 */
contract TrainingScienceInterface {

    /**
     * @dev given genes of hero and current floor, return a genetic combination - may have a random factor.
     * @param _heroGenes Genes of hero.
     * @param _floorGenes Genes of current floor.
     * @param _equipmentId Equipment index to train for, 0 is train all attributes.
     * @return The resulting genes.
     */
    function mixGenes(uint _heroGenes, uint _floorGenes, uint _equipmentId) external returns (uint);

}

/**
 * @title DungeonBase
 * @dev Base contract for Ether Dungeon. It implements all necessary sub-classes,
 * holds all the base storage variables, and some commonly used functions.
 */
contract DungeonBase is EjectableOwnable, Pausable, PullPayment, DungeonStructs {

    /* ======== TOKEN CONTRACTS ======== */

    /**
     * @dev The address of the ERC721 token contract managing all Dungeon tokens.
     */
    DungeonToken public dungeonTokenContract;

    /**
     * @dev The address of the ERC721 token contract managing all Hero tokens.
     */
    HeroToken public heroTokenContract;


    /* ======== CLOSED SOURCE CONTRACTS ======== */

    /**
     * @dev The address of the ChallengeScience contract that handles the floor generation mechanics after challenge success.
     */
    ChallengeScienceInterface challengeScienceContract;

    /**
     * @dev The address of the TrainingScience contract that handles the hero training mechanics.
     */
    TrainingScienceInterface trainingScienceContract;


    /* ======== CONSTANTS ======== */

    uint16[32] EQUIPMENT_POWERS = [
        1, 2, 4, 5, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0,
        4, 16, 32, 33, 0, 0, 0, 0, 32, 64, 0, 0, 128, 0, 0, 0
    ];

    uint SUPER_HERO_MULTIPLIER = 32;

    /* ======== SETTER FUNCTIONS ======== */

    /**
     * @dev Set the address of the dungeon token contract.
     * @param _newDungeonTokenContract An address of a DungeonToken contract.
     */
    function setDungeonTokenContract(address _newDungeonTokenContract) onlyOwner external {
        dungeonTokenContract = DungeonToken(_newDungeonTokenContract);
    }

    /**
     * @dev Set the address of the hero token contract.
     * @param _newHeroTokenContract An address of a HeroToken contract.
     */
    function setHeroTokenContract(address _newHeroTokenContract) onlyOwner external {
        heroTokenContract = HeroToken(_newHeroTokenContract);
    }

    /**
     * @dev Set the address of the secret dungeon challenge formula contract.
     * @param _newChallengeScienceAddress An address of a ChallengeScience contract.
     */
    function setChallengeScienceContract(address _newChallengeScienceAddress) onlyOwner external {
        challengeScienceContract = ChallengeScienceInterface(_newChallengeScienceAddress);
    }

    /**
     * @dev Set the address of the secret hero training formula contract.
     * @param _newTrainingScienceAddress An address of a TrainingScience contract.
     */
    function setTrainingScienceContract(address _newTrainingScienceAddress) onlyOwner external {
        trainingScienceContract = TrainingScienceInterface(_newTrainingScienceAddress);
    }


    /* ======== MODIFIERS ======== */

    /**
     * @dev Throws if _dungeonId is not created yet.
     */
    modifier dungeonExists(uint _dungeonId) {
        require(_dungeonId < dungeonTokenContract.totalSupply());
        _;
    }


    /* ======== HELPER FUNCTIONS ======== */

    /**
     * @dev An internal function to calculate the top 5 heroes power of a player.
     */
    function _getTop5HeroesPower(address _address, uint _dungeonId) internal view returns (uint) {
        uint heroCount = heroTokenContract.balanceOf(_address);

        if (heroCount == 0) {
            return 0;
        }

        // Compute all hero powers for further calculation.
        uint[] memory heroPowers = new uint[](heroCount);

        for (uint i = 0; i < heroCount; i++) {
            uint heroId = heroTokenContract.ownerTokens(_address, i);
            uint genes;
            (,,, genes) = heroTokenContract.heroes(heroId);
            // Power of dungeonId = 0 (no super hero boost).
            heroPowers[i] = _getHeroPower(genes, _dungeonId);
        }

        // Calculate the top 5 heroes power.
        uint result;
        uint curMax;
        uint curMaxIndex;

        for (uint j; j < 5; j++){
            for (uint k = 0; k < heroPowers.length; k++) {
                if (heroPowers[k] > curMax) {
                    curMax = heroPowers[k];
                    curMaxIndex = k;
                }
            }

            result += curMax;
            heroPowers[curMaxIndex] = 0;
            curMax = 0;
            curMaxIndex = 0;
        }

        return result;
    }

    /**
     * @dev An internal function to calculate the power of a hero,
     *  it calculates the base equipment power, stats power, and "Super" multiplier.
     */
    function _getHeroPower(uint _genes, uint _dungeonId) internal view returns (uint) {
        uint difficulty;
        (,, difficulty,,,,,,) = dungeonTokenContract.dungeons(_dungeonId);

        // Calculate total stats power.
        uint statsPower;

        for (uint i = 0; i < 4; i++) {
            statsPower += _genes % 32 + 1;
            _genes /= 32 ** 4;
        }

        // Calculate total equipment power.
        uint equipmentPower;
        uint superRank = _genes % 32;

        for (uint j = 4; j < 12; j++) {
            uint curGene = _genes % 32;
            equipmentPower += EQUIPMENT_POWERS[curGene];
            _genes /= 32 ** 4;

            if (superRank != curGene) {
                superRank = 0;
            }
        }

        // Calculate super power boost.
        bool isSuper = superRank >= 16;
        uint superBoost;

        if (isSuper) {
            superBoost = (difficulty - 1) * SUPER_HERO_MULTIPLIER;
        }

        return statsPower + equipmentPower + superBoost;
    }

    /**
     * @dev An internal function to calculate the difficulty of a dungeon floor.
     */
    function _getDungeonPower(uint _genes) internal view returns (uint) {
        // Calculate total dungeon power.
        uint dungeonPower;

        for (uint j = 0; j < 12; j++) {
            dungeonPower += EQUIPMENT_POWERS[_genes % 32];
            _genes /= 32 ** 4;
        }

        return dungeonPower;
    }

}

contract DungeonTransportation is DungeonBase {

    /**
     * @dev The PlayerTransported event is fired when user transported to another dungeon.
     */
    event PlayerTransported(uint timestamp, address indexed playerAddress, uint indexed originDungeonId, uint indexed destinationDungeonId);


    /* ======== GAME SETTINGS ======== */

    /**
     * @notice The actual fee contribution required to call transport() is calculated by this feeMultiplier,
     *  times the dungeon difficulty of destination dungeon. The payment is accumulated to the rewards of the origin dungeon,
     *  and a large proportion will be claimed by whoever successfully challenged the floor.
     *  1000 szabo = 0.001 ether
     */
    uint public transportationFeeMultiplier = 500 szabo;


    /* ======== STORAGE ======== */


    /**
     * @dev A mapping from token IDs to the address that owns them.
     */
    mapping(address => uint) public playerToDungeonID;

    /**
     * @dev A mapping from owner address to count of tokens that address owns.
     */
    mapping(uint => uint) public dungeonPlayerCount;

    /**
     * @dev The main external function to call when a player transport to another dungeon.
     *  Will generate a PlayerTransported event.
     */
    function transport(uint _destinationDungeonId) whenNotPaused dungeonCanTransport(_destinationDungeonId) external payable {
        uint originDungeonId = playerToDungeonID[msg.sender];

        // Disallow transport to the same dungeon.
        require(_destinationDungeonId != originDungeonId);

        // Get the dungeon details from the token contract.
        uint difficulty;
        uint capacity;
        (,, difficulty, capacity,,,,,) = dungeonTokenContract.dungeons(_destinationDungeonId);

        // Disallow weaker user to transport to "difficult" dungeon.
        uint top5HeroesPower = _getTop5HeroesPower(msg.sender, _destinationDungeonId);
        require(top5HeroesPower >= difficulty * 12);

        // Checks for payment, any exceeding funds will be transferred back to the player.
        uint baseFee = difficulty * transportationFeeMultiplier;
        uint additionalFee = top5HeroesPower / 48 * transportationFeeMultiplier;
        uint requiredFee = baseFee + additionalFee;
        require(msg.value >= requiredFee);

        // ** STORAGE UPDATE **
        // Increment the accumulated rewards for the dungeon.
        dungeonTokenContract.addDungeonRewards(originDungeonId, requiredFee);

        // Calculate any excess funds and make it available to be withdrawed by the player.
        asyncSend(msg.sender, msg.value - requiredFee);

        _transport(originDungeonId, _destinationDungeonId);
    }

    /**
     * Private function to assigns location of a player
     */
    function _transport(uint _originDungeonId, uint _destinationDungeonId) private {
        // If a player do not have any hero, claim first hero.
        if (heroTokenContract.balanceOf(msg.sender) == 0) {
            claimHero();
        }

        // ** STORAGE UPDATE **
        // Update the ownershipTokenCount.
        dungeonPlayerCount[_originDungeonId]--;
        dungeonPlayerCount[_destinationDungeonId]++;

        // ** STORAGE UPDATE **
        // Update player location.
        playerToDungeonID[msg.sender] = _destinationDungeonId;

        // Emit the DungeonChallenged event.
        PlayerTransported(now, msg.sender, _originDungeonId, _destinationDungeonId);
    }


    /* ======== OWNERSHIP FUNCTIONS ======== */

    /**
     * @notice Used in transport, challenge and train, to get the genes of a specific hero,
     *  a claim a hero if didn't have any.
     */
    function _getHeroGenesOrClaimFirstHero(uint _heroId) internal returns (uint heroId, uint heroGenes) {
        heroId = _heroId;

        // If a player do not have any hero, claim first hero first.
        if (heroTokenContract.balanceOf(msg.sender) == 0) {
            heroId = claimHero();
        }

        (,,,heroGenes) = heroTokenContract.heroes(heroId);
    }

    /**
     * @dev Claim a new hero with empty genes.
     */
    function claimHero() public returns (uint) {
        // If a player do not tranport to any dungeon yet, and it is the first time claiming the hero,
        // set the dungeon location, increment the #0 Holyland player count by 1.
        if (playerToDungeonID[msg.sender] == 0 && heroTokenContract.balanceOf(msg.sender) == 0) {
            dungeonPlayerCount[0]++;
        }

        return heroTokenContract.createHero(0, msg.sender);
    }


    /* ======== SETTER FUNCTIONS ======== */

    /**
     * @dev Updates the fee contribution multiplier required for calling transport().
     */
    function setTransportationFeeMultiplier(uint _newTransportationFeeMultiplier) onlyOwner external {
        transportationFeeMultiplier = _newTransportationFeeMultiplier;
    }


    /* ======== MODIFIERS ======== */

    /**
     * @dev Throws if dungeon status do not allow transportation, also check for dungeon existence.
     *  Also check if the capacity of the destination dungeon is reached.
     */
    modifier dungeonCanTransport(uint _destinationDungeonId) {
        require(_destinationDungeonId < dungeonTokenContract.totalSupply());
        uint status;
        uint capacity;
        (,status,,capacity,,,,,) = dungeonTokenContract.dungeons(_destinationDungeonId);
        require(status == 0 || status == 1);

        // Check if the capacity of the destination dungeon is reached.
        // Capacity 0 = Infinity
        require(capacity == 0 || dungeonPlayerCount[_destinationDungeonId] < capacity);
        _;
    }

}

contract DungeonChallenge is DungeonTransportation {

    /**
     * @dev The DungeonChallenged event is fired when user finished a dungeon challenge.
     */
    event DungeonChallenged(uint timestamp, address indexed playerAddress, uint indexed dungeonId, uint indexed heroId, uint heroGenes, uint floorNumber, uint floorGenes, bool success, uint newFloorGenes, uint successRewards, uint masterRewards);


    /* ======== GAME SETTINGS ======== */

    /**
     * @notice The actual fee contribution required to call challenge() is calculated by this feeMultiplier,
     *  times the dungeon difficulty. The payment is accumulated to the dungeon rewards,
     *  and a large proportion will be claimed by whoever successfully challenged the floor.
     *  1 finney = 0.001 ether
     */
    uint public challengeFeeMultiplier = 1 finney;

    /**
     * @dev The percentage for which successful challenger be rewarded of the dungeons' accumulated rewards.
     *  The remaining rewards subtract dungeon master rewards will be used as the base rewards for new floor.
     */
    uint public challengeRewardsPercent = 64;

    /**
     * @dev The developer fee for owner
     *  Note that when Ether Dungeon becomes truly decentralised, contract ownership will be ejected,
     *  and the master rewards will be rewarded to the dungeon owner (Dungeon Masters).
     */
    uint public masterRewardsPercent = 8;

    /**
     * @dev The cooldown time period where a hero can engage in challenge again.
     *  This settings will likely be changed to 20 minutes when multiple heroes system is launched in Version 1.
     */
    uint public challengeCooldownTime = 3 minutes;

    /**
     * @dev The preparation time period where a new dungeon is created, before it can be challenged.
     *  This settings will likely be changed to a smaller period (e.g. 20-30 minutes) .
     */
    uint public dungeonPreparationTime = 60 minutes;

    /**
     * @dev The challenge rewards percentage used right after the preparation period.
     */
    uint public rushTimeChallengeRewardsPercent = 30;

    /**
     * @dev The number of floor in which the rushTimeChallengeRewardsPercent be applied.
     */
    uint public rushTimeFloorCount = 30;

    /**
     * @dev The main external function to call when a player challenge a dungeon,
     *  it determines whether if the player successfully challenged the current floor.
     *  Will generate a DungeonChallenged event.
     */
    function challenge(uint _dungeonId, uint _heroId) whenNotPaused dungeonCanChallenge(_dungeonId) heroAllowedToChallenge(_heroId) external payable {
        // Get the dungeon details from the token contract.
        uint difficulty;
        uint seedGenes;
        (,, difficulty,,,,, seedGenes,) = dungeonTokenContract.dungeons(_dungeonId);

        // Checks for payment, any exceeding funds will be transferred back to the player.
        uint requiredFee = difficulty * challengeFeeMultiplier;
        require(msg.value >= requiredFee);

        // ** STORAGE UPDATE **
        // Increment the accumulated rewards for the dungeon.
        dungeonTokenContract.addDungeonRewards(_dungeonId, requiredFee);

        // Calculate any excess funds and make it available to be withdrawed by the player.
        asyncSend(msg.sender, msg.value - requiredFee);

        // Split the challenge function into multiple parts because of stack too deep error.
        _challengePart2(_dungeonId, _heroId);
    }

    /**
     * Split the challenge function into multiple parts because of stack too deep error.
     */
    function _challengePart2(uint _dungeonId, uint _heroId) private {
        uint floorNumber;
        uint rewards;
        uint floorGenes;
        (,,,, floorNumber,, rewards,, floorGenes) = dungeonTokenContract.dungeons(_dungeonId);

        // Get the hero gene, or claim first hero.
        uint heroGenes;
        (_heroId, heroGenes) = _getHeroGenesOrClaimFirstHero(_heroId);

        bool success = _getChallengeSuccess(heroGenes, _dungeonId, floorGenes);

        uint newFloorGenes;
        uint masterRewards;
        uint successRewards;
        uint newRewards;

        // Whether a challenge is success or not is determined by a simple comparison between hero power and floor power.
        if (success) {
            newFloorGenes = _getNewFloorGene(_dungeonId);

            masterRewards = rewards * masterRewardsPercent / 100;

            if (floorNumber < rushTimeFloorCount) { // rush time right after prepration period
                successRewards = rewards * rushTimeChallengeRewardsPercent / 100;

                // The dungeon rewards for new floor as total rewards - challenge rewards - devleoper fee.
                newRewards = rewards * (100 - rushTimeChallengeRewardsPercent - masterRewardsPercent) / 100;
            } else {
                successRewards = rewards * challengeRewardsPercent / 100;
                newRewards = rewards * (100 - challengeRewardsPercent - masterRewardsPercent) / 100;
            }

            // TRIPLE CONFIRM sanity check.
            require(successRewards + masterRewards + newRewards <= rewards);

            // ** STORAGE UPDATE **
            // Add new floor with the new floor genes and new rewards.
            dungeonTokenContract.addDungeonNewFloor(_dungeonId, newRewards, newFloorGenes);

            // Mark the challenge rewards available to be withdrawed by the player.
            asyncSend(msg.sender, successRewards);

            // Mark the master rewards available to be withdrawed by the dungeon master.
            asyncSend(dungeonTokenContract.ownerOf(_dungeonId), masterRewards);
        }

        // ** STORAGE UPDATE **
        // Trigger the cooldown for the hero.
        heroTokenContract.triggerCooldown(_heroId);

        // Emit the DungeonChallenged event.
        DungeonChallenged(now, msg.sender, _dungeonId, _heroId, heroGenes, floorNumber, floorGenes, success, newFloorGenes, successRewards, masterRewards);
    }

    /**
     * Split the challenge function into multiple parts because of stack too deep error.
     */
    function _getChallengeSuccess(uint _heroGenes, uint _dungeonId, uint _floorGenes) private view returns (bool) {
        // Determine if the player challenge successfuly the dungeon or not.
        uint heroPower = _getHeroPower(_heroGenes, _dungeonId);
        uint floorPower = _getDungeonPower(_floorGenes);

        return heroPower > floorPower;
    }

    /**
     * Split the challenge function into multiple parts because of stack too deep error.
     */
    function _getNewFloorGene(uint _dungeonId) private returns (uint) {
        uint seedGenes;
        uint floorGenes;
        (,,,,,, seedGenes, floorGenes) = dungeonTokenContract.dungeons(_dungeonId);

        // Calculate the new floor gene.
        uint floorPower = _getDungeonPower(floorGenes);

        // Call the external closed source secret function that determines the resulting floor "genes".
        uint newFloorGenes = challengeScienceContract.mixGenes(floorGenes, seedGenes);

        uint newFloorPower = _getDungeonPower(newFloorGenes);

        // If the power decreased, rollback to the current floor genes.
        if (newFloorPower < floorPower) {
            newFloorGenes = floorGenes;
        }

        return newFloorGenes;
    }


    /* ======== SETTER FUNCTIONS ======== */

    /**
     * @dev Updates the fee contribution multiplier required for calling challenge().
     */
    function setChallengeFeeMultiplier(uint _newChallengeFeeMultiplier) onlyOwner external {
        challengeFeeMultiplier = _newChallengeFeeMultiplier;
    }

    /**
     * @dev Updates the challenge rewards pecentage.
     */
    function setChallengeRewardsPercent(uint _newChallengeRewardsPercent) onlyOwner external {
        challengeRewardsPercent = _newChallengeRewardsPercent;
    }

    /**
     * @dev Updates the master rewards percentage.
     */
    function setMasterRewardsPercent(uint _newMasterRewardsPercent) onlyOwner external {
        masterRewardsPercent = _newMasterRewardsPercent;
    }

    /**
     * @dev Updates the challenge cooldown time.
     */
    function setChallengeCooldownTime(uint _newChallengeCooldownTime) onlyOwner external {
        challengeCooldownTime = _newChallengeCooldownTime;
    }

    /**
     * @dev Updates the challenge cooldown time.
     */
    function setDungeonPreparationTime(uint _newDungeonPreparationTime) onlyOwner external {
        dungeonPreparationTime = _newDungeonPreparationTime;
    }

    /**
     * @dev Updates the rush time challenge rewards percentage.
     */
    function setRushTimeChallengeRewardsPercent(uint _newRushTimeChallengeRewardsPercent) onlyOwner external {
        rushTimeChallengeRewardsPercent = _newRushTimeChallengeRewardsPercent;
    }

    /**
     * @dev Updates the rush time floor count.
     */
    function setRushTimeFloorCount(uint _newRushTimeFloorCount) onlyOwner external {
        rushTimeFloorCount = _newRushTimeFloorCount;
    }


    /* ======== MODIFIERS ======== */

    /**
     * @dev Throws if dungeon status do not allow challenge, also check for dungeon existence.
     *  Also check if the user is in the dungeon.
     *  Also check if the dungeon is not in preparation period.
     */
    modifier dungeonCanChallenge(uint _dungeonId) {
        require(_dungeonId < dungeonTokenContract.totalSupply());
        uint creationTime;
        uint status;
        (creationTime, status,,,,,,,) = dungeonTokenContract.dungeons(_dungeonId);
        require(status == 0 || status == 2);

        // Check if the user is in the dungeon.
        require(playerToDungeonID[msg.sender] == _dungeonId);

        // Check if the dungeon is not in preparation period.
        require(creationTime + dungeonPreparationTime <= now);
        _;
    }

    /**
     * @dev Throws if player does not own the hero, or it is still in cooldown.
     *  Unless the player does not have any hero yet, which will auto claim one during first challenge / train.
     */
    modifier heroAllowedToChallenge(uint _heroId) {
        if (heroTokenContract.balanceOf(msg.sender) > 0) {
            // You can only challenge with your own hero.
            require(heroTokenContract.ownerOf(_heroId) == msg.sender);

            uint cooldownStartTime;
            (, cooldownStartTime,,) = heroTokenContract.heroes(_heroId);
            require(cooldownStartTime + challengeCooldownTime <= now);
        }
        _;
    }

}

contract DungeonTraining is DungeonChallenge {

    /**
     * @dev The HeroTrained event is fired when user finished a training.
     */
    event HeroTrained(uint timestamp, address indexed playerAddress, uint indexed dungeonId, uint indexed heroId, uint heroGenes, uint floorNumber, uint floorGenes, bool success, uint newHeroGenes);


    /* ======== GAME SETTINGS ======== */

    /**
     * @dev The actual fee contribution required to call trainX() is calculated by this feeMultiplier,
     *  times the dungeon difficulty, times X. The payment is accumulated to the dungeon rewards,
     *  and a large proportion will be claimed by whoever successfully challenged the floor.
     *  1 finney = 0.001 ether
     */
    uint public trainingFeeMultiplier = 2 finney;

    /**
     * @dev The discounted training fee multiplier to be used in the preparation period.
     * 1000 szabo = 0.001 ether
     */
    uint public preparationPeriodTrainingFeeMultiplier = 1800 szabo;

    /**
     * @dev The actual fee contribution required to call trainEquipment() is calculated by this feeMultiplier,
     *  times the dungeon difficulty, times X. The payment is accumulated to the dungeon rewards,
     *  and a large proportion will be claimed by whoever successfully challenged the floor.
     *  (No preparation period discount on equipment training.)
     *  1000 szabo = 0.001 ether
     */
    uint public equipmentTrainingFeeMultiplier = 500 szabo;

    /**
     * @dev The external function to call when a hero train with a dungeon,
     *  it determines whether whether a training is successfully, and the resulting genes.
     *  Will generate a DungeonChallenged event.
     */
    function train1(uint _dungeonId, uint _heroId) whenNotPaused dungeonCanTrain(_dungeonId) heroAllowedToTrain(_heroId) external payable {
        _train(_dungeonId, _heroId, 0, 1);
    }

    function train2(uint _dungeonId, uint _heroId) whenNotPaused dungeonCanTrain(_dungeonId) heroAllowedToTrain(_heroId) external payable {
        _train(_dungeonId, _heroId, 0, 2);
    }

    function train3(uint _dungeonId, uint _heroId) whenNotPaused dungeonCanTrain(_dungeonId) heroAllowedToTrain(_heroId) external payable {
        _train(_dungeonId, _heroId, 0, 3);
    }

    /**
     * @dev The external function to call when a hero train a particular equipment with a dungeon,
     *  it determines whether whether a training is successfully, and the resulting genes.
     *  Will generate a DungeonChallenged event.
     *  _equipmentIndex is the index of equipment: 0 is train all attributes, including equipments and stats.
     *  1: weapon | 2: shield | 3: armor | 4: shoe | 5: helmet | 6: gloves | 7: belt | 8: shawl
     */
    function trainEquipment(uint _dungeonId, uint _heroId, uint _equipmentIndex) whenNotPaused dungeonCanTrain(_dungeonId) heroAllowedToTrain(_heroId) external payable {
        require(_equipmentIndex <= 8);

        _train(_dungeonId, _heroId, _equipmentIndex, 1);
    }

    /**
     * @dev An internal function of a hero train with dungeon,
     *  it determines whether whether a training is successfully, and the resulting genes.
     *  Will generate a DungeonChallenged event.
     */
    function _train(uint _dungeonId, uint _heroId, uint _equipmentIndex, uint _trainingTimes) private {
        // Get the dungeon details from the token contract.
        uint creationTime;
        uint difficulty;
        uint floorNumber;
        uint rewards;
        uint seedGenes;
        uint floorGenes;
        (creationTime,,difficulty,,floorNumber,,rewards,seedGenes,floorGenes) = dungeonTokenContract.dungeons(_dungeonId);

        // Check for _trainingTimes abnormality, we probably won't have any feature that train a hero 10 times with a single call.
        require(_trainingTimes < 10);

        // Checks for payment, any exceeding funds will be transferred back to the player.
        uint requiredFee;

        if (_equipmentIndex > 0) { // train specific equipments
            requiredFee = difficulty * equipmentTrainingFeeMultiplier * _trainingTimes;
        } else if (now < creationTime + dungeonPreparationTime) { // train all attributes, preparation period
            requiredFee = difficulty * preparationPeriodTrainingFeeMultiplier * _trainingTimes;
        } else { // train all attributes, normal period
            requiredFee = difficulty * trainingFeeMultiplier * _trainingTimes;
        }

        require(msg.value >= requiredFee);

        // Get the hero gene, or claim first hero.
        uint heroGenes;
        (_heroId, heroGenes) = _getHeroGenesOrClaimFirstHero(_heroId);

        // ** STORAGE UPDATE **
        // Increment the accumulated rewards for the dungeon.
        dungeonTokenContract.addDungeonRewards(_dungeonId, requiredFee);

        // Calculate any excess funds and make it available to be withdrawed by the player.
        asyncSend(msg.sender, msg.value - requiredFee);

        // Split the _train function into multiple parts because of stack too deep error.
        _trainPart2(_dungeonId, _heroId, heroGenes, _equipmentIndex, _trainingTimes);
    }

    /**
     * Split the _train function into multiple parts because of Stack Too Deep error.
     */
    function _trainPart2(uint _dungeonId, uint _heroId, uint _heroGenes, uint _equipmentIndex, uint _trainingTimes) private {
        // Get the dungeon details from the token contract.
        uint floorNumber;
        uint floorGenes;
        (,,,, floorNumber,,,, floorGenes) = dungeonTokenContract.dungeons(_dungeonId);

        // Determine if the hero training is successful or not, and the resulting genes.
        uint heroPower = _getHeroPower(_heroGenes, _dungeonId);

        uint newHeroGenes = _heroGenes;
        uint newHeroPower = heroPower;

        // Train the hero multiple times according to _trainingTimes,
        // each time if the resulting power is larger, update new hero power.
        for (uint i = 0; i < _trainingTimes; i++) {
            // Call the external closed source secret function that determines the resulting hero "genes".
            uint tmpHeroGenes = trainingScienceContract.mixGenes(newHeroGenes, floorGenes, _equipmentIndex);

            uint tmpHeroPower = _getHeroPower(tmpHeroGenes, _dungeonId);

            if (tmpHeroPower > newHeroPower) {
                newHeroGenes = tmpHeroGenes;
                newHeroPower = tmpHeroPower;
            }
        }

        // Prevent reduced power.
        if (newHeroPower > heroPower) {
            // ** STORAGE UPDATE **
            // Set the upgraded hero genes.
            heroTokenContract.setHeroGenes(_heroId, newHeroGenes);
        }

        // Emit the HeroTrained event.
        HeroTrained(now, msg.sender, _dungeonId, _heroId, _heroGenes, floorNumber, floorGenes, newHeroPower > heroPower, newHeroGenes);
    }


    /* ======== SETTER FUNCTIONS ======== */

    /// @dev Updates the fee contribution multiplier required for calling trainX().
    function setTrainingFeeMultiplier(uint _newTrainingFeeMultiplier) onlyOwner external {
        trainingFeeMultiplier = _newTrainingFeeMultiplier;
    }

    /// @dev Updates the fee contribution multiplier for preparation period required for calling trainX().
    function setPreparationPeriodTrainingFeeMultiplier(uint _newPreparationPeriodTrainingFeeMultiplier) onlyOwner external {
        preparationPeriodTrainingFeeMultiplier = _newPreparationPeriodTrainingFeeMultiplier;
    }

    /// @dev Updates the fee contribution multiplier required for calling trainEquipment().
    function setEquipmentTrainingFeeMultiplier(uint _newEquipmentTrainingFeeMultiplier) onlyOwner external {
        equipmentTrainingFeeMultiplier = _newEquipmentTrainingFeeMultiplier;
    }


    /* ======== MODIFIERS ======== */

    /**
     * @dev Throws if dungeon status do not allow training, also check for dungeon existence.
     *  Also check if the user is in the dungeon.
     */
    modifier dungeonCanTrain(uint _dungeonId) {
        require(_dungeonId < dungeonTokenContract.totalSupply());
        uint status;
        (,status,,,,,,,) = dungeonTokenContract.dungeons(_dungeonId);
        require(status == 0 || status == 3);

        // Also check if the user is in the dungeon.
        require(playerToDungeonID[msg.sender] == _dungeonId);
        _;
    }

    /**
     * @dev Throws if player does not own the hero.
     *  Unless the player does not have any hero yet, which will auto claim one during first challenge / train.
     */
    modifier heroAllowedToTrain(uint _heroId) {
        if (heroTokenContract.balanceOf(msg.sender) > 0) {
            // You can only train with your own hero.
            require(heroTokenContract.ownerOf(_heroId) == msg.sender);
        }
        _;
    }


}

/**
 * @title DungeonCoreBeta
 * @dev Core Contract of Ether Dungeon.
 *  When Version 1 launches, DungeonCoreVersion1 contract will be deployed and DungeonCoreBeta will be destroyed.
 *  Since all dungeons and heroes are stored as tokens in external contracts, they remains immutable.
 */
contract DungeonCoreBeta is Destructible, DungeonTraining {

    /**
     * Initialize the DungeonCore contract with all the required contract addresses.
     */
    function DungeonCoreBeta(
        address _dungeonTokenAddress,
        address _heroTokenAddress,
        address _challengeScienceAddress,
        address _trainingScienceAddress
    ) public {
        dungeonTokenContract = DungeonToken(_dungeonTokenAddress);
        heroTokenContract = HeroToken(_heroTokenAddress);
        challengeScienceContract = ChallengeScienceInterface(_challengeScienceAddress);
        trainingScienceContract = TrainingScienceInterface(_trainingScienceAddress);
    }

    /**
     * @dev The external function to get all the relevant information about a specific dungeon by its ID.
     * @param _id The ID of the dungeon.
     */
    function getDungeonDetails(uint _id) external view returns (uint creationTime, uint status, uint difficulty, uint capacity, bool isReady, uint playerCount) {
        require(_id < dungeonTokenContract.totalSupply());

        // Didn't get the "floorCreationTime" because of Stack Too Deep error.
        (creationTime, status, difficulty, capacity,,,,,) = dungeonTokenContract.dungeons(_id);

        // Dungeon is ready to be challenged (not in preparation mode).
        isReady = creationTime + dungeonPreparationTime <= now;
        playerCount = dungeonPlayerCount[_id];
    }

    /**
     * @dev Split floor related details out of getDungeonDetails, just to avoid Stack Too Deep error.
     * @param _id The ID of the dungeon.
     */
    function getDungeonFloorDetails(uint _id) external view returns (uint floorNumber, uint floorCreationTime, uint rewards, uint seedGenes, uint floorGenes) {
        require(_id < dungeonTokenContract.totalSupply());

        // Didn't get the "floorCreationTime" because of Stack Too Deep error.
        (,,,, floorNumber, floorCreationTime, rewards, seedGenes, floorGenes) = dungeonTokenContract.dungeons(_id);
    }

    /**
     * @dev The external function to get all the relevant information about a specific hero by its ID.
     * @param _id The ID of the hero.
     */
    function getHeroDetails(uint _id) external view returns (uint creationTime, uint cooldownStartTime, uint cooldownIndex, uint genes, bool isReady) {
        require(_id < heroTokenContract.totalSupply());

        (creationTime, cooldownStartTime, cooldownIndex, genes) = heroTokenContract.heroes(_id);

        // Hero is ready to challenge (not in cooldown mode).
        isReady = cooldownStartTime + challengeCooldownTime <= now;
    }

    /**
     * @dev The external function to get all the relevant information about a specific player by its address.
     * @param _address The address of the player.
     */
    function getPlayerDetails(address _address) external view returns (uint dungeonId, uint payment) {
        dungeonId = playerToDungeonID[_address];
        payment = payments[_address];
    }

}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"totalPayments","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newChallengeCooldownTime","type":"uint256"}],"name":"setChallengeCooldownTime","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"dungeonPlayerCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dungeonTokenContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rushTimeFloorCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getDungeonDetails","outputs":[{"name":"creationTime","type":"uint256"},{"name":"status","type":"uint256"},{"name":"difficulty","type":"uint256"},{"name":"capacity","type":"uint256"},{"name":"isReady","type":"bool"},{"name":"playerCount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_dungeonId","type":"uint256"},{"name":"_heroId","type":"uint256"}],"name":"challenge","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_newDungeonPreparationTime","type":"uint256"}],"name":"setDungeonPreparationTime","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newRushTimeChallengeRewardsPercent","type":"uint256"}],"name":"setRushTimeChallengeRewardsPercent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newTrainingFeeMultiplier","type":"uint256"}],"name":"setTrainingFeeMultiplier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_dungeonId","type":"uint256"},{"name":"_heroId","type":"uint256"}],"name":"train1","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"heroTokenContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newTransportationFeeMultiplier","type":"uint256"}],"name":"setTransportationFeeMultiplier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"transportationFeeMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newHeroTokenContract","type":"address"}],"name":"setHeroTokenContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"playerToDungeonID","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newDungeonTokenContract","type":"address"}],"name":"setDungeonTokenContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newEquipmentTrainingFeeMultiplier","type":"uint256"}],"name":"setEquipmentTrainingFeeMultiplier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getDungeonFloorDetails","outputs":[{"name":"floorNumber","type":"uint256"},{"name":"floorCreationTime","type":"uint256"},{"name":"rewards","type":"uint256"},{"name":"seedGenes","type":"uint256"},{"name":"floorGenes","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawPayments","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getHeroDetails","outputs":[{"name":"creationTime","type":"uint256"},{"name":"cooldownStartTime","type":"uint256"},{"name":"cooldownIndex","type":"uint256"},{"name":"genes","type":"uint256"},{"name":"isReady","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_dungeonId","type":"uint256"},{"name":"_heroId","type":"uint256"}],"name":"train3","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"challengeCooldownTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"destroy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newMasterRewardsPercent","type":"uint256"}],"name":"setMasterRewardsPercent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"preparationPeriodTrainingFeeMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_destinationDungeonId","type":"uint256"}],"name":"transport","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newChallengeFeeMultiplier","type":"uint256"}],"name":"setChallengeFeeMultiplier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_dungeonId","type":"uint256"},{"name":"_heroId","type":"uint256"},{"name":"_equipmentIndex","type":"uint256"}],"name":"trainEquipment","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_newTrainingScienceAddress","type":"address"}],"name":"setTrainingScienceContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"challengeFeeMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_dungeonId","type":"uint256"},{"name":"_heroId","type":"uint256"}],"name":"train2","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"rushTimeChallengeRewardsPercent","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"trainingFeeMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newChallengeRewardsPercent","type":"uint256"}],"name":"setChallengeRewardsPercent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"dungeonPreparationTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newPreparationPeriodTrainingFeeMultiplier","type":"uint256"}],"name":"setPreparationPeriodTrainingFeeMultiplier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_address","type":"address"}],"name":"getPlayerDetails","outputs":[{"name":"dungeonId","type":"uint256"},{"name":"payment","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"claimHero","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"removeOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"payments","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newChallengeScienceAddress","type":"address"}],"name":"setChallengeScienceContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"equipmentTrainingFeeMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"masterRewardsPercent","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newRushTimeFloorCount","type":"uint256"}],"name":"setRushTimeFloorCount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_recipient","type":"address"}],"name":"destroyAndSend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"challengeRewardsPercent","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_dungeonTokenAddress","type":"address"},{"name":"_heroTokenAddress","type":"address"},{"name":"_challengeScienceAddress","type":"address"},{"name":"_trainingScienceAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"timestamp","type":"uint256"},{"indexed":true,"name":"playerAddress","type":"address"},{"indexed":true,"name":"dungeonId","type":"uint256"},{"indexed":true,"name":"heroId","type":"uint256"},{"indexed":false,"name":"heroGenes","type":"uint256"},{"indexed":false,"name":"floorNumber","type":"uint256"},{"indexed":false,"name":"floorGenes","type":"uint256"},{"indexed":false,"name":"success","type":"bool"},{"indexed":false,"name":"newHeroGenes","type":"uint256"}],"name":"HeroTrained","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"timestamp","type":"uint256"},{"indexed":true,"name":"playerAddress","type":"address"},{"indexed":true,"name":"dungeonId","type":"uint256"},{"indexed":true,"name":"heroId","type":"uint256"},{"indexed":false,"name":"heroGenes","type":"uint256"},{"indexed":false,"name":"floorNumber","type":"uint256"},{"indexed":false,"name":"floorGenes","type":"uint256"},{"indexed":false,"name":"success","type":"bool"},{"indexed":false,"name":"newFloorGenes","type":"uint256"},{"indexed":false,"name":"successRewards","type":"uint256"},{"indexed":false,"name":"masterRewards","type":"uint256"}],"name":"DungeonChallenged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"timestamp","type":"uint256"},{"indexed":true,"name":"playerAddress","type":"address"},{"indexed":true,"name":"originDungeonId","type":"uint256"},{"indexed":true,"name":"destinationDungeonId","type":"uint256"}],"name":"PlayerTransported","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060409081526000805460a060020a60ff02191690556104009051908101604090815260018252600260208084019190915260048284018190526005606085015260106080808601829052601160a0870152601260c0870152601360e08701526000610100870181905261012087018190526101408701819052610160870181905261018087018190526101a087018190526101c087018190526101e087018190526102008701939093526102208601919091526102408501839052602161026086015261028085018290526102a085018290526102c085018290526102e085018290526103008501839052610320850193909352610340840181905261036084018190526103808401929092526103a083018290526103c083018290526103e083019190915262000135916007916200022d565b5060206009556601c6bf52634000600a5566038d7ea4c68000600d556040600e556008600f5560b4601055610e10601155601e601255601e60135566071afd498d000060145566066517289880006015556601c6bf5263400060165534156200019d57600080fd5b6040516080806200389d8339810160405280805191906020018051919060200180519190602001805160008054600160a060020a031990811633600160a060020a03908116919091179092556003805482169883169890981790975560048054881696821696909617909555600580548716948616949094179093555050600680549093169116179055620002ee565b600283019183908215620002b75791602002820160005b838211156200028557835183826101000a81548161ffff021916908360ff160217905550926020019260020160208160010104928301926001030262000244565b8015620002b55782816101000a81549061ffff021916905560020160208160010104928301926001030262000285565b505b50620002c5929150620002c9565b5090565b620002eb91905b80821115620002c557805461ffff19168155600101620002d0565b90565b61359f80620002fe6000396000f3006060604052600436106102575763ffffffff60e060020a6000350416625b4487811461025c578063024c764f14610281578063030c3631146102995780630c17d023146102af578063111839d5146102de5780631cfd11d5146102f15780632e414890146103425780633350b91514610350578063368d6b251461036657806336a608911461037c5780633f4ba83a146103925780633fc0234d146103a55780634272f2d5146103b3578063463fbb76146103c6578063496fbeb3146103dc5780634b12416c146103ef57806354bf3a731461040e5780635661ba151461042d5780635a2f71d41461044c5780635c975abb146104625780635ead330c146104895780636103d70b146104d1578063730bdc96146104e4578063761bb70a1461052b578063806bd2b61461053957806383197ef01461054c578063841206451461055f5780638456cb59146105755780638ca84d40146105885780638d1c80481461059b5780638da5cb5b146105a65780639406cf59146105b957806397cdcbfd146105cf578063a71168e3146105e0578063a9e899ef146105ff578063ab702d4814610612578063ae7b162014610620578063b37dcce214610633578063bb828f1114610646578063be523c231461065c578063c5c9e3be1461066f578063c8dd6ce714610685578063c91b46c6146106bc578063d99bb9f7146106cf578063e2982c21146106e2578063e2c2d72c14610701578063ed225a8a14610720578063efb95ced14610733578063f2d93fb014610746578063f2fde38b1461075c578063f5074f411461077b578063fe2450c11461079a575b600080fd5b341561026757600080fd5b61026f6107ad565b60405190815260200160405180910390f35b341561028c57600080fd5b6102976004356107b3565b005b34156102a457600080fd5b61026f6004356107d3565b34156102ba57600080fd5b6102c26107e5565b604051600160a060020a03909116815260200160405180910390f35b34156102e957600080fd5b61026f6107f4565b34156102fc57600080fd5b6103076004356107fa565b604051958652602086019490945260408086019390935260608501919091521515608084015260a083019190915260c0909101905180910390f35b610297600435602435610976565b341561035b57600080fd5b610297600435610dfa565b341561037157600080fd5b610297600435610e1a565b341561038757600080fd5b610297600435610e3a565b341561039d57600080fd5b610297610e5a565b610297600435602435610ed9565b34156103be57600080fd5b6102c2611165565b34156103d157600080fd5b610297600435611174565b34156103e757600080fd5b61026f611194565b34156103fa57600080fd5b610297600160a060020a036004351661119a565b341561041957600080fd5b61026f600160a060020a03600435166111d7565b341561043857600080fd5b610297600160a060020a03600435166111e9565b341561045757600080fd5b610297600435611226565b341561046d57600080fd5b610475611246565b604051901515815260200160405180910390f35b341561049457600080fd5b61049f600435611256565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b34156104dc57600080fd5b6102976113ce565b34156104ef57600080fd5b6104fa600435611467565b60405194855260208501939093526040808501929092526060840152901515608083015260a0909101905180910390f35b61029760043560243561158f565b341561054457600080fd5b61026f611814565b341561055757600080fd5b61029761181a565b341561056a57600080fd5b610297600435611843565b341561058057600080fd5b610297611863565b341561059357600080fd5b61026f6118e7565b6102976004356118ed565b34156105b157600080fd5b6102c2611c19565b34156105c457600080fd5b610297600435611c28565b610297600435602435604435611c48565b34156105eb57600080fd5b610297600160a060020a0360043516611ee2565b341561060a57600080fd5b61026f611f1f565b610297600435602435611f25565b341561062b57600080fd5b61026f6121aa565b341561063e57600080fd5b61026f6121b0565b341561065157600080fd5b6102976004356121b6565b341561066757600080fd5b61026f6121d6565b341561067a57600080fd5b6102976004356121dc565b341561069057600080fd5b6106a4600160a060020a03600435166121fc565b60405191825260208201526040908101905180910390f35b34156106c757600080fd5b61026f612224565b34156106da57600080fd5b610297612371565b34156106ed57600080fd5b61026f600160a060020a036004351661239e565b341561070c57600080fd5b610297600160a060020a03600435166123b0565b341561072b57600080fd5b61026f6123ed565b341561073e57600080fd5b61026f6123f3565b341561075157600080fd5b6102976004356123f9565b341561076757600080fd5b610297600160a060020a0360043516612419565b341561078657600080fd5b610297600160a060020a03600435166124a7565b34156107a557600080fd5b61026f6124ce565b60025481565b60005433600160a060020a039081169116146107ce57600080fd5b601055565b600c6020526000908152604090205481565b600354600160a060020a031681565b60135481565b60035460009081908190819081908190600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561084e57600080fd5b6102c65a03f1151561085f57600080fd5b50505060405180518810905061087457600080fd5b600354600160a060020a031663956e958a886000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b15156108c757600080fd5b6102c65a03f115156108d857600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190508863ffffffff1698508760ff1697508660ff1696508561ffff1695509091929350909192509091509050508096508197508298508399505050505042601154870111159150600c600088815260200190815260200160002054905091939550919395565b600080548190819060a060020a900460ff161561099257600080fd5b60035485906000908190600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156109e057600080fd5b6102c65a03f115156109f157600080fd5b505050604051805184109050610a0657600080fd5b600354600160a060020a031663956e958a846000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b1515610a5957600080fd5b6102c65a03f11515610a6a57600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051906020018051906020018051906020018051505063ffffffff90971698505060ff90941695505084159350839250610acb9150505750806002145b1515610ad657600080fd5b600160a060020a0333166000908152600b60205260409020548314610afa57600080fd5b601154429083011115610b0c57600080fd5b60045487906000908190600160a060020a03166370a0823133836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610b6b57600080fd5b6102c65a03f11515610b7c57600080fd5b505050604051805190501115610cb257600454600160a060020a033381169116636352211e8460006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610be157600080fd5b6102c65a03f11515610bf257600080fd5b50505060405180519050600160a060020a0316141515610c1157600080fd5b600454600160a060020a031663a8d4a03b8360006040516080015260405160e060020a63ffffffff84160281526004810191909152602401608060405180830381600087803b1515610c6257600080fd5b6102c65a03f11515610c7357600080fd5b5050506040518051906020018051906020018051906020018051505060105467ffffffffffffffff9092169350504290830111159050610cb257600080fd5b600354600160a060020a031663956e958a8b6000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b1515610d0557600080fd5b6102c65a03f11515610d1657600080fd5b50505060405180519060200180519060200180519060200180519060200180519060200180519060200180519060200180519060200180515050600d5460ff9096169f509d505050918c02995050505034879010159050610d7657600080fd5b600354600160a060020a031663a64f829a8b8860405160e060020a63ffffffff851602815260048101929092526024820152604401600060405180830381600087803b1515610dc457600080fd5b6102c65a03f11515610dd557600080fd5b505050610de4338734036124d4565b610dee8a8a612530565b50505050505050505050565b60005433600160a060020a03908116911614610e1557600080fd5b601155565b60005433600160a060020a03908116911614610e3557600080fd5b601255565b60005433600160a060020a03908116911614610e5557600080fd5b601455565b60005433600160a060020a03908116911614610e7557600080fd5b60005460a060020a900460ff161515610e8d57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60005460a060020a900460ff1615610ef057600080fd5b6003548290600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610f3c57600080fd5b6102c65a03f11515610f4d57600080fd5b505050604051805183109050610f6257600080fd5b600354600160a060020a031663956e958a836000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b1515610fb557600080fd5b6102c65a03f11515610fc657600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051906020018051906020018051906020018051505060ff9096169750508615955085945061101e93505050505750806003145b151561102957600080fd5b600160a060020a0333166000908152600b6020526040902054821461104d57600080fd5b6004548390600090600160a060020a03166370a0823133836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156110aa57600080fd5b6102c65a03f115156110bb57600080fd5b50505060405180519050111561115057600454600160a060020a033381169116636352211e8360006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561112057600080fd5b6102c65a03f1151561113157600080fd5b50505060405180519050600160a060020a031614151561115057600080fd5b61115e858560006001612898565b5050505050565b600454600160a060020a031681565b60005433600160a060020a0390811691161461118f57600080fd5b600a55565b600a5481565b60005433600160a060020a039081169116146111b557600080fd5b60048054600160a060020a031916600160a060020a0392909216919091179055565b600b6020526000908152604090205481565b60005433600160a060020a0390811691161461120457600080fd5b60038054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461124157600080fd5b601655565b60005460a060020a900460ff1681565b6003546000908190819081908190600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156112a857600080fd5b6102c65a03f115156112b957600080fd5b5050506040518051871090506112ce57600080fd5b600354600160a060020a031663956e958a876000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b151561132157600080fd5b6102c65a03f1151561133257600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190509091929394959697509091929394959650909192939495509091929394508463ffffffff1694508363ffffffff169350826fffffffffffffffffffffffffffffffff169250809550819650829750839850849950505050505091939590929450565b33600160a060020a0381166000908152600160205260409020548015156113f457600080fd5b600160a060020a033016318190101561140c57600080fd5b60025461141f908263ffffffff612a8c16565b600255600160a060020a0382166000818152600160205260408082209190915582156108fc0290839051600060405180830381858888f19350505050151561146357fe5b5050565b6004546000908190819081908190600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156114b957600080fd5b6102c65a03f115156114ca57600080fd5b5050506040518051871090506114df57600080fd5b600454600160a060020a031663a8d4a03b8760006040516080015260405160e060020a63ffffffff84160281526004810191909152602401608060405180830381600087803b151561153057600080fd5b6102c65a03f1151561154157600080fd5b505050604051805190602001805190602001805190602001805160105467ffffffffffffffff9586169c949095169a5063ffffffff9092169850909650504291880191909111159350915050565b60005460a060020a900460ff16156115a657600080fd5b6003548290600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156115f257600080fd5b6102c65a03f1151561160357600080fd5b50505060405180518310905061161857600080fd5b600354600160a060020a031663956e958a836000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b151561166b57600080fd5b6102c65a03f1151561167c57600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051906020018051906020018051906020018051505060ff909616975050861595508594506116d493505050505750806003145b15156116df57600080fd5b600160a060020a0333166000908152600b6020526040902054821461170357600080fd5b6004548390600090600160a060020a03166370a0823133836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561176057600080fd5b6102c65a03f1151561177157600080fd5b50505060405180519050111561180657600454600160a060020a033381169116636352211e8360006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156117d657600080fd5b6102c65a03f115156117e757600080fd5b50505060405180519050600160a060020a031614151561180657600080fd5b61115e858560006003612898565b60105481565b60005433600160a060020a0390811691161461183557600080fd5b600054600160a060020a0316ff5b60005433600160a060020a0390811691161461185e57600080fd5b600f55565b60005433600160a060020a0390811691161461187e57600080fd5b60005460a060020a900460ff161561189557600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60155481565b60008060008060008060008060149054906101000a900460ff1615151561191357600080fd5b60035488906000908190600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561196157600080fd5b6102c65a03f1151561197257600080fd5b50505060405180518410905061198757600080fd5b600354600160a060020a031663956e958a846000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b15156119da57600080fd5b6102c65a03f115156119eb57600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805150505060ff959095169750505061ffff1693505083159150819050611a485750816001145b1515611a5357600080fd5b801580611a6e57506000838152600c60205260409020548190105b1515611a7957600080fd5b600160a060020a0333166000908152600b602052604090205499508a8a1415611aa157600080fd5b600354600160a060020a031663956e958a8c6000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b1515611af457600080fd5b6102c65a03f11515611b0557600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805150505060ff949094169e50505061ffff169a50611b6092503391508d9050612a9e565b9650600c8902871015611b7257600080fd5b600a5489810296506030880402945085850193503484901015611b9457600080fd5b600354600160a060020a031663a64f829a8b8660405160e060020a63ffffffff851602815260048101929092526024820152604401600060405180830381600087803b1515611be257600080fd5b6102c65a03f11515611bf357600080fd5b505050611c02338534036124d4565b611c0c8a8c612d33565b5050505050505050505050565b600054600160a060020a031681565b60005433600160a060020a03908116911614611c4357600080fd5b600d55565b60005460a060020a900460ff1615611c5f57600080fd5b6003548390600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611cab57600080fd5b6102c65a03f11515611cbc57600080fd5b505050604051805183109050611cd157600080fd5b600354600160a060020a031663956e958a836000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b1515611d2457600080fd5b6102c65a03f11515611d3557600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051906020018051906020018051906020018051505060ff90961697505086159550859450611d8d93505050505750806003145b1515611d9857600080fd5b600160a060020a0333166000908152600b60205260409020548214611dbc57600080fd5b6004548490600090600160a060020a03166370a0823133836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611e1957600080fd5b6102c65a03f11515611e2a57600080fd5b505050604051805190501115611ebf57600454600160a060020a033381169116636352211e8360006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515611e8f57600080fd5b6102c65a03f11515611ea057600080fd5b50505060405180519050600160a060020a0316141515611ebf57600080fd5b6008841115611ecd57600080fd5b611eda8686866001612898565b505050505050565b60005433600160a060020a03908116911614611efd57600080fd5b60068054600160a060020a031916600160a060020a0392909216919091179055565b600d5481565b60005460a060020a900460ff1615611f3c57600080fd5b6003548290600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611f8857600080fd5b6102c65a03f11515611f9957600080fd5b505050604051805183109050611fae57600080fd5b600354600160a060020a031663956e958a836000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b151561200157600080fd5b6102c65a03f1151561201257600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051906020018051906020018051906020018051505060ff9096169750508615955085945061206a93505050505750806003145b151561207557600080fd5b600160a060020a0333166000908152600b6020526040902054821461209957600080fd5b6004548390600090600160a060020a03166370a0823133836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156120f657600080fd5b6102c65a03f1151561210757600080fd5b50505060405180519050111561219c57600454600160a060020a033381169116636352211e8360006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561216c57600080fd5b6102c65a03f1151561217d57600080fd5b50505060405180519050600160a060020a031614151561219c57600080fd5b61115e858560006002612898565b60125481565b60145481565b60005433600160a060020a039081169116146121d157600080fd5b600e55565b60115481565b60005433600160a060020a039081169116146121f757600080fd5b601555565b600160a060020a03166000908152600b60209081526040808320546001909252909120549091565b600160a060020a0333166000908152600b60205260408120541580156122bb5750600454600160a060020a03166370a082313360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561229e57600080fd5b6102c65a03f115156122af57600080fd5b50505060405180511590505b156122f25760008052600c6020527f13649b2456f1b42fef0f0040b3aaeabcd21a76a0f3f5defd4f583839455116e8805460010190555b600454600160a060020a03166314fbc22b600033816040516020015260405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401602060405180830381600087803b151561235257600080fd5b6102c65a03f1151561236357600080fd5b505050604051805191505090565b60005433600160a060020a0390811691161461238c57600080fd5b60008054600160a060020a0319169055565b60016020526000908152604090205481565b60005433600160a060020a039081169116146123cb57600080fd5b60058054600160a060020a031916600160a060020a0392909216919091179055565b60165481565b600f5481565b60005433600160a060020a0390811691161461241457600080fd5b601355565b60005433600160a060020a0390811691161461243457600080fd5b600160a060020a038116151561244957600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054600160a060020a031916600160a060020a0392909216919091179055565b60005433600160a060020a039081169116146124c257600080fd5b80600160a060020a0316ff5b600e5481565b600160a060020a0382166000908152600160205260409020546124fd908263ffffffff612e3216565b600160a060020a038316600090815260016020526040902055600254612529908263ffffffff612e3216565b6002555050565b6000806000806000806000806000600360009054906101000a9004600160a060020a0316600160a060020a031663956e958a8c6000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b15156125a457600080fd5b6102c65a03f115156125b557600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190509091929394959697509091929394959650909192939495509091929394508463ffffffff16945090919250826fffffffffffffffffffffffffffffffff1692509050809950819a50829b505050506126468a612e48565b909a509550612656868c89612f59565b945084156127b4576126678b612f7f565b600f54909450606490890204925060135489101561269d57601254600f5460648a830281900494509182030389020490506126b7565b600e54600f5460648a830281900494509182030389020490505b8183018101889011156126c957600080fd5b600354600160a060020a0316630b4964a88c838760405160e060020a63ffffffff8616028152600481019390935260248301919091526044820152606401600060405180830381600087803b151561272057600080fd5b6102c65a03f1151561273157600080fd5b50505061273e33836124d4565b6003546127b490600160a060020a0316636352211e8d60006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561279357600080fd5b6102c65a03f115156127a457600080fd5b50505060405180519050846124d4565b600454600160a060020a031663a540db738b60405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156127fc57600080fd5b6102c65a03f1151561280d57600080fd5b505050898b33600160a060020a03167f1d62a40f1930b2f52c8eb91d13d8dcd75bf8568c2d41fda621190933b1424007428a8e8d8c8c8b8d60405197885260208801969096526040808801959095526060870193909352901515608086015260a085015260c084015260e0830191909152610100909101905180910390a45050505050505050505050565b6003546000908190819081908190819081908190600160a060020a031663956e958a8d83604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b15156128fb57600080fd5b6102c65a03f1151561290c57600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190508863ffffffff16985090919293949596508660ff1696509091929394508463ffffffff16945090919250826fffffffffffffffffffffffffffffffff169250809850819950829a50839b50849c50859d50505050505050600a891015156129ac57600080fd5b60008a11156129c3578860165488020291506129e7565b60115488014210156129dd578860155488020291506129e7565b8860145488020291505b34829010156129f557600080fd5b6129fe8b612e48565b600354919c509150600160a060020a031663a64f829a8d8460405160e060020a63ffffffff851602815260048101929092526024820152604401600060405180830381600087803b1515612a5157600080fd5b6102c65a03f11515612a6257600080fd5b505050612a71338334036124d4565b612a7e8c8c838d8d6130d9565b505050505050505050505050565b600082821115612a9857fe5b50900390565b600080612aa9613561565b6004546000908190819081908190819081908190600160a060020a03166370a082318e836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515612b1257600080fd5b6102c65a03f11515612b2357600080fd5b50505060405180519a5050891515612b3e5760009a50612d23565b89604051805910612b4c5750595b90808252806020026020018201604052509850600097505b89881015612c9a57600454600160a060020a03166328b600318e8a60006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515612bcb57600080fd5b6102c65a03f11515612bdc57600080fd5b5050506040518051600454909850600160a060020a0316905063a8d4a03b8860006040516080015260405160e060020a63ffffffff84160281526004810191909152602401608060405180830381600087803b1515612c3a57600080fd5b6102c65a03f11515612c4b57600080fd5b50505060405180519060200180519060200180519060200180519950612c7993508992508f915061336a9050565b898981518110612c8557fe5b60209081029091010152600190970196612b64565b6005821015612d1f575060005b8851811015612cf15783898281518110612cbd57fe5b906020019060200201511115612ce957888181518110612cd957fe5b9060200190602002015193508092505b600101612ca7565b938301936000898481518110612d0357fe5b6020908102909101015260009350839250600190910190612c9a565b849a505b5050505050505050505092915050565b600454600160a060020a03166370a082313360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515612d8c57600080fd5b6102c65a03f11515612d9d57600080fd5b505050604051805115159050612db757612db5612224565b505b6000828152600c60209081526040808320805460001901905583835280832080546001019055600160a060020a033316808452600b9092529182902083905582918491907f32e43b5becec4a6de1c64c6f5c86d86094f8bf5a8e0c9450f7ed779b3d645d7b9042905190815260200160405180910390a45050565b600082820183811015612e4157fe5b9392505050565b6004548190600090600160a060020a03166370a0823133836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515612ea557600080fd5b6102c65a03f11515612eb657600080fd5b505050604051805115159050612ed157612ece612224565b91505b600454600160a060020a031663a8d4a03b8360006040516080015260405160e060020a63ffffffff84160281526004810191909152602401608060405180830381600087803b1515612f2257600080fd5b6102c65a03f11515612f3357600080fd5b505050604051805190602001805190602001805190602001805195979596505050505050565b6000806000612f68868661336a565b9150612f7384613501565b90911195945050505050565b60035460009081908190819081908190600160a060020a031663956e958a8883604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b1515612fde57600080fd5b6102c65a03f11515612fef57600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051906020018051906020018051906020018051919d50909b5061304197508b965061350195505050505050565b600554909350600160a060020a0316638d8b1b88858760006040516020015260405160e060020a63ffffffff851602815260048101929092526024820152604401602060405180830381600087803b151561309b57600080fd5b6102c65a03f115156130ac57600080fd5b5050506040518051905091506130c182613501565b9050828110156130cf578391505b5095945050505050565b6003546000908190819081908190819081908190600160a060020a031663956e958a8e83604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b151561313c57600080fd5b6102c65a03f1151561314d57600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190509091929394959697509091929394959650909192939495509091929394508463ffffffff16945090919250909150905080985081995050506131c98b8e61336a565b95508a9450859350600092505b8883101561328157600654600160a060020a0316630d9f5aed86898d60006040516020015260405160e060020a63ffffffff8616028152600481019390935260248301919091526044820152606401602060405180830381600087803b151561323e57600080fd5b6102c65a03f1151561324f57600080fd5b505050604051805190509150613265828e61336a565b905083811115613276578194508093505b6001909201916131d6565b858411156132ec57600454600160a060020a03166315e839c18d8760405160e060020a63ffffffff851602815260048101929092526024820152604401600060405180830381600087803b15156132d757600080fd5b6102c65a03f115156132e857600080fd5b5050505b8b8d33600160a060020a03167fc65803521ed207655f143edad7860bd56fa74d982a0f4e82fadfb074c301c795428f8d8d8d8c118d604051958652602086019490945260408086019390935260608501919091521515608084015260a083019190915260c0909101905180910390a450505050505050505050505050565b600080600080600080600080600080600360009054906101000a9004600160a060020a0316600160a060020a031663956e958a8c6000604051610120015260405160e060020a63ffffffff8416028152600481019190915260240161012060405180830381600087803b15156133df57600080fd5b6102c65a03f115156133f057600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051906020018051906020018051906020018051505060ff9095169f5060009d50505050505050505b60048710156134655760208c069790970160010196621000008c049b5060019096019561343d565b60208c069450600493505b600c8410156134d65760208c0692506007836020811061348c57fe5b601091828204019190066002029054906101000a900461ffff1661ffff1686019550621000008c8115156134bc57fe5b049b508483146134cb57600094505b600190930192613470565b60108510801592506134ed57506009546000198901025b969094019095019998505050505050505050565b600080805b600c81101561355a576007602085066020811061351f57fe5b601091828204019190066002029054906101000a900461ffff1661ffff1682019150621000008481151561354f57fe5b049350600101613506565b5092915050565b602060405190810160405260008152905600a165627a7a72305820d721d6d6fbeffa8acf2055f2516130153ed75ff8cbdc7c0dd8943a9d0b6575f50029000000000000000000000000dc81a13cfd9aecb8ddc9e4c3c87c3ec9fbc98583000000000000000000000000f93a631cd05a88be1b0077fd2ade62a54382cc6a000000000000000000000000aa57ada57c1e6a391eebdfbc599d7fc0870eae38000000000000000000000000fdf4fdc7a3505aac4b57ad23fa620194d6703444

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

-----Decoded View---------------
Found 4 constructor arguments :
Arg [0] : 000000000000000000000000dc81a13cfd9aecb8ddc9e4c3c87c3ec9fbc98583
Arg [1] : 000000000000000000000000f93a631cd05a88be1b0077fd2ade62a54382cc6a
Arg [2] : 000000000000000000000000aa57ada57c1e6a391eebdfbc599d7fc0870eae38
Arg [3] : 000000000000000000000000fdf4fdc7a3505aac4b57ad23fa620194d6703444


   Swarm Source:
bzzr://d721d6d6fbeffa8acf2055f2516130153ed75ff8cbdc7c0dd8943a9d0b6575f5

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.