Latest 25 transactions from a total of 3066 transactions

TxHash Age From To Value [TxFee]
0x261692206e9278fe7fa3a7a382b8cd736b8d98282db171f36a85c770ba78a730156 days 8 hrs ago0x1659acf7231739825c900e0caadd37aca5d272ab  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.00027923
0x38e5ba8dd97399ab127e07c2da89ebd79529589d7be99d20c36b5075c9f57b4c156 days 8 hrs ago0x1659acf7231739825c900e0caadd37aca5d272ab  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0003933
0xfe9556afc936fb488277ce6061513261903ec0214acd42b55b157d5af02b3802156 days 8 hrs ago0x1659acf7231739825c900e0caadd37aca5d272ab  IN   0xb574ca89686853805be68f43f2f81a36e78831320.02 Ether0.00132222
0x9199d58476062504e38383781eea9ceac740078dce68da0e61c09aba0e9fdd13157 days 13 hrs ago0x1659acf7231739825c900e0caadd37aca5d272ab  IN   0xb574ca89686853805be68f43f2f81a36e78831320.02 Ether0.00262966
0xaee3f464a3ffce543127b91ea30b3713ea966f940963043d11a37e9c632f78ea157 days 13 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.00129152
0x7b3f05863a4309ca9ea769fedb7f6c9bb0f8bd4ee82b1ef427b1b99d23b3de9e157 days 13 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.00118112
0x56831663a51177904fcedbc64927e64e0a0c6b065c81769acf4e53982fbb7e2e158 days 9 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.000174728
0xffa5aad54d026c392eeedef711c421d676babd9577a333d62c8fc45ac349bba1158 days 9 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0010296
0x8f06cf8f597f808369c0a7ef36e65b7e5ecbad0b0200051943346831f0e8a98e158 days 9 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.000508096
0x0fbb0017600ab818ee8937ad14607fac93c6e91cd0fde32b3a42c62f4a43449f158 days 9 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.000522288
0x69b869e134fd6d86d7e7cee7d8bb476a748e8ed1b3a8e3f4474c6c0bf2d7cfa2158 days 13 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.000558026
0x4311448951aaf57f5efd74f558d45de8666c191ec8da5dd40639df416b4f288c158 days 13 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.001250368
0xb63b82e5114d277b04939041d3bde8dfdc12ca2ac3386be7509a20c4bbdb717d158 days 13 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.000868504
0xbba4d96951d266779263d28fb9c3f5f46daf1af7d1c23c5047f4d7e26b57a90a158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0368
0x511238f52ddcd719b48e074473336558dae06493e2dd29a54ac72e9aa2d67bd4158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0368
0xfc84bf43a78bdd4aa3b325f8071c5bbf3d569193388b4502ece481ff95a599ba158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0368
0xdd03da7129602b835a0ec5c31d793908aa36605c7eb5dd93bac2f5378724933c158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0368
0xefa837bb8999d70aed64c7d5676c88a421b37acaca98ed9dbebe6fa6af261210158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0368
0x9e2bbb847fc67d13400549d92e917cf9c6c23331183b654a23fa114db348f13e158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0368
0xba982c06b2efbeea74ddbb542377058da74b9aacc42f40f468b59359c9f7deef158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0368
0xd533ac805486b112f10689510686e1574cc428a86c07584774df8ea19fd4876e158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0368
0x01d61f9eeb9900731f631b6316d04bd0c9360d6895d88fedcff8e814d5187779158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0368
0x6f2a93baccf0829865d7e0fef01e824407c7afffb908abf46196400e2ccbc497158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.0368
0x80c979b34bcea11813dd345518df92f3b43bf6881e0c457b0c9d7ba1b8754182158 days 14 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.175921860444
0x9cd3e10b6c6b17d5726da67b4e97084ffdbc83a78125ba391c634484335ae7a8159 days 5 hrs ago0x1659acf7231739825c900e0caadd37aca5d272ab  IN   0xb574ca89686853805be68f43f2f81a36e78831320 Ether0.001236447
[ 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
0x261692206e9278fe7fa3a7a382b8cd736b8d98282db171f36a85c770ba78a7304038659156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0x261692206e9278fe7fa3a7a382b8cd736b8d98282db171f36a85c770ba78a7304038659156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0x261692206e9278fe7fa3a7a382b8cd736b8d98282db171f36a85c770ba78a7304038659156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0x261692206e9278fe7fa3a7a382b8cd736b8d98282db171f36a85c770ba78a7304038659156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0x261692206e9278fe7fa3a7a382b8cd736b8d98282db171f36a85c770ba78a7304038659156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
0x38e5ba8dd97399ab127e07c2da89ebd79529589d7be99d20c36b5075c9f57b4c4038659156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0x38e5ba8dd97399ab127e07c2da89ebd79529589d7be99d20c36b5075c9f57b4c4038659156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0x38e5ba8dd97399ab127e07c2da89ebd79529589d7be99d20c36b5075c9f57b4c4038659156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0x38e5ba8dd97399ab127e07c2da89ebd79529589d7be99d20c36b5075c9f57b4c4038659156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0x38e5ba8dd97399ab127e07c2da89ebd79529589d7be99d20c36b5075c9f57b4c4038659156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
0xeed7178ae5ef0ca759d736950e258b35631e48c4813b5aa0cb60192314d11d234038658156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x8a01bc6a9358388588247127ff7be21b281b36d40 Ether
0xeed7178ae5ef0ca759d736950e258b35631e48c4813b5aa0cb60192314d11d234038658156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
0xeed7178ae5ef0ca759d736950e258b35631e48c4813b5aa0cb60192314d11d234038658156 days 8 hrs ago0x8a01bc6a9358388588247127ff7be21b281b36d40xb574ca89686853805be68f43f2f81a36e78831320 Ether
0x6bd8a3e6a4fb4e0f0e2e4584984e51dffb2b89d35ce6ea098cf1e5b9b3f44eb14038658156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x8a01bc6a9358388588247127ff7be21b281b36d40 Ether
0x6bd8a3e6a4fb4e0f0e2e4584984e51dffb2b89d35ce6ea098cf1e5b9b3f44eb14038658156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
0x6bd8a3e6a4fb4e0f0e2e4584984e51dffb2b89d35ce6ea098cf1e5b9b3f44eb14038658156 days 8 hrs ago0x8a01bc6a9358388588247127ff7be21b281b36d40xb574ca89686853805be68f43f2f81a36e78831320 Ether
0xfe9556afc936fb488277ce6061513261903ec0214acd42b55b157d5af02b38024038551156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
0xfe9556afc936fb488277ce6061513261903ec0214acd42b55b157d5af02b38024038551156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
0xfe9556afc936fb488277ce6061513261903ec0214acd42b55b157d5af02b38024038551156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0xfe9556afc936fb488277ce6061513261903ec0214acd42b55b157d5af02b38024038551156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0xfe9556afc936fb488277ce6061513261903ec0214acd42b55b157d5af02b38024038551156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
0xfe9556afc936fb488277ce6061513261903ec0214acd42b55b157d5af02b38024038551156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
0xfe9556afc936fb488277ce6061513261903ec0214acd42b55b157d5af02b38024038551156 days 8 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
0x9199d58476062504e38383781eea9ceac740078dce68da0e61c09aba0e9fdd134029927157 days 13 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
0x9199d58476062504e38383781eea9ceac740078dce68da0e61c09aba0e9fdd134029927157 days 13 hrs ago0xb574ca89686853805be68f43f2f81a36e78831320x91d828198bac9e478f4c7712f5fbdb2846822d230 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: DragonKing
Compiler Version: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

/**
 * Note for the truffle testversion:
 * DragonKingTest inherits from DragonKing and adds one more function for testing the volcano from truffle.
 * For deployment on ropsten or mainnet, just deploy the DragonKing contract and remove this comment before verifying on
 * etherscan.
 * */

 /**
  * Dragonking is a blockchain game in which players may purchase dragons and knights of different levels and values.
  * Once every period of time the volcano erupts and wipes a few of them from the board. The value of the killed characters
  * gets distributed amongst all of the survivors. The dragon king receive a bigger share than the others.
  * In contrast to dragons, knights need to be teleported to the battlefield first with the use of teleport tokens.
  * Additionally, they may attack a dragon once per period.
  * Both character types can be protected from death up to three times.
  * Take a look at dragonking.io for more detailed information.
  * @author: Julia Altenried, Yuriy Kashnikov
  * */

pragma solidity ^0.4.24;


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

}


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

contract DragonKingConfig {


  /** the cost of each character type */
  uint128[] public costs;
  /** the value of each character type (cost - fee), so it's not necessary to compute it each time*/
  uint128[] public values;
  /** the fee to be paid each time an character is bought in percent*/
  uint8 fee;
  /** The maximum of characters allowed in the game */
  uint16 public maxCharacters;
  /** the amount of time that should pass since last eruption **/
  uint256 public eruptionThreshold;
  /** the amount of time that should pass ince last castle loot distribution **/
  uint256 public castleLootDistributionThreshold;
  /** how many characters to kill in %, e.g. 20 will stand for 20%, should be < 100 **/
  uint8 public percentageToKill;
  /* Cooldown threshold */
  uint256 public constant CooldownThreshold = 1 days;
  /** fight factor, used to compute extra probability in fight **/
  uint8 public fightFactor;

  /** the price for teleportation*/
  uint256 public teleportPrice;
  /** the price for protection */
  uint256 public protectionPrice;

}

