ETH Price: $2,466.53 (+6.80%)

Contract

0x0E6a831cc6CB7Bfe0F3957ADBD6D2D5D29bE1B71
 

Overview

ETH Balance

0.478267447650432587 ETH

Eth Value

$1,179.66 (@ $2,466.53/ETH)

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Attack67613542018-11-24 2:25:142126 days ago1543026314IN
0x0E6a831c...D29bE1B71
0 ETH0.00014343.5
Attack67613542018-11-24 2:25:142126 days ago1543026314IN
0x0E6a831c...D29bE1B71
0 ETH0.00014343.5
Attack67613542018-11-24 2:25:142126 days ago1543026314IN
0x0E6a831c...D29bE1B71
0 ETH0.00014343.5
Attack67613512018-11-24 2:24:032126 days ago1543026243IN
0x0E6a831c...D29bE1B71
0 ETH0.00014343.5
Attack67613502018-11-24 2:23:582126 days ago1543026238IN
0x0E6a831c...D29bE1B71
0 ETH0.00014343.5
Attack67613502018-11-24 2:23:582126 days ago1543026238IN
0x0E6a831c...D29bE1B71
0 ETH0.000280333.5
Attack67613352018-11-24 2:20:562126 days ago1543026056IN
0x0E6a831c...D29bE1B71
0 ETH0.000336573.5
Attack67613332018-11-24 2:20:122126 days ago1543026012IN
0x0E6a831c...D29bE1B71
0 ETH0.000258363.5
Attack67613302018-11-24 2:19:352126 days ago1543025975IN
0x0E6a831c...D29bE1B71
0 ETH0.000276863.5
Attack67613222018-11-24 2:16:222126 days ago1543025782IN
0x0E6a831c...D29bE1B71
0 ETH0.000276863.5
Attack67613182018-11-24 2:16:052126 days ago1543025765IN
0x0E6a831c...D29bE1B71
0 ETH0.000259173.5
Attack67613082018-11-24 2:12:412126 days ago1543025561IN
0x0E6a831c...D29bE1B71
0 ETH0.00041273.5
Attack67613022018-11-24 2:11:252126 days ago1543025485IN
0x0E6a831c...D29bE1B71
0 ETH0.000258363.5
Attack67612932018-11-24 2:09:232126 days ago1543025363IN
0x0E6a831c...D29bE1B71
0 ETH0.000276863.5
Attack67612932018-11-24 2:09:232126 days ago1543025363IN
0x0E6a831c...D29bE1B71
0 ETH0.000276863.5
Attack67612882018-11-24 2:08:072126 days ago1543025287IN
0x0E6a831c...D29bE1B71
0 ETH0.000277663.5
Attack67612822018-11-24 2:06:392126 days ago1543025199IN
0x0E6a831c...D29bE1B71
0 ETH0.000336573.5
Attack67612582018-11-24 2:01:082126 days ago1543024868IN
0x0E6a831c...D29bE1B71
0 ETH0.000258363.5
Attack67612582018-11-24 2:01:082126 days ago1543024868IN
0x0E6a831c...D29bE1B71
0 ETH0.000277663.5
Attack67612472018-11-24 1:58:212126 days ago1543024701IN
0x0E6a831c...D29bE1B71
0 ETH0.000299383.5
Attack67612422018-11-24 1:56:422126 days ago1543024602IN
0x0E6a831c...D29bE1B71
0 ETH0.000259173.5
Attack67612362018-11-24 1:54:392126 days ago1543024479IN
0x0E6a831c...D29bE1B71
0 ETH0.000299383.5
Attack67612282018-11-24 1:52:512126 days ago1543024371IN
0x0E6a831c...D29bE1B71
0 ETH0.000259173.5
Attack67612142018-11-24 1:50:532126 days ago1543024253IN
0x0E6a831c...D29bE1B71
0.04 ETH0.000515693.5
Attack67611872018-11-24 1:44:382126 days ago1543023878IN
0x0E6a831c...D29bE1B71
0.04 ETH0.000139763.5
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
67613082018-11-24 2:12:412126 days ago1543025561
0x0E6a831c...D29bE1B71
0.02 ETH
64789562018-10-08 21:52:252172 days ago1539035545
0x0E6a831c...D29bE1B71
0.02 ETH
60373822018-07-27 4:54:322246 days ago1532667272
0x0E6a831c...D29bE1B71
0.02 ETH
58422792018-06-23 21:20:112279 days ago1529788811
0x0E6a831c...D29bE1B71
0.09826744 ETH
58422672018-06-23 21:17:162279 days ago1529788636
0x0E6a831c...D29bE1B71
0.02 ETH
58422312018-06-23 21:10:262279 days ago1529788226
0x0E6a831c...D29bE1B71
0.02 ETH
54826232018-04-21 23:16:082342 days ago1524352568
0x0E6a831c...D29bE1B71
0.05653489 ETH
54826062018-04-21 23:13:452342 days ago1524352425
0x0E6a831c...D29bE1B71
0.02 ETH
54825872018-04-21 23:09:092342 days ago1524352149
0x0E6a831c...D29bE1B71
0.02 ETH
54799412018-04-21 12:26:372343 days ago1524313597
0x0E6a831c...D29bE1B71
0.09306979 ETH
54799372018-04-21 12:25:452343 days ago1524313545
0x0E6a831c...D29bE1B71
0.02 ETH
54799232018-04-21 12:21:502343 days ago1524313310
0x0E6a831c...D29bE1B71
0.02 ETH
54783762018-04-21 5:56:072343 days ago1524290167
0x0E6a831c...D29bE1B71
0.02 ETH
54481222018-04-16 1:13:212348 days ago1523841201
0x0E6a831c...D29bE1B71
0.02 ETH
54410632018-04-14 20:42:582349 days ago1523738578
0x0E6a831c...D29bE1B71
0.06613958 ETH
54410392018-04-14 20:37:552349 days ago1523738275
0x0E6a831c...D29bE1B71
0.02 ETH
54410252018-04-14 20:33:102349 days ago1523737990
0x0E6a831c...D29bE1B71
0.02 ETH
54116902018-04-09 22:17:292354 days ago1523312249
0x0E6a831c...D29bE1B71
0.04 ETH
54090652018-04-09 11:50:392355 days ago1523274639
0x0E6a831c...D29bE1B71
0.01227916 ETH
54090612018-04-09 11:50:132355 days ago1523274613
0x0E6a831c...D29bE1B71
0.02 ETH
54090382018-04-09 11:43:502355 days ago1523274230
0x0E6a831c...D29bE1B71
0.02 ETH
54082922018-04-09 8:49:142355 days ago1523263754
0x0E6a831c...D29bE1B71
0.02 ETH
54078402018-04-09 6:53:582355 days ago1523256838
0x0E6a831c...D29bE1B71
0.00455832 ETH
54078362018-04-09 6:53:292355 days ago1523256809
0x0E6a831c...D29bE1B71
0.02 ETH
54078332018-04-09 6:52:492355 days ago1523256769
0x0E6a831c...D29bE1B71
0.02 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DungeonRunCore

Compiler Version
v0.4.19+commit.c4cbbb05

Optimization Enabled:
Yes with 200 runs

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

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

}


/// @dev Interface to the Core Contract of Ether Dungeon.
contract EDCoreInterface {

    /// @dev The external function to get all the game settings in one call.
    function getGameSettings() external view returns (
        uint _recruitHeroFee,
        uint _transportationFeeMultiplier,
        uint _noviceDungeonId,
        uint _consolationRewardsRequiredFaith,
        uint _challengeFeeMultiplier,
        uint _dungeonPreparationTime,
        uint _trainingFeeMultiplier,
        uint _equipmentTrainingFeeMultiplier,
        uint _preparationPeriodTrainingFeeMultiplier,
        uint _preparationPeriodEquipmentTrainingFeeMultiplier
    );

    /**
     * @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,
        uint dungeonCount,
        uint heroCount,
        uint faith,
        bool firstHeroRecruited
    );

    /**
     * @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,
        address owner,
        bool isReady,
        uint playerCount
    );

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

    /**
     * @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,
        address owner,
        bool isReady,
        uint cooldownRemainingTime
    );

    /// @dev Get the attributes (equipments + stats) of a hero from its gene.
    function getHeroAttributes(uint _genes) public pure returns (uint[]);

    /// @dev Calculate the power of a hero from its gene, it calculates the equipment power, stats power, and super hero boost.
    function getHeroPower(uint _genes, uint _dungeonDifficulty) public pure returns (
        uint totalPower,
        uint equipmentPower,
        uint statsPower,
        bool isSuper,
        uint superRank,
        uint superBoost
    );

    /// @dev Calculate the power of a dungeon floor.
    function getDungeonPower(uint _genes) public pure returns (uint);

    /**
     * @dev Calculate the sum of top 5 heroes power a player owns.
     *  The gas usage increased with the number of heroes a player owned, roughly 500 x hero count.
     *  This is used in transport function only to calculate the required tranport fee.
     */
    function calculateTop5HeroesPower(address _address, uint _dungeonId) public view returns (uint);

}


/**
 * @title Core Contract of "Dungeon Run" event game of the ED (Ether Dungeon) Platform.
 * @dev Dungeon Run is a single-player game mode added to the Ether Dungeon platform.
 *  The objective of Dungeon Run is to defeat as many monsters as possible.
 */
contract DungeonRunCore is Pausable, Destructible {

    /*=================================
    =             STRUCTS             =
    =================================*/

    struct Monster {
        uint64 creationTime;
        uint8 level;
        uint16 initialHealth;
        uint16 health;
    }


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

    /// @dev The address of the EtherDungeonCore contract.
    EDCoreInterface public edCoreContract = EDCoreInterface(0xf7eD56c1AC4d038e367a987258b86FC883b960a1);


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

    /// @dev By defeating the checkPointLevel, half of the entranceFee is refunded.
    uint8 public constant checkpointLevel = 5;

    /// @dev By defeating the breakevenLevel, another half of the entranceFee is refunded.
    uint8 public constant breakevenLevel = 10;

    /// @dev By defeating the jackpotLevel, the player win the entire jackpot.
    uint8 public constant jackpotLevel = 12;

    /// @dev Dungeon difficulty to be used when calculating super hero power boost, 3 is 64 power boost.
    uint public constant dungeonDifficulty = 3;

    /// @dev The health of a monster is level * monsterHealth;
    uint16 public monsterHealth = 10;

    /// @dev When a monster flees, the hero health is reduced by monster level + monsterStrength.
    uint public monsterStrength = 4;

    /// @dev After a certain period of time, the monster will attack the hero and flee.
    uint64 public monsterFleeTime = 8 minutes;


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

    /// @dev To start a run, a player need to pay an entrance fee.
    uint public entranceFee = 0.04 ether;

    /// @dev Fee required to reset a run for a given hero, the fee will go to the jackpot.
    uint public reviveFee = 0.02 ether;

    /// @dev 0.1 ether is provided as the initial jackpot.
    uint public jackpot = 0.1 ether;

    /**
     * @dev The dungeon run entrance fee will first be deposited to a pool first, when the hero is
     *  defeated by a monster, then the fee will be added to the jackpot.
     */
    uint public entranceFeePool;

    /// @dev Private seed for the PRNG used for calculating damage amount.
    uint _seed;


    /*=================================
    =         STATE VARIABLES         =
    =================================*/

    /// @dev A mapping from hero ID to the current run monster, a 0 value indicates no current run.
    mapping(uint => Monster) public heroIdToMonster;

    /// @dev A mapping from hero ID to its current health.
    mapping(uint => uint) public heroIdToHealth;

    /// @dev A mapping from hero ID to the refunded fee.
    mapping(uint => uint) public heroIdToRefundedFee;


    /*==============================
    =            EVENTS            =
    ==============================*/

    /// @dev The LogAttack event is fired whenever a hero attack a monster.
    event LogAttack(uint timestamp, address indexed player, uint indexed heroId, uint indexed monsterLevel, uint damageByHero, uint damageByMonster, bool isMonsterDefeated, uint rewards);

    function DungeonRunAlpha() public payable {}

    /*=======================================
    =       PUBLIC/EXTERNAL FUNCTIONS       =
    =======================================*/

    /// @dev The external function to get all the game settings in one call.
    function getGameSettings() external view returns (
        uint _checkpointLevel,
        uint _breakevenLevel,
        uint _jackpotLevel,
        uint _dungeonDifficulty,
        uint _monsterHealth,
        uint _monsterStrength,
        uint _monsterFleeTime,
        uint _entranceFee,
        uint _reviveFee
    ) {
        _checkpointLevel = checkpointLevel;
        _breakevenLevel = breakevenLevel;
        _jackpotLevel = jackpotLevel;
        _dungeonDifficulty = dungeonDifficulty;
        _monsterHealth = monsterHealth;
        _monsterStrength = monsterStrength;
        _monsterFleeTime = monsterFleeTime;
        _entranceFee = entranceFee;
        _reviveFee = reviveFee;
    }

    /// @dev The external function to get the dungeon run details in one call.
    function getRunDetails(uint _heroId) external view returns (
        uint _heroPower,
        uint _heroStrength,
        uint _heroInitialHealth,
        uint _heroHealth,
        uint _monsterCreationTime,
        uint _monsterLevel,
        uint _monsterInitialHealth,
        uint _monsterHealth,
        uint _gameState // 0: NotStarted | 1: NewMonster | 2: Active | 3: RunEnded
    ) {
        uint genes;
        address owner;
        (,,, genes, owner,,) = edCoreContract.getHeroDetails(_heroId);
        (_heroPower,,,,) = edCoreContract.getHeroPower(genes, dungeonDifficulty);
        _heroStrength = (genes / (32 ** 8)) % 32 + 1;
        _heroInitialHealth = (genes / (32 ** 12)) % 32 + 1;
        _heroHealth = heroIdToHealth[_heroId];

        Monster memory monster = heroIdToMonster[_heroId];
        _monsterCreationTime = monster.creationTime;

        // Dungeon run is ended if either hero is defeated (health exhausted),
        // or hero failed to damage a monster before it flee.
        bool _dungeonRunEnded = monster.level > 0 && (
            _heroHealth == 0 || 
            now > _monsterCreationTime + monsterFleeTime * 2 ||
            (monster.health == monster.initialHealth && now > monster.creationTime + monsterFleeTime)
        );

        // Calculate hero and monster stats based on different game state.
        if (monster.level == 0) {
            // Dungeon run not started yet.
            _heroHealth = _heroInitialHealth;
            _monsterLevel = 1;
            _monsterInitialHealth = monsterHealth;
            _monsterHealth = _monsterInitialHealth;
            _gameState = 0;
        } else if (_dungeonRunEnded) {
            // Dungeon run ended.
            _monsterLevel = monster.level;
            _monsterInitialHealth = monster.initialHealth;
            _monsterHealth = monster.health;
            _gameState = 3;
        } else if (now > _monsterCreationTime + monsterFleeTime) {
            // Previous monster just fled, new monster awaiting.
            if (monster.level + monsterStrength > _heroHealth) {
                _heroHealth = 0;
                _monsterLevel = monster.level;
                _monsterInitialHealth = monster.initialHealth;
                _monsterHealth = monster.health;
                _gameState = 2;
            } else {
                _heroHealth -= monster.level + monsterStrength;
                _monsterCreationTime += monsterFleeTime;
                _monsterLevel = monster.level + 1;
                _monsterInitialHealth = _monsterLevel * monsterHealth;
                _monsterHealth = _monsterInitialHealth;
                _gameState = 1;
            }
        } else {
            // Active monster.
            _monsterLevel = monster.level;
            _monsterInitialHealth = monster.initialHealth;
            _monsterHealth = monster.health;
            _gameState = 2;
        }
    }

    /**
     * @dev To start a dungeon run, player need to call the attack function with an entranceFee.
     *  Future attcks required no fee, player just need to send a free transaction
     *  to the contract, before the monster flee. The lower the gas price, the larger the damage.
     *  This function is prevented from being called by a contract, using the onlyHumanAddress modifier.
     *  Note that each hero can only perform one dungeon run.
     */
    function attack(uint _heroId) whenNotPaused onlyHumanAddress external payable {
        uint genes;
        address owner;
        (,,, genes, owner,,) = edCoreContract.getHeroDetails(_heroId);

        // Throws if the hero is not owned by the player.
        require(msg.sender == owner);

        // Get the health and strength of the hero.
        uint heroInitialHealth = (genes / (32 ** 12)) % 32 + 1;
        uint heroStrength = (genes / (32 ** 8)) % 32 + 1;

        // Get the current monster and hero current health.
        Monster memory monster = heroIdToMonster[_heroId];
        uint currentLevel = monster.level;
        uint heroCurrentHealth = heroIdToHealth[_heroId];

        // A flag determine whether the dungeon run has ended.
        bool dungeonRunEnded;

        // To start a run, the player need to pay an entrance fee.
        if (currentLevel == 0) {
            // Throws if not enough fee, and any exceeding fee will be transferred back to the player.
            require(msg.value >= entranceFee);
            entranceFeePool += entranceFee;

            // Create level 1 monster, initial health is 1 * monsterHealth.
            heroIdToMonster[_heroId] = Monster(uint64(now), 1, monsterHealth, monsterHealth);
            monster = heroIdToMonster[_heroId];

            // Set the hero initial health to storage.
            heroIdToHealth[_heroId] = heroInitialHealth;
            heroCurrentHealth = heroInitialHealth;

            // Refund exceeding fee.
            if (msg.value > entranceFee) {
                msg.sender.transfer(msg.value - entranceFee);
            }
        } else {
            // If the hero health is 0, the dungeon run has ended.
            require(heroCurrentHealth > 0);
    
            // If a hero failed to damage a monster before it flee, the dungeon run ends,
            // regardless of the remaining hero health.
            dungeonRunEnded = now > monster.creationTime + monsterFleeTime * 2 ||
                (monster.health == monster.initialHealth && now > monster.creationTime + monsterFleeTime);

            if (dungeonRunEnded) {
                // Add the non-refunded fee to jackpot.
                uint addToJackpot = entranceFee - heroIdToRefundedFee[_heroId];
            
                if (addToJackpot > 0) {
                    jackpot += addToJackpot;
                    entranceFeePool -= addToJackpot;
                    heroIdToRefundedFee[_heroId] += addToJackpot;
                }

                // Sanity check.
                assert(addToJackpot <= entranceFee);
            }
            
            // Future attack do not require any fee, so refund all ether sent with the transaction.
            msg.sender.transfer(msg.value);
        }

        if (!dungeonRunEnded) {
            // All pre-conditions passed, call the internal attack function.
            _attack(_heroId, genes, heroStrength, heroCurrentHealth);
        }
    }
    
    /**
     * @dev Reset a dungeon run for a given hero.
     */
    function revive(uint _heroId) whenNotPaused external payable {
        // Throws if not enough fee, and any exceeding fee will be transferred back to the player.
        require(msg.value >= reviveFee);
        
        // The revive fee will do directly to jackpot.
        jackpot += reviveFee;
        
        // Reset the dungeon run.
        delete heroIdToHealth[_heroId];
        delete heroIdToMonster[_heroId];
        delete heroIdToRefundedFee[_heroId];
    
        // Refund exceeding fee.
        if (msg.value > reviveFee) {
            msg.sender.transfer(msg.value - reviveFee);
        }
    }


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

    function setEdCoreContract(address _newEdCoreContract) onlyOwner external {
        edCoreContract = EDCoreInterface(_newEdCoreContract);
    }

    function setEntranceFee(uint _newEntranceFee) onlyOwner external {
        entranceFee = _newEntranceFee;
    }

    function setReviveFee(uint _newReviveFee) onlyOwner external {
        reviveFee = _newReviveFee;
    }


    /*=======================================
    =      INTERNAL/PRIVATE FUNCTIONS       =
    =======================================*/

    /// @dev Internal function of attack, assume all parameter checking is done.
    function _attack(uint _heroId, uint _genes, uint _heroStrength, uint _heroCurrentHealth) internal {
        Monster storage monster = heroIdToMonster[_heroId];
        uint8 currentLevel = monster.level;

        // Get the hero power.
        uint heroPower;
        (heroPower,,,,) = edCoreContract.getHeroPower(_genes, dungeonDifficulty);
        
        uint damageByMonster;
        uint damageByHero;

        // Calculate the damage by hero first.
        // The damage formula is (strength + power / (10 * rand)) / gasprice,
        // where rand is a random integer from 1 to 5.
        damageByHero = (_heroStrength * 1e9 + heroPower * 1e9 / (10 * (1 + _getRandomNumber(5)))) / (tx.gasprice >= 0.5 * 1e9 ? tx.gasprice : 0.5 * 1e9);
        bool isMonsterDefeated = damageByHero >= monster.health;

        if (isMonsterDefeated) {
            uint rewards;

            // Monster is defeated, game continues with a new monster.
            // Create next level monster.
            uint8 newLevel = currentLevel + 1;
            heroIdToMonster[_heroId] = Monster(uint64(now), newLevel, newLevel * monsterHealth, newLevel * monsterHealth);
            monster = heroIdToMonster[_heroId];

            // Determine the rewards based on current level.
            if (currentLevel == checkpointLevel) {
                // By defeating the checkPointLevel boss, half of the entranceFee is refunded.
                rewards = entranceFee / 2;
                heroIdToRefundedFee[_heroId] += rewards;
                entranceFeePool -= rewards;
            } else if (currentLevel == breakevenLevel) {
                // By defeating the breakevenLevel boss, another half of the entranceFee is refunded.
                rewards = entranceFee / 2;
                heroIdToRefundedFee[_heroId] += rewards;
                entranceFeePool -= rewards;
            } else if (currentLevel == jackpotLevel) {
                // By defeating the jackpotLevel, the player win the entire jackpot.
                rewards = jackpot / 2;
                jackpot -= rewards;
            }

            msg.sender.transfer(rewards);
        } else {
            // Monster is damanged but not defeated, hurry up!
            monster.health -= uint8(damageByHero);

            // Calculate the damage by monster only if it is not defeated.
            // Determine if the monster has fled due to hero failed to attack within flee period.
            if (now > monster.creationTime + monsterFleeTime) {
                // When a monster flees, the monster will attack the hero and flee.
                // The damage is calculated by monster level + monsterStrength.
                damageByMonster = currentLevel + monsterStrength;
            } else {
                // When a monster attack back the hero, the damage will be less than monster level / 2.
                if (currentLevel >= 2) {
                    damageByMonster = _getRandomNumber(currentLevel / 2);
                }
            }
        }

        // Check if hero is defeated.
        if (damageByMonster >= _heroCurrentHealth) {
            // Hero is defeated, the dungeon run ends.
            heroIdToHealth[_heroId] = 0;

            // Add the non-refunded fee to jackpot.
            uint addToJackpot = entranceFee - heroIdToRefundedFee[_heroId];
            
            if (addToJackpot > 0) {
                jackpot += addToJackpot;
                entranceFeePool -= addToJackpot;
                heroIdToRefundedFee[_heroId] += addToJackpot;
            }

            // Sanity check.
            assert(addToJackpot <= entranceFee);
        } else {
            // Hero is damanged but didn't defeated, game continues with a new monster.
            if (damageByMonster > 0) {
                heroIdToHealth[_heroId] -= damageByMonster;
            }

            // If monser fled, create next level monster.
            if (now > monster.creationTime + monsterFleeTime) {
                currentLevel++;
                heroIdToMonster[_heroId] = Monster(uint64(monster.creationTime + monsterFleeTime),
                    currentLevel, currentLevel * monsterHealth, currentLevel * monsterHealth);
                monster = heroIdToMonster[_heroId];
            }
        }

        // Emit LogAttack event.
        LogAttack(now, msg.sender, _heroId, currentLevel, damageByHero, damageByMonster, isMonsterDefeated, rewards);
    }

    /// @dev Return a pseudo random uint smaller than _upper bounds.
    function _getRandomNumber(uint _upper) private returns (uint) {
        _seed = uint(keccak256(
            _seed,
            block.blockhash(block.number - 1),
            block.coinbase,
            block.difficulty
        ));

        return _seed % _upper;
    }


    /*==============================
    =           MODIFIERS          =
    ==============================*/
    
    /// @dev Throws if the caller address is a contract.
    modifier onlyHumanAddress() {
        address addr = msg.sender;
        uint size;
        assembly { size := extcodesize(addr) }
        require(size == 0);
        _;
    }

}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"monsterFleeTime","outputs":[{"name":"","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"reviveFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"checkpointLevel","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dungeonDifficulty","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"heroIdToHealth","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"edCoreContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"monsterHealth","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getGameSettings","outputs":[{"name":"_checkpointLevel","type":"uint256"},{"name":"_breakevenLevel","type":"uint256"},{"name":"_jackpotLevel","type":"uint256"},{"name":"_dungeonDifficulty","type":"uint256"},{"name":"_monsterHealth","type":"uint256"},{"name":"_monsterStrength","type":"uint256"},{"name":"_monsterFleeTime","type":"uint256"},{"name":"_entranceFee","type":"uint256"},{"name":"_reviveFee","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"entranceFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_heroId","type":"uint256"}],"name":"attack","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"jackpotLevel","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"jackpot","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":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_heroId","type":"uint256"}],"name":"revive","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"heroIdToRefundedFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"entranceFeePool","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"breakevenLevel","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"DungeonRunAlpha","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"heroIdToMonster","outputs":[{"name":"creationTime","type":"uint64"},{"name":"level","type":"uint8"},{"name":"initialHealth","type":"uint16"},{"name":"health","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newEdCoreContract","type":"address"}],"name":"setEdCoreContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"monsterStrength","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_heroId","type":"uint256"}],"name":"getRunDetails","outputs":[{"name":"_heroPower","type":"uint256"},{"name":"_heroStrength","type":"uint256"},{"name":"_heroInitialHealth","type":"uint256"},{"name":"_heroHealth","type":"uint256"},{"name":"_monsterCreationTime","type":"uint256"},{"name":"_monsterLevel","type":"uint256"},{"name":"_monsterInitialHealth","type":"uint256"},{"name":"_monsterHealth","type":"uint256"},{"name":"_gameState","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_recipient","type":"address"}],"name":"destroyAndSend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newReviveFee","type":"uint256"}],"name":"setReviveFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newEntranceFee","type":"uint256"}],"name":"setEntranceFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"timestamp","type":"uint256"},{"indexed":true,"name":"player","type":"address"},{"indexed":true,"name":"heroId","type":"uint256"},{"indexed":true,"name":"monsterLevel","type":"uint256"},{"indexed":false,"name":"damageByHero","type":"uint256"},{"indexed":false,"name":"damageByMonster","type":"uint256"},{"indexed":false,"name":"isMonsterDefeated","type":"bool"},{"indexed":false,"name":"rewards","type":"uint256"}],"name":"LogAttack","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"}]

6060604052600080546001805473f7ed56c1ac4d038e367a987258b86fc883b960a1600160a060020a03199091161760a060020a61ffff021916740a000000000000000000000000000000000000000017905560046002819055600380546101e067ffffffffffffffff19909116179055668e1bc9bf040000905566470de4df82000060055567016345785d8a0000600655600160a860020a031916600160a060020a0333161781556118479081906100b890396000f3006060604052600436106101665763ffffffff60e060020a60003504166302e1033a811461016b578063101e359b1461019b57806314b8e9a4146101c05780631aa7e54c146101e957806320c63800146101fc5780633239825c146102125780633f4ba83a1461024157806349e123c814610256578063508f46a0146102805780635c975abb146102e0578063649677e11461030757806364dd891a1461031a578063658311ab146103255780636b31ee011461033857806383197ef01461034b5780638456cb591461035e5780638baecc21146103715780638da5cb5b1461037c57806399bf1f621461038f5780639a1a661e146103a5578063a4ccd1ba146103b8578063afcee461146103cb578063b9772fd7146103d3578063c8b39eb514610427578063d8e74ed714610446578063efada80b14610459578063f2fde38b1461046f578063f5074f411461048e578063f85d9cc7146104ad578063fe56f5a0146104c3575b600080fd5b341561017657600080fd5b61017e6104d9565b60405167ffffffffffffffff909116815260200160405180910390f35b34156101a657600080fd5b6101ae6104e9565b60405190815260200160405180910390f35b34156101cb57600080fd5b6101d36104ef565b60405160ff909116815260200160405180910390f35b34156101f457600080fd5b6101ae6104f4565b341561020757600080fd5b6101ae6004356104f9565b341561021d57600080fd5b61022561050b565b604051600160a060020a03909116815260200160405180910390f35b341561024c57600080fd5b61025461051a565b005b341561026157600080fd5b610269610599565b60405161ffff909116815260200160405180910390f35b341561028b57600080fd5b6102936105aa565b60405198895260208901979097526040808901969096526060880194909452608087019290925260a086015260c085015260e0840152610100830191909152610120909101905180910390f35b34156102eb57600080fd5b6102f36105e3565b604051901515815260200160405180910390f35b341561031257600080fd5b6101ae6105f3565b6102546004356105f9565b341561033057600080fd5b6101d3610a8f565b341561034357600080fd5b6101ae610a94565b341561035657600080fd5b610254610a9a565b341561036957600080fd5b610254610ac3565b610254600435610b47565b341561038757600080fd5b610225610bf3565b341561039a57600080fd5b6101ae600435610c02565b34156103b057600080fd5b6101ae610c14565b34156103c357600080fd5b6101d3610c1a565b610254610c1f565b34156103de57600080fd5b6103e9600435610c21565b60405167ffffffffffffffff909416845260ff909216602084015261ffff908116604080850191909152911660608301526080909101905180910390f35b341561043257600080fd5b610254600160a060020a0360043516610c6a565b341561045157600080fd5b6101ae610cb4565b341561046457600080fd5b610293600435610cba565b341561047a57600080fd5b610254600160a060020a0360043516611095565b341561049957600080fd5b610254600160a060020a0360043516611130565b34156104b857600080fd5b610254600435611157565b34156104ce57600080fd5b610254600435611177565b60035467ffffffffffffffff1681565b60055481565b600581565b600381565b600a6020526000908152604090205481565b600154600160a060020a031681565b60005433600160a060020a0390811691161461053557600080fd5b60005460a060020a900460ff16151561054d57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60015460a060020a900461ffff1681565b60015460025460038054600454600580549096600a96600c9660a060020a90910461ffff1694909367ffffffffffffffff909116929091565b60005460a060020a900460ff1681565b60045481565b6000806000806106076117f4565b6000805481908190819060a060020a900460ff161561062557600080fd5b33803b801561063357600080fd5b600154600160a060020a031663730bdc968d600060405160e0015260405160e060020a63ffffffff8416028152600481019190915260240160e060405180830381600087803b151561068457600080fd5b6102c65a03f1151561069557600080fd5b50505060405180519060200180519060200180519060200180519060200180519060200180519060200180519050909192939495509091929394509091929350905050809b50819c50505089600160a060020a031633600160a060020a031614151561070057600080fd5b60206710000000000000008c040660010198506020650100000000008c04066001019750600960008d815260200190815260200160002060806040519081016040908152915467ffffffffffffffff8116825260ff680100000000000000008204166020830190815261ffff69010000000000000000008304811694840194909452605860020a909104909216606082015297505160008d8152600a602052604090205460ff919091169650945085151561097d576004543410156107c457600080fd5b600454600780549091019055608060405190810160409081524267ffffffffffffffff16825260016020808401829052905460a060020a900461ffff16828401819052606084015260008f81526009909152208151815467ffffffffffffffff191667ffffffffffffffff919091161781556020820151815460ff91909116680100000000000000000268ff0000000000000000199091161781556040820151815461ffff919091166901000000000000000000026affff000000000000000000199091161781556060820151815461ffff91909116605860020a026cffff0000000000000000000000199091161790555060008c8152600960205260409081902090608090519081016040908152915467ffffffffffffffff8116825260ff6801000000000000000082041660208084019190915261ffff69010000000000000000008304811685850152605860020a909204909116606083015260008f8152600a909152919091208a90556004549097508995503411156109785733600160a060020a03166108fc60045434039081150290604051600060405180830381858888f19350505050151561097857600080fd5b610a6e565b6000851161098a57600080fd5b60035467ffffffffffffffff1660020287510167ffffffffffffffff164211806109e65750866040015161ffff16876060015161ffff161480156109e6575060035467ffffffffffffffff1687510167ffffffffffffffff1642115b93508315610a3c5760008c8152600b6020526040812054600454039350831115610a3057600680548401905560078054849003905560008c8152600b602052604090208054840190555b600454831115610a3c57fe5b600160a060020a0333163480156108fc0290604051600060405180830381858888f193505050501515610a6e57600080fd5b831515610a8157610a818c8c8a88611197565b505050505050505050505050565b600c81565b60065481565b60005433600160a060020a03908116911614610ab557600080fd5b600054600160a060020a0316ff5b60005433600160a060020a03908116911614610ade57600080fd5b60005460a060020a900460ff1615610af557600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60005460a060020a900460ff1615610b5e57600080fd5b600554341015610b6d57600080fd5b600580546006805490910190556000828152600a602090815260408083208390556009825280832080546cffffffffffffffffffffffffff19169055600b90915281205554341115610bf05733600160a060020a03166108fc60055434039081150290604051600060405180830381858888f193505050501515610bf057600080fd5b50565b600054600160a060020a031681565b600b6020526000908152604090205481565b60075481565b600a81565b565b60096020526000908152604090205467ffffffffffffffff81169060ff680100000000000000008204169061ffff69010000000000000000008204811691605860020a90041684565b60005433600160a060020a03908116911614610c8557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60025481565b6000806000806000806000806000806000610cd36117f4565b600154600090600160a060020a031663730bdc968f8360405160e0015260405160e060020a63ffffffff8416028152600481019190915260240160e060405180830381600087803b1515610d2657600080fd5b6102c65a03f11515610d3757600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051906020018051505060015492995090975050600160a060020a03169250636c0d2c8b91508690506003600060405160c0015260405160e060020a63ffffffff85160281526004810192909252602482015260440160c060405180830381600087803b1515610dca57600080fd5b6102c65a03f11515610ddb57600080fd5b50505060405180519060200180519060200180519060200180519060200180519060200180519050909192935090919250909150905050809d505060206501000000000085811515610e2957fe5b04811515610e3357fe5b066001019b5060206710000000000000008504066001019a50600a60008f8152602001908152602001600020549950600960008f815260200190815260200160002060806040519081016040908152915467ffffffffffffffff8116825260ff68010000000000000000820416602083015261ffff69010000000000000000008204811693830193909352605860020a900490911660608201529150815167ffffffffffffffff1698506000826020015160ff16118015610f4c5750891580610f0f5750600354600267ffffffffffffffff9182160216890142115b80610f4c5750816040015161ffff16826060015161ffff16148015610f4c575060035467ffffffffffffffff1682510167ffffffffffffffff1642115b9050816020015160ff161515610f7f57600180548c9b5090985060a060020a900461ffff16965086955060009450611084565b8015610fae57816020015160ff169750816040015161ffff169650816060015161ffff16955060039450611084565b60035467ffffffffffffffff16890142111561105f5789600254836020015160ff160111156110045760009950816020015160ff169750816040015161ffff169650816060015161ffff1695506002945061105a565b600254826020015160035460ff9190911691909101909a039967ffffffffffffffff169890980197602082015160010160ff169750600160149054906101000a900461ffff1661ffff1688029650869550600194505b611084565b816020015160ff169750816040015161ffff169650816060015161ffff169550600294505b505050509193959799909294969850565b60005433600160a060020a039081169116146110b057600080fd5b600160a060020a03811615156110c557600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461114b57600080fd5b80600160a060020a0316ff5b60005433600160a060020a0390811691161461117257600080fd5b600555565b60005433600160a060020a0390811691161461119257600080fd5b600455565b600084815260096020526040808220805460015491936801000000000000000090910460ff16929091829182918291829182918291600160a060020a031690636c0d2c8b908e9060039085905160c0015260405160e060020a63ffffffff85160281526004810192909252602482015260440160c060405180830381600087803b151561122357600080fd5b6102c65a03f1151561123457600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805150949b505050631dcd65003a1015925061127b91505057631dcd650061127d565b3a5b611287600561178d565b600101600a0288633b9aca000281151561129d57fe5b048c633b9aca0002018115156112af57fe5b8a549190049550605860020a900461ffff1685108015945061149e578760010191506080604051908101604052804267ffffffffffffffff1681526020018360ff168152602001600160149054906101000a900461ffff168460ff160261ffff168152602001600160149054906101000a900461ffff168460ff160261ffff16815250600960008f81526020019081526020016000206000820151815467ffffffffffffffff191667ffffffffffffffff919091161781556020820151815460ff91909116680100000000000000000268ff0000000000000000199091161781556040820151815461ffff919091166901000000000000000000026affff000000000000000000199091161781556060820151815461ffff91909116605860020a026cffff0000000000000000000000199091161790555060008d8152600960205260409020985060ff881660051415611433576004546002905b60008f8152600b6020526040902080549290910491820190556007805482900390559250611468565b60ff8816600a141561144a5760045460029061140a565b60ff8816600c14156114685760068054600281049081900390915592505b600160a060020a03331683156108fc0284604051600060405180830381858888f19350505050151561149957600080fd5b611517565b885460ff861661ffff605860020a80840482169290920316026cffff00000000000000000000001990911617808a5560035467ffffffffffffffff91821690821601164211156114f7576002548860ff16019550611517565b600260ff89161061151757611514600260ff8a160460ff1661178d565b95505b89861061157e575060008c8152600a60209081526040808320839055600b909152812054600454039081111561156d57600680548201905560078054829003905560008d8152600b602052604090208054820190555b60045481111561157957fe5b611717565b600086111561159d5760008d8152600a60205260409020805487900390555b600354895467ffffffffffffffff918216908216011642111561171757600190970196608060405190810160405280600360009054906101000a900467ffffffffffffffff168b60000160009054906101000a900467ffffffffffffffff160167ffffffffffffffff1681526020018960ff168152602001600160149054906101000a900461ffff168a60ff160261ffff168152602001600160149054906101000a900461ffff168a60ff160261ffff16815250600960008f81526020019081526020016000206000820151815467ffffffffffffffff191667ffffffffffffffff919091161781556020820151815460ff91909116680100000000000000000268ff0000000000000000199091161781556040820151815461ffff919091166901000000000000000000026affff000000000000000000199091161781556060820151815461ffff91909116605860020a026cffff0000000000000000000000199091161790555060008d815260096020526040902098505b8760ff168d33600160a060020a03167f9ef1d73adb4edbf0d986366fc204ff53b6f08dbeb9b2d8268a96d0ccbca85ab642898b8a8a604051948552602085019390935260408085019290925215156060840152608083019190915260a0909101905180910390a450505050505050505050505050565b6000600854600143034041446040519384526020840192909252600160a060020a03166c0100000000000000000000000002604080840191909152605483019190915260749091019051908190039020600881905582908115156117ed57fe5b0692915050565b608060405190810160409081526000808352602083018190529082018190526060820152905600a165627a7a72305820ab66e744f939587582b374b6c19b7ecfa8a0a6ff2c16d41fcf22034276b6fbdb0029

Deployed Bytecode

0x6060604052600436106101665763ffffffff60e060020a60003504166302e1033a811461016b578063101e359b1461019b57806314b8e9a4146101c05780631aa7e54c146101e957806320c63800146101fc5780633239825c146102125780633f4ba83a1461024157806349e123c814610256578063508f46a0146102805780635c975abb146102e0578063649677e11461030757806364dd891a1461031a578063658311ab146103255780636b31ee011461033857806383197ef01461034b5780638456cb591461035e5780638baecc21146103715780638da5cb5b1461037c57806399bf1f621461038f5780639a1a661e146103a5578063a4ccd1ba146103b8578063afcee461146103cb578063b9772fd7146103d3578063c8b39eb514610427578063d8e74ed714610446578063efada80b14610459578063f2fde38b1461046f578063f5074f411461048e578063f85d9cc7146104ad578063fe56f5a0146104c3575b600080fd5b341561017657600080fd5b61017e6104d9565b60405167ffffffffffffffff909116815260200160405180910390f35b34156101a657600080fd5b6101ae6104e9565b60405190815260200160405180910390f35b34156101cb57600080fd5b6101d36104ef565b60405160ff909116815260200160405180910390f35b34156101f457600080fd5b6101ae6104f4565b341561020757600080fd5b6101ae6004356104f9565b341561021d57600080fd5b61022561050b565b604051600160a060020a03909116815260200160405180910390f35b341561024c57600080fd5b61025461051a565b005b341561026157600080fd5b610269610599565b60405161ffff909116815260200160405180910390f35b341561028b57600080fd5b6102936105aa565b60405198895260208901979097526040808901969096526060880194909452608087019290925260a086015260c085015260e0840152610100830191909152610120909101905180910390f35b34156102eb57600080fd5b6102f36105e3565b604051901515815260200160405180910390f35b341561031257600080fd5b6101ae6105f3565b6102546004356105f9565b341561033057600080fd5b6101d3610a8f565b341561034357600080fd5b6101ae610a94565b341561035657600080fd5b610254610a9a565b341561036957600080fd5b610254610ac3565b610254600435610b47565b341561038757600080fd5b610225610bf3565b341561039a57600080fd5b6101ae600435610c02565b34156103b057600080fd5b6101ae610c14565b34156103c357600080fd5b6101d3610c1a565b610254610c1f565b34156103de57600080fd5b6103e9600435610c21565b60405167ffffffffffffffff909416845260ff909216602084015261ffff908116604080850191909152911660608301526080909101905180910390f35b341561043257600080fd5b610254600160a060020a0360043516610c6a565b341561045157600080fd5b6101ae610cb4565b341561046457600080fd5b610293600435610cba565b341561047a57600080fd5b610254600160a060020a0360043516611095565b341561049957600080fd5b610254600160a060020a0360043516611130565b34156104b857600080fd5b610254600435611157565b34156104ce57600080fd5b610254600435611177565b60035467ffffffffffffffff1681565b60055481565b600581565b600381565b600a6020526000908152604090205481565b600154600160a060020a031681565b60005433600160a060020a0390811691161461053557600080fd5b60005460a060020a900460ff16151561054d57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60015460a060020a900461ffff1681565b60015460025460038054600454600580549096600a96600c9660a060020a90910461ffff1694909367ffffffffffffffff909116929091565b60005460a060020a900460ff1681565b60045481565b6000806000806106076117f4565b6000805481908190819060a060020a900460ff161561062557600080fd5b33803b801561063357600080fd5b600154600160a060020a031663730bdc968d600060405160e0015260405160e060020a63ffffffff8416028152600481019190915260240160e060405180830381600087803b151561068457600080fd5b6102c65a03f1151561069557600080fd5b50505060405180519060200180519060200180519060200180519060200180519060200180519060200180519050909192939495509091929394509091929350905050809b50819c50505089600160a060020a031633600160a060020a031614151561070057600080fd5b60206710000000000000008c040660010198506020650100000000008c04066001019750600960008d815260200190815260200160002060806040519081016040908152915467ffffffffffffffff8116825260ff680100000000000000008204166020830190815261ffff69010000000000000000008304811694840194909452605860020a909104909216606082015297505160008d8152600a602052604090205460ff919091169650945085151561097d576004543410156107c457600080fd5b600454600780549091019055608060405190810160409081524267ffffffffffffffff16825260016020808401829052905460a060020a900461ffff16828401819052606084015260008f81526009909152208151815467ffffffffffffffff191667ffffffffffffffff919091161781556020820151815460ff91909116680100000000000000000268ff0000000000000000199091161781556040820151815461ffff919091166901000000000000000000026affff000000000000000000199091161781556060820151815461ffff91909116605860020a026cffff0000000000000000000000199091161790555060008c8152600960205260409081902090608090519081016040908152915467ffffffffffffffff8116825260ff6801000000000000000082041660208084019190915261ffff69010000000000000000008304811685850152605860020a909204909116606083015260008f8152600a909152919091208a90556004549097508995503411156109785733600160a060020a03166108fc60045434039081150290604051600060405180830381858888f19350505050151561097857600080fd5b610a6e565b6000851161098a57600080fd5b60035467ffffffffffffffff1660020287510167ffffffffffffffff164211806109e65750866040015161ffff16876060015161ffff161480156109e6575060035467ffffffffffffffff1687510167ffffffffffffffff1642115b93508315610a3c5760008c8152600b6020526040812054600454039350831115610a3057600680548401905560078054849003905560008c8152600b602052604090208054840190555b600454831115610a3c57fe5b600160a060020a0333163480156108fc0290604051600060405180830381858888f193505050501515610a6e57600080fd5b831515610a8157610a818c8c8a88611197565b505050505050505050505050565b600c81565b60065481565b60005433600160a060020a03908116911614610ab557600080fd5b600054600160a060020a0316ff5b60005433600160a060020a03908116911614610ade57600080fd5b60005460a060020a900460ff1615610af557600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60005460a060020a900460ff1615610b5e57600080fd5b600554341015610b6d57600080fd5b600580546006805490910190556000828152600a602090815260408083208390556009825280832080546cffffffffffffffffffffffffff19169055600b90915281205554341115610bf05733600160a060020a03166108fc60055434039081150290604051600060405180830381858888f193505050501515610bf057600080fd5b50565b600054600160a060020a031681565b600b6020526000908152604090205481565b60075481565b600a81565b565b60096020526000908152604090205467ffffffffffffffff81169060ff680100000000000000008204169061ffff69010000000000000000008204811691605860020a90041684565b60005433600160a060020a03908116911614610c8557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60025481565b6000806000806000806000806000806000610cd36117f4565b600154600090600160a060020a031663730bdc968f8360405160e0015260405160e060020a63ffffffff8416028152600481019190915260240160e060405180830381600087803b1515610d2657600080fd5b6102c65a03f11515610d3757600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051906020018051505060015492995090975050600160a060020a03169250636c0d2c8b91508690506003600060405160c0015260405160e060020a63ffffffff85160281526004810192909252602482015260440160c060405180830381600087803b1515610dca57600080fd5b6102c65a03f11515610ddb57600080fd5b50505060405180519060200180519060200180519060200180519060200180519060200180519050909192935090919250909150905050809d505060206501000000000085811515610e2957fe5b04811515610e3357fe5b066001019b5060206710000000000000008504066001019a50600a60008f8152602001908152602001600020549950600960008f815260200190815260200160002060806040519081016040908152915467ffffffffffffffff8116825260ff68010000000000000000820416602083015261ffff69010000000000000000008204811693830193909352605860020a900490911660608201529150815167ffffffffffffffff1698506000826020015160ff16118015610f4c5750891580610f0f5750600354600267ffffffffffffffff9182160216890142115b80610f4c5750816040015161ffff16826060015161ffff16148015610f4c575060035467ffffffffffffffff1682510167ffffffffffffffff1642115b9050816020015160ff161515610f7f57600180548c9b5090985060a060020a900461ffff16965086955060009450611084565b8015610fae57816020015160ff169750816040015161ffff169650816060015161ffff16955060039450611084565b60035467ffffffffffffffff16890142111561105f5789600254836020015160ff160111156110045760009950816020015160ff169750816040015161ffff169650816060015161ffff1695506002945061105a565b600254826020015160035460ff9190911691909101909a039967ffffffffffffffff169890980197602082015160010160ff169750600160149054906101000a900461ffff1661ffff1688029650869550600194505b611084565b816020015160ff169750816040015161ffff169650816060015161ffff169550600294505b505050509193959799909294969850565b60005433600160a060020a039081169116146110b057600080fd5b600160a060020a03811615156110c557600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461114b57600080fd5b80600160a060020a0316ff5b60005433600160a060020a0390811691161461117257600080fd5b600555565b60005433600160a060020a0390811691161461119257600080fd5b600455565b600084815260096020526040808220805460015491936801000000000000000090910460ff16929091829182918291829182918291600160a060020a031690636c0d2c8b908e9060039085905160c0015260405160e060020a63ffffffff85160281526004810192909252602482015260440160c060405180830381600087803b151561122357600080fd5b6102c65a03f1151561123457600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805150949b505050631dcd65003a1015925061127b91505057631dcd650061127d565b3a5b611287600561178d565b600101600a0288633b9aca000281151561129d57fe5b048c633b9aca0002018115156112af57fe5b8a549190049550605860020a900461ffff1685108015945061149e578760010191506080604051908101604052804267ffffffffffffffff1681526020018360ff168152602001600160149054906101000a900461ffff168460ff160261ffff168152602001600160149054906101000a900461ffff168460ff160261ffff16815250600960008f81526020019081526020016000206000820151815467ffffffffffffffff191667ffffffffffffffff919091161781556020820151815460ff91909116680100000000000000000268ff0000000000000000199091161781556040820151815461ffff919091166901000000000000000000026affff000000000000000000199091161781556060820151815461ffff91909116605860020a026cffff0000000000000000000000199091161790555060008d8152600960205260409020985060ff881660051415611433576004546002905b60008f8152600b6020526040902080549290910491820190556007805482900390559250611468565b60ff8816600a141561144a5760045460029061140a565b60ff8816600c14156114685760068054600281049081900390915592505b600160a060020a03331683156108fc0284604051600060405180830381858888f19350505050151561149957600080fd5b611517565b885460ff861661ffff605860020a80840482169290920316026cffff00000000000000000000001990911617808a5560035467ffffffffffffffff91821690821601164211156114f7576002548860ff16019550611517565b600260ff89161061151757611514600260ff8a160460ff1661178d565b95505b89861061157e575060008c8152600a60209081526040808320839055600b909152812054600454039081111561156d57600680548201905560078054829003905560008d8152600b602052604090208054820190555b60045481111561157957fe5b611717565b600086111561159d5760008d8152600a60205260409020805487900390555b600354895467ffffffffffffffff918216908216011642111561171757600190970196608060405190810160405280600360009054906101000a900467ffffffffffffffff168b60000160009054906101000a900467ffffffffffffffff160167ffffffffffffffff1681526020018960ff168152602001600160149054906101000a900461ffff168a60ff160261ffff168152602001600160149054906101000a900461ffff168a60ff160261ffff16815250600960008f81526020019081526020016000206000820151815467ffffffffffffffff191667ffffffffffffffff919091161781556020820151815460ff91909116680100000000000000000268ff0000000000000000199091161781556040820151815461ffff919091166901000000000000000000026affff000000000000000000199091161781556060820151815461ffff91909116605860020a026cffff0000000000000000000000199091161790555060008d815260096020526040902098505b8760ff168d33600160a060020a03167f9ef1d73adb4edbf0d986366fc204ff53b6f08dbeb9b2d8268a96d0ccbca85ab642898b8a8a604051948552602085019390935260408085019290925215156060840152608083019190915260a0909101905180910390a450505050505050505050505050565b6000600854600143034041446040519384526020840192909252600160a060020a03166c0100000000000000000000000002604080840191909152605483019190915260749091019051908190039020600881905582908115156117ed57fe5b0692915050565b608060405190810160409081526000808352602083018190529082018190526060820152905600a165627a7a72305820ab66e744f939587582b374b6c19b7ecfa8a0a6ff2c16d41fcf22034276b6fbdb0029

Swarm Source

bzzr://ab66e744f939587582b374b6c19b7ecfa8a0a6ff2c16d41fcf22034276b6fbdb

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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