interface Token {
  function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
  function transfer(address _to, uint256 _value) external returns (bool success);
  function balanceOf(address who) external view returns (uint256);
}


contract DragonKing is Destructible {

  struct Character {
    uint8 characterType;
    uint128 value;
    address owner;
    uint64 purchaseTimestamp;
  }

  DragonKingConfig  config = DragonKingConfig(0x91d828198baC9E478f4c7712F5fBDB2846822D23);

  /** the neverdue token contract used to purchase protection from eruptions and fights */
  Token  neverdieToken = Token(0xEe7ACd6b0FB65eeBC11cF733fdC606619CF633D4);
  /** the teleport token contract used to send knights to the game scene */
  Token  teleportToken = Token(0x8A01Bc6A9358388588247127fF7BE21B281B36d4);

  /** the SKL token contract **/
  Token  sklToken = Token(0xD22d680d1fa045A07E8d335C1Bb815EbFC4D4e5E);
  /** the XP token contract **/
  Token  xperToken = Token(0x822afedd7d48ed1056247747c8ed6df7f02b50fc);
  

  /** array holding ids of the curret characters **/
  uint32[]  ids;
  /** the id to be given to the next character **/
  uint32  nextId = 1;
  /** non-existant character **/
  uint16  constant INVALID_CHARACTER_INDEX = ~uint16(0);

  /** the castle treasury **/
  uint128 public castleTreasury;
  /** the id of the oldest character **/
  uint32 public oldest;
  /** the character belonging to a given id **/
  mapping(uint32 => Character) characters;
  /** teleported knights **/
  mapping(uint32 => bool) teleported;

  /** constant used to signal that there is no King at the moment **/
  uint32 constant  noKing = ~uint32(0);

  /** total number of characters in the game **/
  uint16 public numCharacters;
  /** number of characters per type **/
  mapping(uint8 => uint16) numCharactersXType;

  /** timestampt of the last eruption event **/
  uint256 public lastEruptionTimestamp;
  /** timestampt of the last castle loot distribution **/
  uint256 public lastCastleLootDistributionTimestamp;

  /** character type range constants **/
  uint8  constant DRAGON_MIN_TYPE = 0;
  uint8  constant DRAGON_MAX_TYPE = 5;

  uint8  constant KNIGHT_MIN_TYPE = 6;
  uint8  constant KNIGHT_MAX_TYPE = 11;

  uint8  constant BALLOON_MIN_TYPE = 12;
  uint8  constant BALLOON_MAX_TYPE = 14;

  uint8  constant WIZARD_MIN_TYPE = 15;
  uint8  constant WIZARD_MAX_TYPE = 20;

  uint8  constant ARCHER_MIN_TYPE = 21;
  uint8  constant ARCHER_MAX_TYPE = 26;

  uint8  constant NUMBER_OF_LEVELS = 6;

  uint8  constant INVALID_CHARACTER_TYPE = 27;

  /** minimum amount of XPER and SKL to purchase wizards **/
  uint8  MIN_XPER_AMOUNT_TO_PURCHASE_WIZARD = 100;
  uint8  MIN_SKL_AMOUNT_TO_PURCHASE_WIZARD = 50;

  /** minimum amount of XPER and SKL to purchase archer **/
  uint8  MIN_XPER_AMOUNT_TO_PURCHASE_ARCHER = 10;
  uint8  MIN_SKL_AMOUNT_TO_PURCHASE_ARCHER = 5;

    /** knight cooldown. contains the timestamp of the earliest possible moment to start a fight */
  mapping(uint32 => uint)  cooldown;

    /** tells the number of times a character is protected */
  mapping(uint32 => uint8)  protection;

  // EVENTS

  /** is fired when new characters are purchased (who bought how many characters of which type?) */
  event NewPurchase(address player, uint8 characterType, uint16 amount, uint32 startId);
  /** is fired when a player leaves the game */
  event NewExit(address player, uint256 totalBalance, uint32[] removedCharacters);
  /** is fired when an eruption occurs */
  event NewEruption(uint32[] hitCharacters, uint128 value, uint128 gasCost);
  /** is fired when a single character is sold **/
  event NewSell(uint32 characterId, address player, uint256 value);
  /** is fired when a knight fights a dragon **/
  event NewFight(uint32 winnerID, uint32 loserID, uint256 value, uint16 probability, uint16 dice);
  /** is fired when a knight is teleported to the field **/
  event NewTeleport(uint32 characterId);
  /** is fired when a protection is purchased **/
  event NewProtection(uint32 characterId, uint8 lifes);
  /** is fired when a castle loot distribution occurs**/
  event NewDistributionCastleLoot(uint128 castleLoot);


  /**
   * buys as many characters as possible with the transfered value of the given type
   * @param characterType the type of the character
   */
  function addCharacters(uint8 characterType) payable public {
    uint16 amount = uint16(msg.value / config.costs(characterType));
    uint16 nchars = numCharacters;
    if (characterType >= INVALID_CHARACTER_TYPE || msg.value < config.costs(characterType) || nchars + amount > config.maxCharacters()) revert();
    uint32 nid = nextId;
    //if type exists, enough ether was transferred and there are less than maxCharacters characters in the game
    if (characterType <= DRAGON_MAX_TYPE) {
      //dragons enter the game directly
      if (oldest == 0 || oldest == noKing)
        oldest = nid;
      for (uint8 i = 0; i < amount; i++) {
        addCharacter(nid + i, nchars + i);
        characters[nid + i] = Character(characterType, config.values(characterType), msg.sender, uint64(now));
      }
      numCharactersXType[characterType] += amount;
      numCharacters += amount;
    }
    else {
      uint256 amountSKL = sklToken.balanceOf(msg.sender);
      uint256 amountXPER = xperToken.balanceOf(msg.sender);
      if (characterType >= WIZARD_MIN_TYPE && characterType <= WIZARD_MAX_TYPE) {
        require( amountSKL >= MIN_SKL_AMOUNT_TO_PURCHASE_WIZARD && amountXPER >= MIN_XPER_AMOUNT_TO_PURCHASE_WIZARD, 
                "insufficient amount of SKL and XPER tokens"
               );
      }
      if (characterType >= ARCHER_MIN_TYPE && characterType <= ARCHER_MAX_TYPE) {
        require( amountSKL >= MIN_SKL_AMOUNT_TO_PURCHASE_ARCHER && amountXPER >= MIN_XPER_AMOUNT_TO_PURCHASE_ARCHER, 
                "insufficient amount of SKL and XPER tokens" 
               );
      }
      // to enter game knights, mages, and archers should be teleported later
      for (uint8 j = 0; j < amount; j++) {
        characters[nid + j] = Character(characterType, config.values(characterType), msg.sender, uint64(now));
      }
    }
    nextId = nid + amount;
    emit NewPurchase(msg.sender, characterType, amount, nid);
  }


  /**
   * adds a single dragon of the given type to the ids array, which is used to iterate over all characters
   * @param nId the id the character is about to receive
   * @param nchars the number of characters currently in the game
   */
  function addCharacter(uint32 nId, uint16 nchars) internal {
    if (nchars < ids.length)
      ids[nchars] = nId;
    else
      ids.push(nId);
  }

  /**
   * Replaces the character with the given id with the last character in the array
   * @param index the index of the character in the id array
   * @param nchars the number of characters
   * */
  function replaceCharacter(uint16 index, uint16 nchars) internal {
    uint32 characterId = ids[index];
    numCharactersXType[characters[characterId].characterType]--;
    if (characterId == oldest) oldest = 0;
    delete characters[characterId];
    ids[index] = ids[nchars];
    delete ids[nchars];
  }

  /**
   * The volcano eruption can be triggered by anybody but only if enough time has passed since the last eription.
   * The volcano hits up to a certain percentage of characters, but at least one.
   * The percantage is specified in 'percentageToKill'
   * */
  function triggerVolcanoEruption() public {
    require(now >= lastEruptionTimestamp + config.eruptionThreshold(),
           "not enough time passed since last eruption");
    require(numCharacters > 0,
           "there are no characters in the game");
    lastEruptionTimestamp = now;
    uint128 pot;
    uint128 value;
    uint16 random;
    uint32 nextHitId;
    uint16 nchars = numCharacters;
    uint32 howmany = nchars * config.percentageToKill() / 100;
    uint128 neededGas = 80000 + 10000 * uint32(nchars);
    if(howmany == 0) howmany = 1;//hit at least 1
    uint32[] memory hitCharacters = new uint32[](howmany);
    bool[] memory alreadyHit = new bool[](nextId);
    uint8 i = 0;
    uint16 j = 0;
    while (i < howmany) {
      j++;
      random = uint16(generateRandomNumber(lastEruptionTimestamp + j) % nchars);
      nextHitId = ids[random];
      if (!alreadyHit[nextHitId]) {
        alreadyHit[nextHitId] = true;
        hitCharacters[i] = nextHitId;
        value = hitCharacter(random, nchars, 0);
        if (value > 0) {
          nchars--;
        }
        pot += value;
        i++;
      }
    }
    uint128 gasCost = uint128(neededGas * tx.gasprice);
    numCharacters = nchars;
    if (pot > gasCost){
      distribute(pot - gasCost); //distribute the pot minus the oraclize gas costs
      emit NewEruption(hitCharacters, pot - gasCost, gasCost);
    }
    else
      emit NewEruption(hitCharacters, 0, gasCost);
  }

  /**
   * Knight can attack a dragon.
   * Archer can attack only a balloon.
   * Dragon can attack wizards and archers.
   * Wizard can attack anyone, except balloon.
   * Balloon cannot attack.
   * The value of the loser is transfered to the winner.
   * @param characterID the ID of the knight to perfrom the attack
   * @param characterIndex the index of the knight in the ids-array. Just needed to save gas costs.
   *            In case it's unknown or incorrect, the index is looked up in the array.
   * */
  function fight(uint32 characterID, uint16 characterIndex) public {
    if (characterID != ids[characterIndex])
      characterIndex = getCharacterIndex(characterID);
    Character storage character = characters[characterID];
    require(cooldown[characterID] + config.CooldownThreshold() <= now,
            "not enough time passed since the last fight of this character");
    require(character.owner == msg.sender,
            "only owner can initiate a fight for this character");

    uint8 ctype = character.characterType;
    require(ctype < BALLOON_MIN_TYPE || ctype > BALLOON_MAX_TYPE,
            "balloons cannot fight");

    uint16 adversaryIndex = getRandomAdversary(characterID, ctype);
    assert(adversaryIndex != INVALID_CHARACTER_INDEX);
    uint32 adversaryID = ids[adversaryIndex];

    Character storage adversary = characters[adversaryID];
    uint128 value;
    uint16 base_probability;
    uint16 dice = uint16(generateRandomNumber(characterID) % 100);
    uint256 characterPower = sklToken.balanceOf(character.owner) / 10**15 + xperToken.balanceOf(character.owner);
    uint256 adversaryPower = sklToken.balanceOf(adversary.owner) / 10**15 + xperToken.balanceOf(adversary.owner);
    
    if (character.value == adversary.value) {
        base_probability = 50;
      if (characterPower > adversaryPower) {
        base_probability += uint16(100 / config.fightFactor());
      } else if (adversaryPower > characterPower) {
        base_probability -= uint16(100 / config.fightFactor());
      }
    } else if (character.value > adversary.value) {
      base_probability = 100;
      if (adversaryPower > characterPower) {
        base_probability -= uint16((100 * adversary.value) / character.value / config.fightFactor());
      }
    } else if (characterPower > adversaryPower) {
        base_probability += uint16((100 * character.value) / adversary.value / config.fightFactor());
    }

    if (dice >= base_probability) {
      // adversary won
      if (adversary.characterType < BALLOON_MIN_TYPE || adversary.characterType > BALLOON_MAX_TYPE) {
        value = hitCharacter(characterIndex, numCharacters, adversary.characterType);
        if (value > 0) {
          numCharacters--;
        }
        if (adversary.characterType >= ARCHER_MIN_TYPE && adversary.characterType <= ARCHER_MAX_TYPE) {
          castleTreasury += value;
        } else {
          adversary.value += value;
        }
        emit NewFight(adversaryID, characterID, value, base_probability, dice);
      } else {
        emit NewFight(adversaryID, characterID, 0, base_probability, dice); // balloons do not hit back
      }
    } else {
      // character won
      value = hitCharacter(adversaryIndex, numCharacters, character.characterType);
      if (value > 0) {
        numCharacters--;
      }
      if (character.characterType >= ARCHER_MIN_TYPE && character.characterType <= ARCHER_MAX_TYPE) {
        castleTreasury += value;
      } else {
        character.value += value;
      }
      if (oldest == 0) findOldest();
      emit NewFight(characterID, adversaryID, value, base_probability, dice);
    }
    cooldown[characterID] = now;
  }

  /*
  * @param characterType
  * @param adversaryType
  * @return whether adversaryType is a valid type of adversary for a given character
  */
  function isValidAdversary(uint8 characterType, uint8 adversaryType) pure returns (bool) {
    if (characterType >= KNIGHT_MIN_TYPE && characterType <= KNIGHT_MAX_TYPE) { // knight
      return (adversaryType <= DRAGON_MAX_TYPE);
    } else if (characterType >= WIZARD_MIN_TYPE && characterType <= WIZARD_MAX_TYPE) { // wizard
      return (adversaryType < BALLOON_MIN_TYPE || adversaryType > BALLOON_MAX_TYPE);
    } else if (characterType >= DRAGON_MIN_TYPE && characterType <= DRAGON_MAX_TYPE) { // dragon
      return (adversaryType >= WIZARD_MIN_TYPE);
    } else if (characterType >= ARCHER_MIN_TYPE && characterType <= ARCHER_MAX_TYPE) { // archer
      return ((adversaryType >= BALLOON_MIN_TYPE && adversaryType <= BALLOON_MAX_TYPE)
             || (adversaryType >= KNIGHT_MIN_TYPE && adversaryType <= KNIGHT_MAX_TYPE));
 
    }
    return false;
  }

  /**
   * pick a random adversary.
   * @param nonce a nonce to make sure there's not always the same adversary chosen in a single block.
   * @return the index of a random adversary character
   * */
  function getRandomAdversary(uint256 nonce, uint8 characterType) internal view returns(uint16) {
    uint16 randomIndex = uint16(generateRandomNumber(nonce) % numCharacters);
    // use 7, 11 or 13 as step size. scales for up to 1000 characters
    uint16 stepSize = numCharacters % 7 == 0 ? (numCharacters % 11 == 0 ? 13 : 11) : 7;
    uint16 i = randomIndex;
    //if the picked character is a knight or belongs to the sender, look at the character + stepSizes ahead in the array (modulo the total number)
    //will at some point return to the startingPoint if no character is suited
    do {
      if (isValidAdversary(characterType, characters[ids[i]].characterType) && characters[ids[i]].owner != msg.sender) {
        return i;
      }
      i = (i + stepSize) % numCharacters;
    } while (i != randomIndex);

    return INVALID_CHARACTER_INDEX;
  }


  /**
   * generate a random number.
   * @param nonce a nonce to make sure there's not always the same number returned in a single block.
   * @return the random number
   * */
  function generateRandomNumber(uint256 nonce) internal view returns(uint) {
    return uint(keccak256(block.blockhash(block.number - 1), now, numCharacters, nonce));
  }

	/**
   * Hits the character of the given type at the given index.
   * Wizards can knock off two protections. Other characters can do only one.
   * @param index the index of the character
   * @param nchars the number of characters
   * @return the value gained from hitting the characters (zero is the character was protected)
   * */
  function hitCharacter(uint16 index, uint16 nchars, uint8 characterType) internal returns(uint128 characterValue) {
    uint32 id = ids[index];
    uint8 knockOffProtections = 1;
    if (characterType >= WIZARD_MIN_TYPE && characterType <= WIZARD_MAX_TYPE) {
      knockOffProtections = 2;
    }
    if (protection[id] >= knockOffProtections) {
      protection[id] -= knockOffProtections;
      return 0;
    }
    characterValue = characters[ids[index]].value;
    nchars--;
    replaceCharacter(index, nchars);
  }

  /**
   * finds the oldest character
   * */
  function findOldest() public {
    uint32 newOldest = noKing;
    for (uint16 i = 0; i < numCharacters; i++) {
      if (ids[i] < newOldest && characters[ids[i]].characterType <= DRAGON_MAX_TYPE)
        newOldest = ids[i];
    }
    oldest = newOldest;
  }

  /**
  * distributes the given amount among the surviving characters
  * @param totalAmount nthe amount to distribute
  */
  function distribute(uint128 totalAmount) internal {
    uint128 amount;
    if (oldest == 0)
      findOldest();
    if (oldest != noKing) {
      //pay 10% to the oldest dragon
      characters[oldest].value += totalAmount / 10;
      amount  = totalAmount / 10 * 9;
    } else {
      amount  = totalAmount;
    }
    //distribute the rest according to their type
    uint128 valueSum;
    uint8 size = ARCHER_MAX_TYPE;
    uint128[] memory shares = new uint128[](size);
    for (uint8 v = 0; v < size; v++) {
      if ((v < BALLOON_MIN_TYPE || v > BALLOON_MAX_TYPE) && numCharactersXType[v] > 0) {
           valueSum += config.values(v);
      }
    }
    for (uint8 m = 0; m < size; m++) {
      if ((v < BALLOON_MIN_TYPE || v > BALLOON_MAX_TYPE) && numCharactersXType[m] > 0) {
        shares[m] = amount * config.values(m) / valueSum / numCharactersXType[m];
      }
    }
    uint8 cType;
    for (uint16 i = 0; i < numCharacters; i++) {
      cType = characters[ids[i]].characterType;
      if (cType < BALLOON_MIN_TYPE || cType > BALLOON_MAX_TYPE)
        characters[ids[i]].value += shares[characters[ids[i]].characterType];
    }
  }


  /**
  * withdraw NDC and TPT tokens
  */
 /* function withdraw() public onlyOwner {
    uint256 ndcBalance = neverdieToken.balanceOf(this);
    assert(neverdieToken.transfer(owner, ndcBalance));
    uint256 tptBalance = teleportToken.balanceOf(this);
    assert(teleportToken.transfer(owner, tptBalance));
  }
*/

  /* @dev distributes castle loot among archers */
  function distributeCastleLoot() external {
    require(now >= lastCastleLootDistributionTimestamp + config.castleLootDistributionThreshold(),
            "not enough time passed since the last castle loot distribution");
    lastCastleLootDistributionTimestamp = now;
    uint128 luckFactor = uint128(generateRandomNumber(now) % 51);
    if (luckFactor < 5) {
      luckFactor = 5;
    }
    uint128 amount = castleTreasury * luckFactor / 100; 
    uint128 valueSum;
    uint128[] memory shares = new uint128[](NUMBER_OF_LEVELS);
    uint16 archersCount;
    uint32[] memory archers = new uint32[](numCharacters);

    uint8 cType;
    for (uint8 i = 0; i < ids.length; i++) {
      cType = characters[ids[i]].characterType; 
      if ((cType >= ARCHER_MIN_TYPE && cType <= ARCHER_MAX_TYPE) && (((uint64(now) - characters[ids[i]].purchaseTimestamp) / config.eruptionThreshold()) >= 7)) {
        valueSum += config.values(cType);
        archers[archersCount] = ids[i];
        archersCount++;
      }
    }

    if (valueSum > 0) {
      for (uint8 j = 0; j < NUMBER_OF_LEVELS; j++) {
          shares[j] = amount * config.values(ARCHER_MIN_TYPE + j) / valueSum;
      }

      for (uint16 k = 0; k < archersCount; k++) {
        characters[archers[k]].value += shares[characters[archers[k]].characterType - ARCHER_MIN_TYPE];
      }
      castleTreasury -= amount;
      emit NewDistributionCastleLoot(amount);
    } else {
      emit NewDistributionCastleLoot(0);
    }
  }

  /**
   * sell the character of the given id
   * throws an exception in case of a knight not yet teleported to the game
   * @param characterId the id of the character
   * */
  function sellCharacter(uint32 characterId) public {
    require(msg.sender == characters[characterId].owner,
            "only owners can sell their characters");
    require(characters[characterId].characterType < BALLOON_MIN_TYPE || characters[characterId].characterType > BALLOON_MAX_TYPE,
            "balloons are not sellable");
    require(characters[characterId].purchaseTimestamp + 1 days < now,
            "character can be sold only 1 day after the purchase");
    uint128 val = characters[characterId].value;
    numCharacters--;
    replaceCharacter(getCharacterIndex(characterId), numCharacters);
    msg.sender.transfer(val);
    if (oldest == 0)
      findOldest();
    emit NewSell(characterId, msg.sender, val);
  }

  /**
   * receive approval to spend some tokens.
   * used for teleport and protection.
   * @param sender the sender address
   * @param value the transferred value
   * @param tokenContract the address of the token contract
   * @param callData the data passed by the token contract
   * */
  function receiveApproval(address sender, uint256 value, address tokenContract, bytes callData) public {
    uint32 id;
    uint256 price;
    if (msg.sender == address(teleportToken)) {
      id = toUint32(callData);
      price = config.teleportPrice();
      if (characters[id].characterType >= BALLOON_MIN_TYPE && characters[id].characterType <= WIZARD_MAX_TYPE) {
        price *= 2;
      }
      require(value >= price,
              "insufficinet amount of tokens to teleport this character");
      assert(teleportToken.transferFrom(sender, this, price));
      teleportCharacter(id);
    } else if (msg.sender == address(neverdieToken)) {
      id = toUint32(callData);
      // user can purchase extra lifes only right after character purchaes
      // in other words, user value should be equal the initial value
      uint8 cType = characters[id].characterType;
      require(characters[id].value == config.values(cType),
              "protection could be bought only before the first fight and before the first volcano eruption");

      // calc how many lifes user can actually buy
      // the formula is the following:

      uint256 lifePrice;
      uint8 max;
      if(cType <= KNIGHT_MAX_TYPE || (cType >= ARCHER_MIN_TYPE && cType <= ARCHER_MAX_TYPE)){
        lifePrice = ((cType % NUMBER_OF_LEVELS) + 1) * config.protectionPrice();
        max = 3;
      } else if (cType >= BALLOON_MIN_TYPE && cType <= BALLOON_MAX_TYPE) {
        lifePrice = (((cType+3) % NUMBER_OF_LEVELS) + 1) * config.protectionPrice() * 2;
        max = 6;
      } else if (cType >= WIZARD_MIN_TYPE && cType <= WIZARD_MAX_TYPE) {
        lifePrice = (((cType+3) % NUMBER_OF_LEVELS) + 1) * config.protectionPrice() * 2;
        max = 3;
      }

      price = 0;
      uint8 i = protection[id];
      for (i; i < max && value >= price + lifePrice * (i + 1); i++) {
        price += lifePrice * (i + 1);
      }
      assert(neverdieToken.transferFrom(sender, this, price));
      protectCharacter(id, i);
    } else {
      revert("Should be either from Neverdie or Teleport tokens");
    }
  }

  /**
   * Knights, balloons, wizards, and archers are only entering the game completely, when they are teleported to the scene
   * @param id the character id
   * */
  function teleportCharacter(uint32 id) internal {
    // ensure we do not teleport twice
    require(teleported[id] == false,
           "already teleported");
    teleported[id] = true;
    Character storage character = characters[id];
    require(character.characterType > DRAGON_MAX_TYPE,
           "dragons do not need to be teleported"); //this also makes calls with non-existent ids fail
    addCharacter(id, numCharacters);
    numCharacters++;
    numCharactersXType[character.characterType]++;
    emit NewTeleport(id);
  }

  /**
   * adds protection to a character
   * @param id the character id
   * @param lifes the number of protections
   * */
  function protectCharacter(uint32 id, uint8 lifes) internal {
    protection[id] = lifes;
    emit NewProtection(id, lifes);
  }


  /****************** GETTERS *************************/

  /**
   * returns the character of the given id
   * @param characterId the character id
   * @return the type, value and owner of the character
   * */
  function getCharacter(uint32 characterId) public view returns(uint8, uint128, address) {
    return (characters[characterId].characterType, characters[characterId].value, characters[characterId].owner);
  }

  /**
   * returns the index of a character of the given id
   * @param characterId the character id
   * @return the character id
   * */
  function getCharacterIndex(uint32 characterId) public returns(uint16) {
    for (uint16 i = 0; i < ids.length; i++) {
      if (ids[i] == characterId) {
        return i;
      }
    }
    revert();
  }

  /**
   * returns 10 characters starting from a certain indey
   * @param startIndex the index to start from
   * @return 4 arrays containing the ids, types, values and owners of the characters
   * */
  function get10Characters(uint16 startIndex) public returns(uint32[10] characterIds, uint8[10] types, uint128[10] values, address[10] owners) {
    uint32 endIndex = startIndex + 10 > numCharacters ? numCharacters : startIndex + 10;
    uint8 j = 0;
    uint32 id;
    for (uint16 i = startIndex; i < endIndex; i++) {
      id = ids[i];
      characterIds[j] = id;
      types[j] = characters[id].characterType;
      values[j] = characters[id].value;
      owners[j] = characters[id].owner;
      j++;
    }

  }

  /************* HELPERS ****************/

  /**
   * only works for bytes of length < 32
   * @param b the byte input
   * @return the uint
   * */
  function toUint32(bytes b) internal pure returns(uint32) {
    bytes32 newB;
    assembly {
      newB: = mload(0xa0)
    }
    return uint32(newB);
  }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"characterId","type":"uint32"}],"name":"sellCharacter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"triggerVolcanoEruption","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"castleTreasury","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"characterId","type":"uint32"}],"name":"getCharacter","outputs":[{"name":"","type":"uint8"},{"name":"","type":"uint128"},{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"oldest","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"characterId","type":"uint32"}],"name":"getCharacterIndex","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"startIndex","type":"uint16"}],"name":"get10Characters","outputs":[{"name":"characterIds","type":"uint32[10]"},{"name":"types","type":"uint8[10]"},{"name":"values","type":"uint128[10]"},{"name":"owners","type":"address[10]"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"lastCastleLootDistributionTimestamp","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"characterID","type":"uint32"},{"name":"characterIndex","type":"uint16"}],"name":"fight","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"characterType","type":"uint8"}],"name":"addCharacters","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"destroy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"sender","type":"address"},{"name":"value","type":"uint256"},{"name":"tokenContract","type":"address"},{"name":"callData","type":"bytes"}],"name":"receiveApproval","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"distributeCastleLoot","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"characterType","type":"uint8"},{"name":"adversaryType","type":"uint8"}],"name":"isValidAdversary","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"lastEruptionTimestamp","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numCharacters","outputs":[{"name":"","type":"uint16"}],"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":"findOldest","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":false,"name":"player","type":"address"},{"indexed":false,"name":"characterType","type":"uint8"},{"indexed":false,"name":"amount","type":"uint16"},{"indexed":false,"name":"startId","type":"uint32"}],"name":"NewPurchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"player","type":"address"},{"indexed":false,"name":"totalBalance","type":"uint256"},{"indexed":false,"name":"removedCharacters","type":"uint32[]"}],"name":"NewExit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"hitCharacters","type":"uint32[]"},{"indexed":false,"name":"value","type":"uint128"},{"indexed":false,"name":"gasCost","type":"uint128"}],"name":"NewEruption","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"characterId","type":"uint32"},{"indexed":false,"name":"player","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"NewSell","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"winnerID","type":"uint32"},{"indexed":false,"name":"loserID","type":"uint32"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"probability","type":"uint16"},{"indexed":false,"name":"dice","type":"uint16"}],"name":"NewFight","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"characterId","type":"uint32"}],"name":"NewTeleport","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"characterId","type":"uint32"},{"indexed":false,"name":"lifes","type":"uint8"}],"name":"NewProtection","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"castleLoot","type":"uint128"}],"name":"NewDistributionCastleLoot","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
6080604052600180547391d828198bac9e478f4c7712f5fbdb2846822d23600160a060020a03199182161782556002805473ee7acd6b0fb65eebc11cf733fdc606619cf633d490831617905560038054738a01bc6a9358388588247127ff7be21b281b36d49083161790556004805473d22d680d1fa045a07e8d335c1bb815ebfc4d4e5e9083161790556005805473822afedd7d48ed1056247747c8ed6df7f02b50fc9083161790556007805463ffffffff1916909217909155600e8054606460ff199091161761ff0019166132001762ff00001916620a00001763ff000000191663050000001790556000805433921691909117815561422690819061010690396000f3006080604052600436106100f85763ffffffff60e060020a6000350416630fa6002e81146100fd5780631e466eee1461011d578063291ed773146101325780633728bec2146101635780633c3c22b3146101b45780634f255b80146101e2578063603709e314610217578063726c8641146102f0578063773e1e8414610317578063797e2aec1461033c57806383197ef01461034a5780638da5cb5b1461035f5780638f4ffcb1146103905780639c73048b14610400578063ad389d5d14610415578063c10435cc1461044a578063f1be42f11461045f578063f2fde38b14610474578063f5074f4114610495578063fbe6529f146104b6575b600080fd5b34801561010957600080fd5b5061011b63ffffffff600435166104cb565b005b34801561012957600080fd5b5061011b6107ad565b34801561013e57600080fd5b50610147610d52565b604080516001608060020a039092168252519081900360200190f35b34801561016f57600080fd5b5061018163ffffffff60043516610d69565b6040805160ff90941684526001608060020a039092166020840152600160a060020a031682820152519081900360600190f35b3480156101c057600080fd5b506101c9610da8565b6040805163ffffffff9092168252519081900360200190f35b3480156101ee57600080fd5b5061020063ffffffff60043516610dbb565b6040805161ffff9092168252519081900360200190f35b34801561022357600080fd5b5061023361ffff60043516610e27565b604051808561014080838360005b83811015610259578181015183820152602001610241565b5050505090500184600a60200280838360005b8381101561028457818101518382015260200161026c565b5050505090500183600a60200280838360005b838110156102af578181015183820152602001610297565b5050505090500182600a60200280838360005b838110156102da5781810151838201526020016102c2565b5050505090500194505050505060405180910390f35b3480156102fc57600080fd5b50610305610fcc565b60408051918252519081900360200190f35b34801561032357600080fd5b5061011b63ffffffff6004351661ffff60243516610fd2565b61011b60ff60043516611bb1565b34801561035657600080fd5b5061011b612496565b34801561036b57600080fd5b506103746124bb565b60408051600160a060020a039092168252519081900360200190f35b34801561039c57600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261011b94600160a060020a038135811695602480359660443590931695369560849492019181908401838280828437509497506124ca9650505050505050565b34801561040c57600080fd5b5061011b612c3c565b34801561042157600080fd5b5061043660ff600435811690602435166132f3565b604080519115158252519081900360200190f35b34801561045657600080fd5b506103056133e6565b34801561046b57600080fd5b506102006133ec565b34801561048057600080fd5b5061011b600160a060020a03600435166133f6565b3480156104a157600080fd5b5061011b600160a060020a036004351661348a565b3480156104c257600080fd5b5061011b6134ad565b63ffffffff8116600090815260086020526040812060010154600160a060020a03163314610569576040805160e560020a62461bcd02815260206004820152602560248201527f6f6e6c79206f776e6572732063616e2073656c6c20746865697220636861726160448201527f6374657273000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b63ffffffff8216600090815260086020526040902054600c60ff90911610806105ac575063ffffffff8216600090815260086020526040902054600e60ff909116115b1515610602576040805160e560020a62461bcd02815260206004820152601960248201527f62616c6c6f6f6e7320617265206e6f742073656c6c61626c6500000000000000604482015290519081900360640190fd5b63ffffffff82166000908152600860205260409020600101544260a060020a90910467ffffffffffffffff908116620151800116106106b1576040805160e560020a62461bcd02815260206004820152603360248201527f6368617261637465722063616e20626520736f6c64206f6e6c7920312064617960448201527f2061667465722074686520707572636861736500000000000000000000000000606482015290519081900360840190fd5b5063ffffffff8116600090815260086020526040902054600a805461ffff19811661ffff9182166000190190911617905561010090046001608060020a03166107086106fc83610dbb565b600a5461ffff166135e0565b60405133906001608060020a03831680156108fc02916000818181858888f1935050505015801561073d573d6000803e3d6000fd5b5060075460a060020a900463ffffffff16151561075c5761075c6134ad565b6040805163ffffffff841681523360208201526001608060020a0383168183015290517fe5cc68f68d9672681158062a835b6abc2ff3fba89f8db70f3a227d4ac35da3c39181900360600190a15050565b60008060008060008060006060806000806000600160009054906101000a9004600160a060020a0316600160a060020a031663afb7e4956040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561081357600080fd5b505af1158015610827573d6000803e3d6000fd5b505050506040513d602081101561083d57600080fd5b5051600c54014210156108c0576040805160e560020a62461bcd02815260206004820152602a60248201527f6e6f7420656e6f7567682074696d65207061737365642073696e6365206c617360448201527f74206572757074696f6e00000000000000000000000000000000000000000000606482015290519081900360840190fd5b600a54600061ffff90911611610946576040805160e560020a62461bcd02815260206004820152602360248201527f746865726520617265206e6f206368617261637465727320696e20746865206760448201527f616d650000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b42600c55600a54600154604080517f11a5a793000000000000000000000000000000000000000000000000000000008152905161ffff9093169a50606492600160a060020a03909216916311a5a793916004808201926020929091908290030181600087803b1580156109b857600080fd5b505af11580156109cc573d6000803e3d6000fd5b505050506040513d60208110156109e257600080fd5b505160ff16890261ffff168115156109f657fe5b0461ffff1696508761ffff1661271002620138800163ffffffff1695508663ffffffff1660001415610a2757600196505b8663ffffffff16604051908082528060200260200182016040528015610a57578160200160208202803883390190505b506007546040805163ffffffff9092168083526020808202840101909152919650908015610a8f578160200160208202803883390190505b50935060009250600091505b8663ffffffff168360ff161015610bb95781806001019250508761ffff16610aca8361ffff16600c540161379b565b811515610ad357fe5b06995060068a61ffff16815481101515610ae957fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff169850838963ffffffff16815181101515610b2557fe5b906020019060200201511515610bb4576001848a63ffffffff16815181101515610b4b57fe5b91151560209283029091019091015284518990869060ff8616908110610b6d57fe5b63ffffffff909216602092830290910190910152610b8d8a8960006137f4565b9a5060008b6001608060020a03161115610ba957600019909701965b9a8a019a6001909201915b610a9b565b50600a805461ffff891661ffff199091161790556001608060020a038086163a0290818116908d161115610ca257610bf2818d0361391e565b7fa06ad7d0261a795ad8f33fdbef7cf65a0f9f9a825353b13358a96a750acd6b3d85828e03836040518080602001846001608060020a03166001608060020a03168152602001836001608060020a03166001608060020a03168152602001828103825285818151815260200191508051906020019060200280838360005b83811015610c88578181015183820152602001610c70565b5050505090500194505050505060405180910390a1610d44565b7fa06ad7d0261a795ad8f33fdbef7cf65a0f9f9a825353b13358a96a750acd6b3d856000836040518080602001846001608060020a03168152602001836001608060020a03166001608060020a03168152602001828103825285818151815260200191508051906020019060200280838360005b83811015610d2e578181015183820152602001610d16565b5050505090500194505050505060405180910390a15b505050505050505050505050565b60075464010000000090046001608060020a031681565b63ffffffff166000908152600860205260409020805460019091015460ff8216926101009092046001608060020a031691600160a060020a0390911690565b60075460a060020a900463ffffffff1681565b6000805b60065461ffff821610156100f8578263ffffffff1660068261ffff16815481101515610de757fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff161415610e1957809150610e21565b600101610dbf565b50919050565b610e2f6141da565b610e376141da565b610e3f6141da565b610e476141da565b600a805460009182918291829161ffff908116918b011611610e6c5788600a01610e74565b600a5461ffff165b61ffff169350600092508890505b8363ffffffff168161ffff161015610fc1576006805461ffff8316908110610ea657fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff169150818860ff8516600a8110610edc57fe5b63ffffffff9283166020918202929092019190915290831660009081526008909152604090205460ff9081169088908516600a8110610f1757fe5b60ff9283166020918202929092019190915263ffffffff841660009081526008909152604090205461010090046001608060020a03169087908516600a8110610f5c57fe5b6001608060020a039092166020928302919091015263ffffffff8316600090815260089091526040902060010154600160a060020a03168560ff8516600a8110610fa257fe5b600160a060020a03909216602092909202015260019283019201610e82565b505050509193509193565b600d5481565b60008060008060008060008060008060068b61ffff16815481101515610ff457fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff908116908d161461102e5761102b8c610dbb565b9a505b63ffffffff8c16600090815260086020908152604080832060015482517f4597dc8e0000000000000000000000000000000000000000000000000000000081529251919e504294600160a060020a0390911693634597dc8e936004808201949293918390030190829087803b1580156110a657600080fd5b505af11580156110ba573d6000803e3d6000fd5b505050506040513d60208110156110d057600080fd5b505163ffffffff8e166000908152600f6020526040902054011115611165576040805160e560020a62461bcd02815260206004820152603d60248201527f6e6f7420656e6f7567682074696d65207061737365642073696e63652074686560448201527f206c617374206669676874206f66207468697320636861726163746572000000606482015290519081900360840190fd5b60018a0154600160a060020a031633146111ef576040805160e560020a62461bcd02815260206004820152603260248201527f6f6e6c79206f776e65722063616e20696e69746961746520612066696768742060448201527f666f722074686973206368617261637465720000000000000000000000000000606482015290519081900360840190fd5b895460ff169850600c8910806112085750600e60ff8a16115b151561125e576040805160e560020a62461bcd02815260206004820152601560248201527f62616c6c6f6f6e732063616e6e6f742066696768740000000000000000000000604482015290519081900360640190fd5b61126e8c63ffffffff168a613d98565b975061ffff808916141561127e57fe5b6006805461ffff8a1690811061129057fe5b6000918252602080832060088084049091015463ffffffff60046007909516949094026101000a90048316808552915260409092209198509096506064906112d9908e1661379b565b8115156112e257fe5b60055460018d01546040805160e060020a6370a08231028152600160a060020a039283166004820152905194909306965016916370a08231916024808201926020929091908290030181600087803b15801561133d57600080fd5b505af1158015611351573d6000803e3d6000fd5b505050506040513d602081101561136757600080fd5b50516004805460018d01546040805160e060020a6370a08231028152600160a060020a03928316948101949094525166038d7ea4c680009391909216916370a08231916024808201926020929091908290030181600087803b1580156113cc57600080fd5b505af11580156113e0573d6000803e3d6000fd5b505050506040513d60208110156113f657600080fd5b505181151561140157fe5b60055460018a01546040805160e060020a6370a08231028152600160a060020a03928316600482015290519490930494909401955092909216916370a082319160248083019260209291908290030181600087803b15801561146257600080fd5b505af1158015611476573d6000803e3d6000fd5b505050506040513d602081101561148c57600080fd5b50516004805460018901546040805160e060020a6370a08231028152600160a060020a03928316948101949094525166038d7ea4c680009391909216916370a08231916024808201926020929091908290030181600087803b1580156114f157600080fd5b505af1158015611505573d6000803e3d6000fd5b505050506040513d602081101561151b57600080fd5b505181151561152657fe5b88548d5492909104929092019250610100918290046001608060020a039081169290910416141561169a5760329350808211156115f757600160009054906101000a9004600160a060020a0316600160a060020a0316634ad6e6486040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156115b057600080fd5b505af11580156115c4573d6000803e3d6000fd5b505050506040513d60208110156115da57600080fd5b505160ff1660648115156115ea57fe5b0460ff1684019350611695565b8181111561169557600160009054906101000a9004600160a060020a0316600160a060020a0316634ad6e6486040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561165257600080fd5b505af1158015611666573d6000803e3d6000fd5b505050506040513d602081101561167c57600080fd5b505160ff16606481151561168c57fe5b0460ff16840393505b611860565b85548a546001608060020a036101009283900481169290910416111561179157606493508181111561169557600160009054906101000a9004600160a060020a0316600160a060020a0316634ad6e6486040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561171957600080fd5b505af115801561172d573d6000803e3d6000fd5b505050506040513d602081101561174357600080fd5b50518a54875460ff90921691610100918290046001608060020a039081169290910481166064021681151561177457fe5b046001608060020a031681151561178757fe5b0484039350611860565b8082111561186057600160009054906101000a9004600160a060020a0316600160a060020a0316634ad6e6486040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156117ec57600080fd5b505af1158015611800573d6000803e3d6000fd5b505050506040513d602081101561181657600080fd5b505186548b5460ff90921691610100918290046001608060020a039081169290910481166064021681151561184757fe5b046001608060020a031681151561185a57fe5b04840193505b61ffff80851690841610611a2f578554600c60ff909116108061188957508554600e60ff909116115b156119d057600a5486546118a8918d9161ffff9091169060ff166137f4565b94506000856001608060020a031611156118d757600a805461ffff19811661ffff918216600019019091161790555b8554601560ff909116108015906118f557508554601a60ff90911611155b1561193857600780546001608060020a03640100000000808304821689019091160273ffffffffffffffffffffffffffffffff000000001990911617905561196a565b85546001608060020a03610100808304821688019091160270ffffffffffffffffffffffffffffffff00199091161786555b6040805163ffffffff808a1682528e1660208201526001608060020a0387168183015261ffff80871660608301528516608082015290517f24758388bd6bf650dde3bbde100b1056920770025a9f1c5998b4587670d4f3859181900360a00190a1611a2a565b6040805163ffffffff808a1682528e16602082015260008183015261ffff80871660608301528516608082015290517f24758388bd6bf650dde3bbde100b1056920770025a9f1c5998b4587670d4f3859181900360a00190a15b611b8b565b600a548a54611a49918a9161ffff9091169060ff166137f4565b94506000856001608060020a03161115611a7857600a805461ffff19811661ffff918216600019019091161790555b8954601560ff90911610801590611a9657508954601a60ff90911611155b15611ad957600780546001608060020a03640100000000808304821689019091160273ffffffffffffffffffffffffffffffff0000000019909116179055611b0b565b89546001608060020a03610100808304821688019091160270ffffffffffffffffffffffffffffffff0019909116178a555b60075460a060020a900463ffffffff161515611b2957611b296134ad565b6040805163ffffffff808f168252891660208201526001608060020a0387168183015261ffff80871660608301528516608082015290517f24758388bd6bf650dde3bbde100b1056920770025a9f1c5998b4587670d4f3859181900360a00190a15b50505063ffffffff9098166000908152600f602052604090204290555050505050505050565b600154604080517f49b3b29f00000000000000000000000000000000000000000000000000000000815260ff841660048201529051600092839283928392839283928392600160a060020a0316916349b3b29f91602480830192602092919082900301818787803b158015611c2557600080fd5b505af1158015611c39573d6000803e3d6000fd5b505050506040513d6020811015611c4f57600080fd5b50516001608060020a031634811515611c6457fe5b600a54919004975061ffff169550601b60ff8916101580611d215750600154604080517f49b3b29f00000000000000000000000000000000000000000000000000000000815260ff8b1660048201529051600160a060020a03909216916349b3b29f916024808201926020929091908290030181600087803b158015611ce957600080fd5b505af1158015611cfd573d6000803e3d6000fd5b505050506040513d6020811015611d1357600080fd5b50516001608060020a031634105b80611db45750600160009054906101000a9004600160a060020a0316600160a060020a0316638882ddc96040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015611d7a57600080fd5b505af1158015611d8e573d6000803e3d6000fd5b505050506040513d6020811015611da457600080fd5b505161ffff908116878901909116115b15611dbe57600080fd5b60075463ffffffff169450600560ff89161161201b5760075460a060020a900463ffffffff161580611dff575060075460a060020a900463ffffffff908116145b15611e34576007805477ffffffff0000000000000000000000000000000000000000191660a060020a63ffffffff8816021790555b600093505b8661ffff168460ff161015611fd857611e5a60ff8516868101908801613f06565b6040805160808101825260ff8a16808252600154835160e060020a635e383d21028152600481019290925292519192602080850193600160a060020a0390921692635e383d2192602480830193928290030181600087803b158015611ebe57600080fd5b505af1158015611ed2573d6000803e3d6000fd5b505050506040513d6020811015611ee857600080fd5b50516001608060020a039081168252336020808401919091524267ffffffffffffffff90811660409485015260ff8981168b0163ffffffff16600090815260088452859020865181549488015160ff1990951692169190911770ffffffffffffffffffffffffffffffff0019166101009390941692909202929092178155918301516001928301805460609095015173ffffffffffffffffffffffffffffffffffffffff19909516600160a060020a03909216919091177bffffffffffffffff0000000000000000000000000000000000000000191660a060020a94909216939093021790915590930192611e39565b60ff88166000908152600b60205260409020805461ffff1980821661ffff9283168b01831617909255600a80549283169282168a0190911691909117905561241f565b600480546040805160e060020a6370a08231028152339381019390935251600160a060020a03909116916370a082319160248083019260209291908290030181600087803b15801561206c57600080fd5b505af1158015612080573d6000803e3d6000fd5b505050506040513d602081101561209657600080fd5b50516005546040805160e060020a6370a082310281523360048201529051929550600160a060020a03909116916370a08231916024808201926020929091908290030181600087803b1580156120eb57600080fd5b505af11580156120ff573d6000803e3d6000fd5b505050506040513d602081101561211557600080fd5b50519150600f60ff8916108015906121315750601460ff891611155b156121d157600e54610100900460ff1683108015906121555750600e5460ff168210155b15156121d1576040805160e560020a62461bcd02815260206004820152602a60248201527f696e73756666696369656e7420616d6f756e74206f6620534b4c20616e64205860448201527f50455220746f6b656e7300000000000000000000000000000000000000000000606482015290519081900360840190fd5b601560ff8916108015906121e95750601a60ff891611155b1561229157600e546301000000900460ff1683108015906122155750600e5462010000900460ff168210155b1515612291576040805160e560020a62461bcd02815260206004820152602a60248201527f696e73756666696369656e7420616d6f756e74206f6620534b4c20616e64205860448201527f50455220746f6b656e7300000000000000000000000000000000000000000000606482015290519081900360840190fd5b5060005b8661ffff168160ff16101561241f576040805160808101825260ff8a16808252600154835160e060020a635e383d21028152600481019290925292519192602080850193600160a060020a0390921692635e383d2192602480830193928290030181600087803b15801561230857600080fd5b505af115801561231c573d6000803e3d6000fd5b505050506040513d602081101561233257600080fd5b50516001608060020a039081168252336020808401919091524267ffffffffffffffff90811660409485015260ff8681168b0163ffffffff16600090815260088452859020865181549488015160ff1990951692169190911770ffffffffffffffffffffffffffffffff0019166101009390941692909202929092178155918301516001928301805460609095015173ffffffffffffffffffffffffffffffffffffffff19909516600160a060020a03909216919091177bffffffffffffffff0000000000000000000000000000000000000000191660a060020a94909216939093021790915501612295565b6007805463ffffffff191661ffff891687810163ffffffff908116929092179092556040805133815260ff8c166020820152808201939093529087166060830152517ff7ad76543f114c7bb00ff2cd992ff749d502ed5c0c6f87901ad48f6871fceca1916080908290030190a15050505050505050565b600054600160a060020a031633146124ad57600080fd5b600054600160a060020a0316ff5b600054600160a060020a031681565b60035460009081908190819081908190600160a060020a03163314156126fe576124f387613fbf565b9550600160009054906101000a9004600160a060020a0316600160a060020a0316636121e5226040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561254857600080fd5b505af115801561255c573d6000803e3d6000fd5b505050506040513d602081101561257257600080fd5b505163ffffffff8716600090815260086020526040902054909550600c60ff909116108015906125bd575063ffffffff8616600090815260086020526040902054601460ff90911611155b156125c9576002850294505b84891015612647576040805160e560020a62461bcd02815260206004820152603860248201527f696e737566666963696e657420616d6f756e74206f6620746f6b656e7320746f60448201527f2074656c65706f72742074686973206368617261637465720000000000000000606482015290519081900360840190fd5b600354604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a038d8116600483015230602483015260448201899052915191909216916323b872dd9160648083019260209291908290030181600087803b1580156126bc57600080fd5b505af11580156126d0573d6000803e3d6000fd5b505050506040513d60208110156126e657600080fd5b505115156126f057fe5b6126f986613fc6565b612c30565b600254600160a060020a0316331415612bba5761271a87613fbf565b63ffffffff8116600090815260086020908152604080832054600154825160e060020a635e383d2102815260ff909216600483018190529251959b50919850600160a060020a0390911693635e383d2193602480840194938390030190829087803b15801561278857600080fd5b505af115801561279c573d6000803e3d6000fd5b505050506040513d60208110156127b257600080fd5b505163ffffffff871660009081526008602052604090205461010090046001608060020a0390811691161461287d576040805160e560020a62461bcd02815260206004820152605c60248201527f70726f74656374696f6e20636f756c6420626520626f75676874206f6e6c792060448201527f6265666f72652074686520666972737420666967687420616e64206265666f7260648201527f652074686520666972737420766f6c63616e6f206572757074696f6e00000000608482015290519081900360a40190fd5b600b60ff85161115806128a35750601560ff8516108015906128a35750601a60ff851611155b1561294057600160009054906101000a9004600160a060020a0316600160a060020a03166319f353bb6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156128fb57600080fd5b505af115801561290f573d6000803e3d6000fd5b505050506040513d602081101561292557600080fd5b5051600660ff86160660010160ff1602925060039150612ab2565b600c60ff8516108015906129585750600e60ff851611155b156129fb57600160009054906101000a9004600160a060020a0316600160a060020a03166319f353bb6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156129b057600080fd5b505af11580156129c4573d6000803e3d6000fd5b505050506040513d60208110156129da57600080fd5b505160066003860160ff160660010160ff1602600202925060069150612ab2565b600f60ff851610801590612a135750601460ff851611155b15612ab257600160009054906101000a9004600160a060020a0316600160a060020a03166319f353bb6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612a6b57600080fd5b505af1158015612a7f573d6000803e3d6000fd5b505050506040513d6020811015612a9557600080fd5b505160066003860160ff160660010160ff16026002029250600391505b5063ffffffff851660009081526010602052604081205490945060ff165b8160ff168160ff16108015612aef57508060010160ff16830285018910155b15612b075760010160ff811683029490940193612ad0565b600254604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a038d8116600483015230602483015260448201899052915191909216916323b872dd9160648083019260209291908290030181600087803b158015612b7c57600080fd5b505af1158015612b90573d6000803e3d6000fd5b505050506040513d6020811015612ba657600080fd5b50511515612bb057fe5b6126f98682614178565b6040805160e560020a62461bcd02815260206004820152603160248201527f53686f756c64206265206569746865722066726f6d204e65766572646965206f60448201527f722054656c65706f727420746f6b656e73000000000000000000000000000000606482015290519081900360840190fd5b50505050505050505050565b6000806000606060006060600080600080600160009054906101000a9004600160a060020a0316600160a060020a03166399bd59ee6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015612ca057600080fd5b505af1158015612cb4573d6000803e3d6000fd5b505050506040513d6020811015612cca57600080fd5b5051600d5401421015612d4d576040805160e560020a62461bcd02815260206004820152603e60248201527f6e6f7420656e6f7567682074696d65207061737365642073696e63652074686560448201527f206c61737420636173746c65206c6f6f7420646973747269627574696f6e0000606482015290519081900360840190fd5b42600d819055506033612d5f4261379b565b811515612d6857fe5b06995060058a6001608060020a03161015612d8257600599505b6007546064906001608060020a0364010000000090910481168c021660408051600680825260e08201909252929091049a506020820160c08038833901905050600a546040805161ffff9092168083526020808202840101909152919850908015612df7578160200160208202803883390190505b509450600092505b60065460ff8416101561306a576008600060068560ff16815481101515612e2257fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff16935060158410801590612e6f5750601a60ff851611155b8015612f725750600154604080517fafb7e4950000000000000000000000000000000000000000000000000000000081529051600792600160a060020a03169163afb7e4959160048083019260209291908290030181600087803b158015612ed657600080fd5b505af1158015612eea573d6000803e3d6000fd5b505050506040513d6020811015612f0057600080fd5b50516006805460089160009160ff8916908110612f1957fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190206001015460a060020a900467ffffffffffffffff908116420316811515612f6e57fe5b0410155b1561305f576001546040805160e060020a635e383d2102815260ff871660048201529051600160a060020a0390921691635e383d21916024808201926020929091908290030181600087803b158015612fca57600080fd5b505af1158015612fde573d6000803e3d6000fd5b505050506040513d6020811015612ff457600080fd5b505160068054999091019860ff851690811061300c57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff16858761ffff1681518110151561304457fe5b63ffffffff9092166020928302909101909101526001909501945b600190920191612dff565b6000886001608060020a031611156132b357600091505b600660ff8316101561315f576001546040805160e060020a635e383d2102815260ff6015860116600482015290516001608060020a038b1692600160a060020a031691635e383d219160248083019260209291908290030181600087803b1580156130eb57600080fd5b505af11580156130ff573d6000803e3d6000fd5b505050506040513d602081101561311557600080fd5b50518a026001608060020a031681151561312b57fe5b04878360ff1681518110151561313d57fe5b6001608060020a03909216602092830290910190910152600190910190613081565b5060005b8561ffff168161ffff16101561323d5786601560086000888561ffff1681518110151561318c57fe5b602090810290910181015163ffffffff16825281019190915260400160002054825160ff91821692909203169081106131c157fe5b9060200190602002015160086000878461ffff168151811015156131e157fe5b602090810290910181015163ffffffff16825281019190915260400160002080546001608060020a0361010080830482169094011690920270ffffffffffffffffffffffffffffffff0019909216919091179055600101613163565b600780546001608060020a0364010000000080830482168d900382160273ffffffffffffffffffffffffffffffff00000000199092169190911790915560408051918b168252517f2359110bd6bbc405457edff9ea27ed0310d86730da626b57da3ba05cae1ce22d9181900360200190a1612c30565b604080516000815290517f2359110bd6bbc405457edff9ea27ed0310d86730da626b57da3ba05cae1ce22d9181900360200190a150505050505050505050565b6000600660ff84161080159061330d5750600b60ff841611155b156133205750600560ff821611156133e0565b600f60ff8416108015906133385750601460ff841611155b1561335957600c60ff831610806133525750600e60ff8316115b90506133e0565b600060ff8416108015906133715750600560ff841611155b156133845750600f60ff821610156133e0565b601560ff84161080159061339c5750601a60ff841611155b156133dc57600c60ff8316108015906133b95750600e60ff831611155b806133525750600660ff831610801590613352575050600b60ff821611156133e0565b5060005b92915050565b600c5481565b600a5461ffff1681565b600054600160a060020a0316331461340d57600080fd5b600160a060020a038116151561342257600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a031633146134a157600080fd5b80600160a060020a0316ff5b60001960005b600a5461ffff90811690821610156135a8578163ffffffff1660068261ffff168154811015156134df57fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff161080156135605750600560ff166008600060068461ffff1681548110151561352757fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff1611155b156135a0576006805461ffff831690811061357757fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1691505b6001016134b3565b506007805463ffffffff90921660a060020a0277ffffffff000000000000000000000000000000000000000019909216919091179055565b600060068361ffff168154811015156135f557fe5b6000918252602080832060088084049091015460079384166004026101000a900463ffffffff90811680865291835260408086205460ff168652600b90935291909320805461ffff19811661ffff91821660001901909116179055905491925060a060020a90910416811415613687576007805477ffffffff0000000000000000000000000000000000000000191690555b63ffffffff81166000908152600860205260409020805470ffffffffffffffffffffffffffffffffff1916815560010180547fffffffff000000000000000000000000000000000000000000000000000000001690556006805461ffff84169081106136ef57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1660068461ffff1681548110151561372857fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff16021790555060068261ffff1681548110151561376e57fe5b90600052602060002090600891828204019190066004026101000a81549063ffffffff0219169055505050565b600a546040805160001943014081524260208201527e0100000000000000000000000000000000000000000000000000000000000061ffff90931692909202828201526042820183905251908190036062019020919050565b600080600060068661ffff1681548110151561380c57fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff16915060019050600f60ff85161080159061384e5750601460ff851611155b15613857575060025b63ffffffff821660009081526010602052604090205460ff8083169116106138a95763ffffffff82166000908152601060205260408120805460ff8082168590031660ff199091161790559250613915565b6008600060068861ffff168154811015156138c057fe5b60009182526020808320600883040154600790921660040261010090810a90920463ffffffff16845283019390935260409091019020546000199690960195046001608060020a0316925061391586866135e0565b50509392505050565b60008060006060600080600080600760149054906101000a900463ffffffff1663ffffffff1660001415613954576139546134ad565b60075460a060020a900463ffffffff908116146139d05760075460a060020a900463ffffffff166000908152600860205260409020805470ffffffffffffffffffffffffffffffff00198116600a6001608060020a038d81169190910461010093849004821681019091169092021790915560090297506139d4565b8897505b60408051601a8082526103608201909252909650866020820161034080388339019050509450600093505b8560ff168460ff161015613ad757600c60ff85161080613a225750600e60ff8516115b8015613a42575060ff84166000908152600b602052604081205461ffff16115b15613acc576001546040805160e060020a635e383d2102815260ff871660048201529051600160a060020a0390921691635e383d21916024808201926020929091908290030181600087803b158015613a9a57600080fd5b505af1158015613aae573d6000803e3d6000fd5b505050506040513d6020811015613ac457600080fd5b505196909601955b6001909301926139ff565b600092505b8560ff168360ff161015613c2057600c60ff85161080613aff5750600e60ff8516115b8015613b1f575060ff83166000908152600b602052604081205461ffff16115b15613c155760ff83166000818152600b6020908152604080832054600154825160e060020a635e383d210281526004810196909652915161ffff909116946001608060020a038d1694600160a060020a0390931693635e383d219360248084019492938390030190829087803b158015613b9857600080fd5b505af1158015613bac573d6000803e3d6000fd5b505050506040513d6020811015613bc257600080fd5b50518a026001608060020a0316811515613bd857fe5b046001608060020a0316811515613beb57fe5b04858460ff16815181101515613bfd57fe5b6001608060020a039092166020928302909101909101525b600190920191613adc565b5060005b600a5461ffff9081169082161015613d8d576008600060068361ffff16815481101515613c4d57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff169150600c821080613c975750600e60ff8316115b15613d8557846008600060068461ffff16815481101515613cb457fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168352820192909252604001902054815160ff909116908110613cf757fe5b906020019060200201516008600060068461ffff16815481101515613d1857fe5b60009182526020808320600883040154600790921660040261010090810a90920463ffffffff16845283019390935260409091019020805470ffffffffffffffffffffffffffffffff00198116908390046001608060020a03908116949094019093169091029190911790555b600101613c24565b505050505050505050565b600a5460009081908190819061ffff16613db18761379b565b811515613dba57fe5b600a549190069350600761ffff918216061615613dd8576007613df4565b600a54600b61ffff918216061615613df157600b613df4565b600d5b60ff1691508290505b613e53856008600060068561ffff16815481101515613e1857fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff166132f3565b8015613ebd575033600160a060020a03166008600060068461ffff16815481101515613e7b57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168352820192909252604001902060010154600160a060020a031614155b15613eca57809350613efd565b600a5461ffff9081169082840116811515613ee157fe5b06905061ffff80821690841614613ef757613dfd565b60001993505b50505092915050565b60065461ffff82161015613f60578160068261ffff16815481101515613f2857fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff160217905550613fbb565b600680546001810182556000919091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f6008820401805460079092166004026101000a63ffffffff81810219909316928516029190911790555b5050565b5060a05190565b63ffffffff811660009081526009602052604081205460ff1615614034576040805160e560020a62461bcd02815260206004820152601260248201527f616c72656164792074656c65706f727465640000000000000000000000000000604482015290519081900360640190fd5b5063ffffffff81166000908152600960209081526040808320805460ff19166001179055600890915290208054600560ff91909116116140e3576040805160e560020a62461bcd028152602060048201526024808201527f647261676f6e7320646f206e6f74206e65656420746f2062652074656c65706f60448201527f7274656400000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600a546140f590839061ffff16613f06565b600a805461ffff8082166001908101821661ffff1993841617909355835460ff166000908152600b6020908152604091829020805480851690960190931694909316939093179055815163ffffffff8516815291517f663f46f5a2fd740de613966ad0391fbc9d840f82898698e6d7f16ba0ed126b3b9281900390910190a15050565b63ffffffff8216600081815260106020908152604091829020805460ff191660ff861690811790915582519384529083015280517f088ba7785fd329abbf01eaa732bad30e14b205b9fc8ab9378f9f5295731135559281900390910190a15050565b61014060405190810160405280600a9060208202803883395091929150505600a165627a7a7230582044b53d6e525432c44218db7b1ff30b5a7f04d44eb081c398e776412ef09a05560029

   Swarm Source:
bzzr://44b53d6e525432c44218db7b1ff30b5a7f04d44eb081c398e776412ef09a0556

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward