Contract Overview
Balance: 10.706933789909771923 Ether
Transactions: 673 txns
 Latest 25 transactions from a total of 673 transactions

TxHash Age From To Value [TxFee]
0xbff36094047844f690890e6b3a7623dff95b8499ec59b9391c2b2f81affcb902196 days 20 hrs ago0xccc78eb3c711222549379f68267de28cb670987c  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.02 Ether0.00608172
0x0e2fc0fe6494c74572d7f15d5cecbbfd4a3bc8c548a5649ba9c60f482f1c606e196 days 20 hrs ago0xccc78eb3c711222549379f68267de28cb670987c  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.0050499
0x733c5858527ad993890d103315c7ae43b9da97d7048f9bb822274fb42b36d656198 days 5 hrs ago0x5beb6978e9015d984c190b4b724bf88b7769a8e9  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether0.000618928
0xd75ee37c7e3e7a9c93b45e95c386b54a0986d916904a0dd044953f9bac2651d0198 days 5 hrs ago0x600b9f98116c8047befd3759bec81ffb4525a98c  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether0.000256304
0xa5d8c99b8d12e8cefe3603edabc7a25db1f63444ae01cce5ce2359575f5db9a1198 days 5 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.00404592
0xc154e0583092896b8caa4e67613aca8d9b7cd9db7ff4e96f70e23d169d927588198 days 5 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.00033666
0xb6bae09519d539572bf5085631c663d7e5def27883ecd03c15e6bed6b2094aa9198 days 6 hrs ago0x600b9f98116c8047befd3759bec81ffb4525a98c  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether0.000205712
0x8537585f78247a5e9467aa555361142f69e5f7e900b174b188dfe64c766893eb198 days 6 hrs ago0x5beb6978e9015d984c190b4b724bf88b7769a8e9  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.04 Ether0.0005583808
0x5296cde5b29aeea8520a74d15b1bb5ca982f121cdde9a9f35e00dd9fad279b00198 days 6 hrs ago0x5beb6978e9015d984c190b4b724bf88b7769a8e9  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether0.0001869184
0x821877c5b536525f85627b489cb75ed0e64013ea3843f026281d57dcf3a0564f198 days 6 hrs ago0x5beb6978e9015d984c190b4b724bf88b7769a8e9  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.000269328
0x13383f8d7d3235d506128d5ead694306e3444e9a6e6b569652b82576b2dcae54198 days 6 hrs ago0x600b9f98116c8047befd3759bec81ffb4525a98c  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.000269328
0x44b4984f294ced8685be089663bf6d69b5547a89b80d9c1d780f3df5eccb81a6198 days 6 hrs ago0x600b9f98116c8047befd3759bec81ffb4525a98c  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.0003715136
0x9f873b407a8aa8c735596dcb4b8c6362c785e4326b399a8c795e6cbf68e41f71204 days 11 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether0.00030165168
0x4ac4e9d62cda7413b2afa6dfdf7e5dae0a72035308cf2d69ad02ed1b3904425e204 days 11 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether0.000344883
0x066f5e9b3ba412557a748207396537c29ee0f28d739169c48c511807c7200238208 days 4 hrs ago0xb5555e8d3ac5298ce201fce9295b8dd2c25fd3a2  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.02 Ether0.00202724
0xfddd8bc7a991642bcf239068fac8d06ef9152708985cbfc85a33c675765de9bc208 days 4 hrs ago0xb5555e8d3ac5298ce201fce9295b8dd2c25fd3a2  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.00202296
0xd528969b1e52c171fb1c23a786a4cd238399782d3153f7c774369b18cbfd81ff208 days 4 hrs ago0xb5555e8d3ac5298ce201fce9295b8dd2c25fd3a2  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.02 Ether0.0016863
0x16eb19ab3f47af972d3ab134f819c2cfa9e3dd68929e2dedb5d0871134bde8a4208 days 4 hrs ago0xb5555e8d3ac5298ce201fce9295b8dd2c25fd3a2  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.0016833
0x1ab72cc6f1c0275a5ebd69b11be1b3dc14b66f1ff56dac9501ac5b5014abb515208 days 7 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.00016833
0xbcc48b0b2d1a17ef54cca8a1cee5a3380bbb38f701fdf67321b8416fde529f5c210 days 10 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.00058049
0x6749dacebf30dc0174d92c190265aa1708af71b9dcec00ae1e2ecca957f61abf210 days 11 hrs ago0x16a0e0c9ee6569ac4c6713de5c3e5707bfb08edd  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.0005765436
0x0ad6aef6642440cc992a3f55fd265917d364a7a9e26cc6617fcf36a45925d714210 days 11 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.08 Ether0.001745454
0x888bb4d1f45094f802fc95365f6c5a831045081c454299a93a1d42b6d392e8d3210 days 11 hrs ago0x24def1747d6e244018ae54d475862593284bad7f  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.04 Ether0.001444398
0xa626b876973ecb740a6659f217e0d137274118d4ba51c0d5a513e954ca1c0926210 days 11 hrs ago0x16a0e0c9ee6569ac4c6713de5c3e5707bfb08edd  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.01 Ether0.0004797405
0xa47526c8f2b5e512969180c536aa39304eb292f2e8c8e515218774eb4384469b210 days 11 hrs ago0x16a0e0c9ee6569ac4c6713de5c3e5707bfb08edd  IN   0xf425c373c86bda2f7417ef6afb229bd159a58bef0.1 Ether0.0004797405
[ 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
0x733c5858527ad993890d103315c7ae43b9da97d7048f9bb822274fb42b36d6563785016198 days 5 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0x733c5858527ad993890d103315c7ae43b9da97d7048f9bb822274fb42b36d6563785016198 days 5 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0x733c5858527ad993890d103315c7ae43b9da97d7048f9bb822274fb42b36d6563785016198 days 5 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0x733c5858527ad993890d103315c7ae43b9da97d7048f9bb822274fb42b36d6563785016198 days 5 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0xd75ee37c7e3e7a9c93b45e95c386b54a0986d916904a0dd044953f9bac2651d03784973198 days 5 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0xd75ee37c7e3e7a9c93b45e95c386b54a0986d916904a0dd044953f9bac2651d03784973198 days 5 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0xd75ee37c7e3e7a9c93b45e95c386b54a0986d916904a0dd044953f9bac2651d03784973198 days 5 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0xd75ee37c7e3e7a9c93b45e95c386b54a0986d916904a0dd044953f9bac2651d03784973198 days 5 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0xb88beaad06ad58dffe37277ac0d09bf156f46c177ca7db657260296a188392093784967198 days 5 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x8a01bc6a9358388588247127ff7be21b281b36d40 Ether
0xb88beaad06ad58dffe37277ac0d09bf156f46c177ca7db657260296a188392093784967198 days 5 hrs ago0x8a01bc6a9358388588247127ff7be21b281b36d40xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether
0xb6bae09519d539572bf5085631c663d7e5def27883ecd03c15e6bed6b2094aa93784810198 days 6 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0xb6bae09519d539572bf5085631c663d7e5def27883ecd03c15e6bed6b2094aa93784810198 days 6 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0xb6bae09519d539572bf5085631c663d7e5def27883ecd03c15e6bed6b2094aa93784810198 days 6 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0xb6bae09519d539572bf5085631c663d7e5def27883ecd03c15e6bed6b2094aa93784810198 days 6 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0x1989d5515116c2a8739fe0ac5b846dd3211a77ca78b3ad344e00fd05a1df17dd3784799198 days 6 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0xee7acd6b0fb65eebc11cf733fdc606619cf633d40 Ether
0x1989d5515116c2a8739fe0ac5b846dd3211a77ca78b3ad344e00fd05a1df17dd3784799198 days 6 hrs ago0xee7acd6b0fb65eebc11cf733fdc606619cf633d40xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether
0x0f5e2057c1aec6971a2b9ffcdad3656728b1f8eb9629aa27f19dfea36f280a853784797198 days 6 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x8a01bc6a9358388588247127ff7be21b281b36d40 Ether
0x0f5e2057c1aec6971a2b9ffcdad3656728b1f8eb9629aa27f19dfea36f280a853784797198 days 6 hrs ago0x8a01bc6a9358388588247127ff7be21b281b36d40xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether
0x0d3625e2a2812c68ac0e4c877ce9316739cb42f9773dea75fe442a9b4a8ad60a3784791198 days 6 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x8a01bc6a9358388588247127ff7be21b281b36d40 Ether
0x0d3625e2a2812c68ac0e4c877ce9316739cb42f9773dea75fe442a9b4a8ad60a3784791198 days 6 hrs ago0x8a01bc6a9358388588247127ff7be21b281b36d40xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether
0x5296cde5b29aeea8520a74d15b1bb5ca982f121cdde9a9f35e00dd9fad279b003784783198 days 6 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x5beb6978e9015d984c190b4b724bf88b7769a8e90.062664830240384614 Ether
0x60c58e35e7b6a129d3811843d0d084ceb40c9f0a83c206975f6e27637b6e3b463784781198 days 6 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0xee7acd6b0fb65eebc11cf733fdc606619cf633d40 Ether
0x60c58e35e7b6a129d3811843d0d084ceb40c9f0a83c206975f6e27637b6e3b463784781198 days 6 hrs ago0xee7acd6b0fb65eebc11cf733fdc606619cf633d40xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether
0xb3bd38929b93d67a23940c3dd7c49c418ef41425f6872c959039b864229b77ca3707461210 days 11 hrs ago0xf425c373c86bda2f7417ef6afb229bd159a58bef0x8a01bc6a9358388588247127ff7be21b281b36d40 Ether
0xb3bd38929b93d67a23940c3dd7c49c418ef41425f6872c959039b864229b77ca3707461210 days 11 hrs ago0x8a01bc6a9358388588247127ff7be21b281b36d40xf425c373c86bda2f7417ef6afb229bd159a58bef0 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: DragonKing
Compiler Version: v0.4.21+commit.dfe3193c
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.17;

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

}

contract mortal is Ownable {
	address owner;

	function mortal() {
		owner = msg.sender;
	}

	function kill() internal {
		suicide(owner);
	}
}

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

contract DragonKing is mortal {

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

	/** array holding ids of the curret characters*/
	uint32[] public ids;
	/** the id to be given to the next character **/
	uint32 public nextId;
	/** 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;
	/** 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 number of dragon types **/
	uint8 constant public numDragonTypes = 6;
	/* the number of balloons types */
	uint8 constant public numOfBalloonsTypes = 3;
	/** constant used to signal that there is no King at the moment **/
	uint32 constant public noKing = ~uint32(0);

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


	/** the amount of time that should pass since last eruption **/
	uint public eruptionThreshold;
	/** timestampt of the last eruption event **/
	uint256 public lastEruptionTimestamp;
	/** how many characters to kill in %, e.g. 20 will stand for 20%, should be < 100 **/
	uint8 public percentageToKill;

	/** knight cooldown. contains the timestamp of the earliest possible moment to start a fight */
	mapping(uint32 => uint) public cooldown;
	uint256 public constant CooldownThreshold = 1 days;
	/** fight factor, used to compute extra probability in fight **/
	uint8 public fightFactor;

	/** the teleport token contract used to send knights to the game scene */
	Token public teleportToken;
	/** the price for teleportation*/
	uint public teleportPrice;
	/** the neverdue token contract used to purchase protection from eruptions and fights */
	Token public neverdieToken;
	/** the price for protection */
	uint public protectionPrice;
	/** tells the number of times a character is protected */
	mapping(uint32 => uint8) public protection;

	/** the SKL token contract **/
	Token public sklToken;
	/** the XP token contract **/
	Token public xperToken;

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

	/** initializes the contract parameters	 */
	function DragonKing(address teleportTokenAddress,
											address neverdieTokenAddress,
											address sklTokenAddress,
											address xperTokenAddress,
											uint8 eruptionThresholdInHours,
											uint8 percentageOfCharactersToKill,
											uint8 characterFee,
											uint16[] charactersCosts,
											uint16[] balloonsCosts) public onlyOwner {
		fee = characterFee;
		for (uint8 i = 0; i < charactersCosts.length * 2; i++) {
			costs.push(uint128(charactersCosts[i % numDragonTypes]) * 1 finney);
			values.push(costs[i] - costs[i] / 100 * fee);
		}
		uint256 balloonsIndex = charactersCosts.length * 2;
		for (uint8 j = 0; j < balloonsCosts.length; j++) {
			costs.push(uint128(balloonsCosts[j]) * 1 finney);
			values.push(costs[balloonsIndex + j] - costs[balloonsIndex + j] / 100 * fee);
		}
		eruptionThreshold = uint256(eruptionThresholdInHours) * 60 * 60; // convert to seconds
		percentageToKill = percentageOfCharactersToKill;
		maxCharacters = 600;
		nextId = 1;
		teleportToken = Token(teleportTokenAddress);
		teleportPrice = 1000000000000000000;
		neverdieToken = Token(neverdieTokenAddress);
		protectionPrice = 1000000000000000000;
		fightFactor = 4;
		sklToken = Token(sklTokenAddress);
		xperToken = Token(xperTokenAddress);
	}

	/**
	 * 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 {
		require(tx.origin == msg.sender);
		uint16 amount = uint16(msg.value / costs[characterType]);
		uint16 nchars = numCharacters;
		if (characterType >= costs.length || msg.value < costs[characterType] || nchars + amount > maxCharacters) revert();
		uint32 nid = nextId;
		//if type exists, enough ether was transferred and there are less than maxCharacters characters in the game
		if (characterType < numDragonTypes) {
			//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, values[characterType], msg.sender, uint64(now));
			}
			numCharactersXType[characterType] += amount;
			numCharacters += amount;
		}
		else {
			// to enter game knights should be teleported later
			for (uint8 j = 0; j < amount; j++) {
				characters[nid + j] = Character(characterType, values[characterType], msg.sender, uint64(now));
			}
		}
		nextId = nid + amount;
		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);
	}

	/**
	 * leave the game.
	 * pays out the sender's balance and removes him and his characters from the game
	 * */
	function exit() public {
		uint32[] memory removed = new uint32[](50);
		uint8 count;
		uint32 lastId;
		uint playerBalance;
		uint16 nchars = numCharacters;
		for (uint16 i = 0; i < nchars; i++) {
			if (characters[ids[i]].owner == msg.sender 
					&& characters[ids[i]].purchaseTimestamp + 1 days < now
					&& characters[ids[i]].characterType < 2*numDragonTypes) {
				//first delete all characters at the end of the array
				while (nchars > 0 
						&& characters[ids[nchars - 1]].owner == msg.sender 
						&& characters[ids[nchars - 1]].purchaseTimestamp + 1 days < now
						&& characters[ids[nchars - 1]].characterType < 2*numDragonTypes) {
					nchars--;
					lastId = ids[nchars];
					numCharactersXType[characters[lastId].characterType]--;
					playerBalance += characters[lastId].value;
					removed[count] = lastId;
					count++;
					if (lastId == oldest) oldest = 0;
					delete characters[lastId];
				}
				//replace the players character by the last one
				if (nchars > i + 1) {
					playerBalance += characters[ids[i]].value;
					removed[count] = ids[i];
					count++;
					nchars--;
					replaceCharacter(i, nchars);
				}
			}
		}
		numCharacters = nchars;
		NewExit(msg.sender, playerBalance, removed); //fire the event to notify the client
		msg.sender.transfer(playerBalance);
		if (oldest == 0)
			findOldest();
	}

	/**
	 * 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(tx.origin == msg.sender);
		require(now >= lastEruptionTimestamp + eruptionThreshold);
		require(numCharacters>0);
		lastEruptionTimestamp = now;
		uint128 pot;
		uint128 value;
		uint16 random;
		uint32 nextHitId;
		uint16 nchars = numCharacters;
		uint32 howmany = nchars * percentageToKill / 100;
		uint128 neededGas = 80000 + 10000 * uint32(nchars);
		if(howmany == 0) howmany = 1;//hit at least 1
		uint32[] memory hitCharacters = new uint32[](howmany);
		for (uint8 i = 0; i < howmany; i++) {
			random = uint16(generateRandomNumber(lastEruptionTimestamp + i) % nchars);
			nextHitId = ids[random];
			hitCharacters[i] = nextHitId;
			value = hitCharacter(random, nchars);
			if (value > 0) {
				nchars--;
			}
			pot += value;
		}
		uint128 gasCost = uint128(neededGas * tx.gasprice);
		numCharacters = nchars;
		if (pot > gasCost){
			distribute(pot - gasCost); //distribute the pot minus the oraclize gas costs
			NewEruption(hitCharacters, pot - gasCost, gasCost);
		}
		else
			NewEruption(hitCharacters, 0, gasCost);
	}

	/**
	 * A knight may attack a dragon, but not choose which one.
	 * The value of the loser is transfered to the winner.
	 * @param knightID the ID of the knight to perfrom the attack
	 * @param knightIndex 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 knightID, uint16 knightIndex) public {
		require(tx.origin == msg.sender);
		if (knightID != ids[knightIndex])
			knightIndex = getCharacterIndex(knightID);
		Character storage knight = characters[knightID];
		require(cooldown[knightID] + CooldownThreshold <= now);
		require(knight.owner == msg.sender);
		require(knight.characterType < 2*numDragonTypes); // knight is not a balloon
		require(knight.characterType >= numDragonTypes);
		uint16 dragonIndex = getRandomDragon(knightID);
		assert(dragonIndex < maxCharacters);
		uint32 dragonID = ids[dragonIndex];
		Character storage dragon = characters[dragonID];
		uint128 value;
		uint16 base_probability;
		uint16 dice = uint16(generateRandomNumber(knightID) % 100);
		uint256 knightPower = sklToken.balanceOf(knight.owner) / 10**15 + xperToken.balanceOf(knight.owner);
		uint256 dragonPower = sklToken.balanceOf(dragon.owner) / 10**15 + xperToken.balanceOf(dragon.owner);
		if (knight.value == dragon.value) {
				base_probability = 50;
			if (knightPower > dragonPower) {
				base_probability += uint16(100 / fightFactor);
			} else if (dragonPower > knightPower) {
				base_probability -= uint16(100 / fightFactor);
			}
		} else if (knight.value > dragon.value) {
			base_probability = 100;
			if (dragonPower > knightPower) {
				base_probability -= uint16((100 * dragon.value) / knight.value / fightFactor);
			}
		} else if (knightPower > dragonPower) {
				base_probability += uint16((100 * knight.value) / dragon.value / fightFactor);
		}
  
		cooldown[knightID] = now;
		if (dice >= base_probability) {
			// dragon won
			value = hitCharacter(knightIndex, numCharacters);
			if (value > 0) {
				numCharacters--;
			}
			dragon.value += value;
			NewFight(dragonID, knightID, value, base_probability, dice);
		} else {
			// knight won
			value = hitCharacter(dragonIndex, numCharacters);
			if (value > 0) {
				numCharacters--;
			}
			knight.value += value;
			if (oldest == 0) findOldest();
			NewFight(knightID, dragonID, value, base_probability, dice);
		}
	}

	/**
	 * pick a random dragon.
	 * @param nonce a nonce to make sure there's not always the same dragon chosen in a single block.
	 * @return the index of a random dragon
	 * */
	function getRandomDragon(uint256 nonce) 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 (characters[ids[i]].characterType < numDragonTypes && characters[ids[i]].owner != msg.sender) return i;
			i = (i + stepSize) % numCharacters;
		} while (i != randomIndex);
		return maxCharacters + 1; //there is none
	}

	/**
	 * 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.
	 * @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) internal returns(uint128 characterValue) {
		uint32 id = ids[index];
		if (protection[id] > 0) {
			protection[id]--;
			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 < numDragonTypes)
				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 = 2 * numDragonTypes;
		uint128[] memory shares = new uint128[](size);
		for (uint8 v = 0; v < size; v++) {
			if (numCharactersXType[v] > 0) valueSum += values[v];
		}
		for (uint8 m = 0; m < size; m++) {
			if (numCharactersXType[m] > 0)
				shares[m] = amount * values[m] / valueSum / numCharactersXType[m];
		}
		uint8 cType;
		for (uint16 i = 0; i < numCharacters; i++) {
			cType = characters[ids[i]].characterType;
			if(cType < size)
				characters[ids[i]].value += shares[characters[ids[i]].characterType];
		}
	}

	/**
	 * allows the owner to collect the accumulated fees
	 * sends the given amount to the owner's address if the amount does not exceed the
	 * fees (cannot touch the players' balances) minus 100 finney (ensure that oraclize fees can be paid)
	 * @param amount the amount to be collected
	 * */
	function collectFees(uint128 amount) public onlyOwner {
		uint collectedFees = getFees();
		if (amount + 100 finney < collectedFees) {
			owner.transfer(amount);
		}
	}

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

	/**
	 * pays out the players.
	 * */
	function payOut() public onlyOwner {
		for (uint16 i = 0; i < numCharacters; i++) {
			characters[ids[i]].owner.transfer(characters[ids[i]].value);
			delete characters[ids[i]];
		}
		delete ids;
		numCharacters = 0;
	}

	/**
	 * pays out the players and kills the game.
	 * */
	function stop() public onlyOwner {
		withdraw();
		payOut();
		kill();
	}

	/**
	 * 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(tx.origin == msg.sender);
		require(msg.sender == characters[characterId].owner);
		require(characters[characterId].characterType < 2*numDragonTypes);
		require(characters[characterId].purchaseTimestamp + 1 days < now);
		uint128 val = characters[characterId].value;
		numCharacters--;
		replaceCharacter(getCharacterIndex(characterId), numCharacters);
		msg.sender.transfer(val);
		if (oldest == 0)
			findOldest();
		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 = teleportPrice * (characters[id].characterType/numDragonTypes);//double price in case of balloon
			require(value >= price);
			assert(teleportToken.transferFrom(sender, this, price));
			teleportKnight(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 == values[cType]);

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

			uint256 lifePrice;
			uint8 max;
			if(cType < 2 * numDragonTypes){
				lifePrice = ((cType % numDragonTypes) + 1) * protectionPrice;
				max = 3;
			}
			else {
				lifePrice = (((cType+3) % numDragonTypes) + 1) * protectionPrice * 2;
				max = 6;
			}

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

	/**
	 * knights are only entering the game completely, when they are teleported to the scene
	 * @param id the character id
	 * */
	function teleportKnight(uint32 id) internal {
		// ensure we do not teleport twice
		require(teleported[id] == false);
		teleported[id] = true;
		Character storage knight = characters[id];
		require(knight.characterType >= numDragonTypes); //this also makes calls with non-existent ids fail
		addCharacter(id, numCharacters);
		numCharacters++;
		numCharactersXType[knight.characterType]++;
		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;
		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) constant public 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) constant 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) constant 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++;
		}

	}

	/**
	 * returns the number of dragons in the game
	 * @return the number of dragons
	 * */
	function getNumDragons() constant public returns(uint16 numDragons) {
		for (uint8 i = 0; i < numDragonTypes; i++)
			numDragons += numCharactersXType[i];
	}

	/**
	 * returns the number of knights in the game
	 * @return the number of knights
	 * */
	function getNumKnights() constant public returns(uint16 numKnights) {
		for (uint8 i = numDragonTypes; i < 2 * numDragonTypes; i++)
			numKnights += numCharactersXType[i];
	}

	/**
	 * @return the accumulated fees
	 * */
	function getFees() constant public returns(uint) {
		uint reserved = 0;
		for (uint16 j = 0; j < numCharacters; j++)
			reserved += characters[ids[j]].value;
		return address(this).balance - reserved;
	}


	/****************** SETTERS *************************/

    /**
	 * REMOVE FOR TESTING ONLY
	 * 
	 * */
	function setPurchaseTimestamp(uint32 characterId, uint64 ts) public  {
		characters[characterId].purchaseTimestamp = ts;
	}
	
	/**
	 * sets the prices of the character types
	 * @param prices the prices in finney
	 * */
	function setPrices(uint16[] prices) public onlyOwner {
		for (uint8 i = 0; i < prices.length; i++) {
			costs[i] = uint128(prices[i]) * 1 finney;
			values[i] = costs[i] - costs[i] / 100 * fee;
		}
	}

	/**
	 * sets the fight factor
	 * @param _factor the new fight factor
	 * */
	function setFightFactor(uint8 _factor) public onlyOwner {
		fightFactor = _factor;
	}

	/**
	 * sets the fee to charge on each purchase
	 * @param _fee the new fee
	 * */
	function setFee(uint8 _fee) public onlyOwner {
		fee = _fee;
	}

	/**
	 * sets the maximum number of characters allowed in the game
	 * @param number the new maximum
	 * */
	function setMaxCharacters(uint16 number) public onlyOwner {
		maxCharacters = number;
	}

	/**
	 * sets the teleport price
	 * @param price the price in tokens
	 * */
	function setTeleportPrice(uint price) public onlyOwner {
		teleportPrice = price;
	}

	/**
	 * sets the protection price
	 * @param price the price in tokens
	 * */
	function setProtectionPrice(uint price) public onlyOwner {
		protectionPrice = price;
	}

	/**
	 * sets the eruption threshold
	 * @param et the new eruption threshold in seconds
	 * */
	function setEruptionThreshold(uint et) public onlyOwner {
		eruptionThreshold = et;
	}

  function setPercentageToKill(uint8 percentage) public onlyOwner {
    percentageToKill = percentage;
  }

	/************* 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(0x80)
		}
		return uint32(newB);
	}

}

    Contract ABI  
[{"constant":false,"inputs":[],"name":"stop","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"characterId","type":"uint32"}],"name":"sellCharacter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"percentageToKill","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"protectionPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"triggerVolcanoEruption","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"xperToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint128"}],"name":"collectFees","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint8"}],"name":"numCharactersXType","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"characterId","type":"uint32"},{"name":"ts","type":"uint64"}],"name":"setPurchaseTimestamp","outputs":[],"payable":false,"stateMutability":"nonpayable","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":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"price","type":"uint256"}],"name":"setTeleportPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"CooldownThreshold","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"costs","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"fightFactor","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"characterId","type":"uint32"}],"name":"getCharacterIndex","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"et","type":"uint256"}],"name":"setEruptionThreshold","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"values","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"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":"view","type":"function"},{"constant":true,"inputs":[],"name":"teleportPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nextId","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"protection","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"knightID","type":"uint32"},{"name":"knightIndex","type":"uint16"}],"name":"fight","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"prices","type":"uint16[]"}],"name":"setPrices","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"characterType","type":"uint8"}],"name":"addCharacters","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"getNumDragons","outputs":[{"name":"numDragons","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxCharacters","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"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":true,"inputs":[],"name":"teleportToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"price","type":"uint256"}],"name":"setProtectionPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"eruptionThreshold","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"cooldown","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_factor","type":"uint8"}],"name":"setFightFactor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"sklToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getNumKnights","outputs":[{"name":"numKnights","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numDragonTypes","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lastEruptionTimestamp","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"payOut","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"numOfBalloonsTypes","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint8"}],"name":"setFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"neverdieToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getFees","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"noKing","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"exit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"percentage","type":"uint8"}],"name":"setPercentageToKill","outputs":[],"payable":false,"stateMutability":"nonpayable","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":"number","type":"uint16"}],"name":"setMaxCharacters","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"ids","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"findOldest","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"teleportTokenAddress","type":"address"},{"name":"neverdieTokenAddress","type":"address"},{"name":"sklTokenAddress","type":"address"},{"name":"xperTokenAddress","type":"address"},{"name":"eruptionThresholdInHours","type":"uint8"},{"name":"percentageOfCharactersToKill","type":"uint8"},{"name":"characterFee","type":"uint8"},{"name":"charactersCosts","type":"uint16[]"},{"name":"balloonsCosts","type":"uint16[]"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"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":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060405234156200001057600080fd5b6040516200414138038062004141833981016040528080519190602001805191906020018051919060200180519190602001805191906020018051919060200180519190602001805182019190602001805160008054600160a060020a03338116600160a060020a031992831681178085556001805490941682179093559390950194919350839283929190911614620000a957600080fd5b6008805460ff191660ff8816179055600092505b84516002028360ff1610156200023d576006805460018101620000e183826200048b565b6000928352602090922060028204019060011660100287600660ff88160660ff16815181106200010d57fe5b9060200190602002015161ffff1666038d7ea4c6800002909190916101000a8154816001608060020a0302191690836001608060020a0316021790555050600780548060010182816200016191906200048b565b600092835260209092206008546006805460028504909301936001166010029260ff9283169260649291908a169081106200019857fe5b6000918252602090912060028204015460019091166010026101000a90046001608060020a0316811515620001c957fe5b040260068760ff16815481101515620001de57fe5b90600052602060002090600291828204019190066010029054906101000a90046001608060020a031603909190916101000a8154816001608060020a0302191690836001608060020a03160217905550508280600101935050620000bd565b84516002029150600090505b83518160ff161015620003c55760068054600181016200026a83826200048b565b9160005260206000209060029182820401919006601002868460ff16815181106200029157fe5b9060200190602002015161ffff1666038d7ea4c6800002909190916101000a8154816001608060020a0302191690836001608060020a031602179055505060078054806001018281620002e591906200048b565b600092835260209092206008546006805460028504909301936001166010029260ff928316926064929190881689019081106200031e57fe5b6000918252602090912060028204015460019091166010026101000a90046001608060020a03168115156200034f57fe5b040260068560ff1687018154811015156200036657fe5b90600052602060002090600291828204019190066010029054906101000a90046001608060020a031603909190916101000a8154816001608060020a0302191690836001608060020a0316021790555050808060010191505062000249565b505050610e1060ff95861602600a555050600c80549290931660ff19928316179092556008805464025800000064ffff000000199091161790556003805463ffffffff19166001179055600e8054670de0b6b3a7640000600f81905560108054600160a060020a03998a16600160a060020a0319918216179091556011919091559787166101000261010060a860020a031990911617909116600417905550601380549284169285169290921790915560148054919092169216919091179055620004eb565b815481835581811511620004c2576001016002900481600101600290048360005260206000209182019101620004c29190620004c7565b505050565b620004e891905b80821115620004e45760008155600101620004ce565b5090565b90565b613c4680620004fb6000396000f3006060604052600436106102585763ffffffff60e060020a60003504166307da68f5811461025d5780630fa6002e1461027257806311a5a7931461028e57806319f353bb146102b75780631e466eee146102dc5780632345fe81146102ef57806328acb0021461031e57806329b20bb61461033d5780632f5200811461036d5780633728bec2146103965780633c3c22b3146103eb5780633ccfd60b14610417578063453348941461042a5780634597dc8e1461044057806349b3b29f146104535780634ad6e648146104855780634f255b801461049857806350c88103146104b45780635e383d21146104ca578063603709e3146104e05780636121e522146105b757806361b8ce8c146105ca57806372ad21c7146105dd578063773e1e84146105f95780637825396b1461061c578063797e2aec1461066b578063851ad4d6146106795780638882ddc91461068c5780638da5cb5b1461069f5780638f4ffcb1146106b2578063a7f879ea1461071e578063acd782b114610731578063afb7e49514610747578063b066ef3c1461075a578063b1b7912014610776578063b2a7239d1461078f578063b32dbcd8146107a2578063bc447a6d146107b5578063c10435cc146107c8578063c2052403146107db578063c8f490c8146107ee578063cb122a0914610801578063cfedc04a1461081a578063db8d55f11461082d578063dc9bb7db14610840578063e9fad8ee14610853578063eb8fb32c14610866578063f1be42f11461087f578063f2fde38b14610892578063f5015000146108b1578063fac333ac146108cb578063fbe6529f146108e1575b600080fd5b341561026857600080fd5b6102706108f4565b005b341561027d57600080fd5b61027063ffffffff60043516610929565b341561029957600080fd5b6102a1610b00565b60405160ff909116815260200160405180910390f35b34156102c257600080fd5b6102ca610b09565b60405190815260200160405180910390f35b34156102e757600080fd5b610270610b0f565b34156102fa57600080fd5b610302610e18565b604051600160a060020a03909116815260200160405180910390f35b341561032957600080fd5b6102706001608060020a0360043516610e27565b341561034857600080fd5b61035660ff60043516610ea9565b60405161ffff909116815260200160405180910390f35b341561037857600080fd5b61027063ffffffff6004351667ffffffffffffffff60243516610ebf565b34156103a157600080fd5b6103b263ffffffff60043516610f15565b60405160ff90931683526001608060020a039091166020830152600160a060020a03166040808301919091526060909101905180910390f35b34156103f657600080fd5b6103fe610f54565b60405163ffffffff909116815260200160405180910390f35b341561042257600080fd5b610270610f68565b341561043557600080fd5b61027060043561115a565b341561044b57600080fd5b6102ca61117a565b341561045e57600080fd5b610469600435611181565b6040516001608060020a03909116815260200160405180910390f35b341561049057600080fd5b6102a16111bc565b34156104a357600080fd5b61035663ffffffff600435166111c5565b34156104bf57600080fd5b610270600435611231565b34156104d557600080fd5b610469600435611251565b34156104eb57600080fd5b6104fa61ffff6004351661125f565b604051808561014080838360005b83811015610520578082015183820152602001610508565b5050505090500184600a60200280838360005b8381101561054b578082015183820152602001610533565b5050505090500183600a60200280838360005b8381101561057657808201518382015260200161055e565b5050505090500182600a60200280838360005b838110156105a1578082015183820152602001610589565b5050505090500194505050505060405180910390f35b34156105c257600080fd5b6102ca611415565b34156105d557600080fd5b6103fe61141b565b34156105e857600080fd5b6102a163ffffffff60043516611427565b341561060457600080fd5b61027063ffffffff6004351661ffff6024351661143c565b341561062757600080fd5b6102706004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650611b2f95505050505050565b61027060ff60043516611caf565b341561068457600080fd5b6103566121a3565b341561069757600080fd5b6103566121db565b34156106aa57600080fd5b6103026121ec565b34156106bd57600080fd5b61027060048035600160a060020a0390811691602480359260443516919060849060643590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506121fb95505050505050565b341561072957600080fd5b6103026124cb565b341561073c57600080fd5b6102706004356124df565b341561075257600080fd5b6102ca6124ff565b341561076557600080fd5b6102ca63ffffffff60043516612505565b341561078157600080fd5b61027060ff60043516612517565b341561079a57600080fd5b610302612548565b34156107ad57600080fd5b610356612557565b34156107c057600080fd5b6102a161258c565b34156107d357600080fd5b6102ca612591565b34156107e657600080fd5b610270612597565b34156107f957600080fd5b6102a1612774565b341561080c57600080fd5b61027060ff60043516612779565b341561082557600080fd5b6103026127aa565b341561083857600080fd5b6102ca6127b9565b341561084b57600080fd5b6103fe61284c565b341561085e57600080fd5b610270612852565b341561087157600080fd5b61027060ff60043516612e64565b341561088a57600080fd5b610356612e95565b341561089d57600080fd5b610270600160a060020a0360043516612ea4565b34156108bc57600080fd5b61027061ffff60043516612f3f565b34156108d657600080fd5b6103fe600435612f7c565b34156108ec57600080fd5b610270612fb4565b60005433600160a060020a0390811691161461090f57600080fd5b610917610f68565b61091f612597565b6109276130dc565b565b600033600160a060020a031632600160a060020a031614151561094b57600080fd5b63ffffffff821660009081526004602052604090206001015433600160a060020a0390811691161461097c57600080fd5b63ffffffff8216600090815260046020526040902054600c60ff909116106109a357600080fd5b63ffffffff82166000908152600460205260409020600101544260a060020a90910467ffffffffffffffff908116620151800116106109e157600080fd5b5063ffffffff81166000908152600460205260409020546008805462ffff001981166101009182900461ffff908116600019011682021790915590046001608060020a0316610a43610a32836111c5565b600854610100900461ffff166130ea565b600160a060020a0333166001608060020a03821680156108fc0290604051600060405180830381858888f193505050501515610a7e57600080fd5b600354640100000000900463ffffffff161515610a9d57610a9d612fb4565b7fe5cc68f68d9672681158062a835b6abc2ff3fba89f8db70f3a227d4ac35da3c382338360405163ffffffff9093168352600160a060020a0390911660208301526001608060020a03166040808301919091526060909101905180910390a15050565b600c5460ff1681565b60115481565b6000806000806000806000610b22613b61565b60008033600160a060020a031632600160a060020a0316141515610b4557600080fd5b600a54600b5401421015610b5857600080fd5b600854600061010090910461ffff1611610b7157600080fd5b42600b55600854600c5461ffff61010090920482169750606460ff909116880282160416945063ffffffff62013880612710880201169350841515610bb557600194505b8463ffffffff16604051805910610bc95750595b90808252806020026020018201604052509250600091505b8463ffffffff168260ff161015610ca7578561ffff16610c078360ff16600b5401613291565b811515610c1057fe5b06975060028861ffff16815481101515610c2657fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff16965086838360ff1681518110610c5e57fe5b63ffffffff909216602092830290910190910152610c7c8887613302565b98506000896001608060020a03161115610c9857600019909501945b98880198600190910190610be1565b506008805461ffff87166101000262ffff00199091161790556001608060020a038084163a0290818116908b161115610d7b57610ce5818b036133fb565b7fa06ad7d0261a795ad8f33fdbef7cf65a0f9f9a825353b13358a96a750acd6b3d83828c03836040516001608060020a0380841660208301528216604082015260608082528190810185818151815260200191508051906020019060200280838360005b83811015610d61578082015183820152602001610d49565b5050505090500194505050505060405180910390a1610e0c565b7fa06ad7d0261a795ad8f33fdbef7cf65a0f9f9a825353b13358a96a750acd6b3d836000836040516001608060020a0380841660208301528216604082015260608082528190810185818151815260200191508051906020019060200280838360005b83811015610df6578082015183820152602001610dde565b5050505090500194505050505060405180910390a15b50505050505050505050565b601454600160a060020a031681565b6000805433600160a060020a03908116911614610e4357600080fd5b610e4b6127b9565b9050808267016345785d8a0000016001608060020a03161015610ea557600154600160a060020a03166001608060020a03831680156108fc0290604051600060405180830381858888f193505050501515610ea557600080fd5b5050565b60096020526000908152604090205461ffff1681565b63ffffffff9091166000908152600460205260409020600101805467ffffffffffffffff90921660a060020a027bffffffffffffffff000000000000000000000000000000000000000019909216919091179055565b63ffffffff166000908152600460205260409020805460019091015460ff8216926101009092046001608060020a031691600160a060020a0390911690565b600354640100000000900463ffffffff1681565b60008054819033600160a060020a03908116911614610f8657600080fd5b601054600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610fd657600080fd5b5af11515610fe357600080fd5b5050506040518051601054600154919450600160a060020a03908116925063a9059cbb91168460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561104c57600080fd5b5af1151561105957600080fd5b50505060405180519050151561106b57fe5b600e546101009004600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156110c057600080fd5b5af115156110cd57600080fd5b5050506040518051600e54600154919350600160a060020a036101009091048116925063a9059cbb91168360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561113b57600080fd5b5af1151561114857600080fd5b505050604051805190501515610ea557fe5b60005433600160a060020a0390811691161461117557600080fd5b600f55565b6201518081565b600680548290811061118f57fe5b9060005260206000209060029182820401919006601002915054906101000a90046001608060020a031681565b600e5460ff1681565b6000805b60025461ffff82161015610258578263ffffffff1660028261ffff168154811015156111f157fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff1614156112235780915061122b565b6001016111c9565b50919050565b60005433600160a060020a0390811691161461124c57600080fd5b600a55565b600780548290811061118f57fe5b611267613b73565b61126f613b73565b611277613b73565b61127f613b73565b600080600080600860019054906101000a900461ffff1661ffff1689600a0161ffff16116112b05788600a016112bd565b600854610100900461ffff165b61ffff169350600092508890505b8363ffffffff168161ffff16101561140a576002805461ffff83169081106112ef57fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff169150818860ff8516600a811061132557fe5b63ffffffff9283166020918202929092019190915290831660009081526004909152604090205460ff9081169088908516600a811061136057fe5b60ff9283166020918202929092019190915263ffffffff841660009081526004909152604090205461010090046001608060020a03169087908516600a81106113a557fe5b6001608060020a039092166020928302919091015263ffffffff8316600090815260049091526040902060010154600160a060020a03168560ff8516600a81106113eb57fe5b600160a060020a039092166020929092020152600192830192016112cb565b505050509193509193565b600f5481565b60035463ffffffff1681565b60126020526000908152604090205460ff1681565b600080600080600080600080600033600160a060020a031632600160a060020a031614151561146a57600080fd5b6002805461ffff8c1690811061147c57fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff908116908c16146114b6576114b38b6111c5565b99505b63ffffffff8b166000908152600460209081526040808320600d90925290912054909950426201518090910111156114ed57600080fd5b600189015433600160a060020a0390811691161461150a57600080fd5b8854600c60ff9091161061151d57600080fd5b8854600660ff909116101561153157600080fd5b6115408b63ffffffff166137a3565b60085490985061ffff630100000090910481169089161061155d57fe5b6002805461ffff8a1690811061156f57fe5b6000918252602080832060088304015463ffffffff6004600790941684026101000a909104811680855292909152604090922090985096506064906115b5908d16613291565b8115156115be57fe5b60145460018c0154929091069450600160a060020a03908116916370a08231911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561161d57600080fd5b5af1151561162a57600080fd5b505050604051805160135460018c015491925066038d7ea4c6800091600160a060020a03918216916370a08231911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561169757600080fd5b5af115156116a457600080fd5b505050604051805190508115156116b757fe5b60145460018a015492909104929092019350600160a060020a03918216916370a08231911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561171a57600080fd5b5af1151561172757600080fd5b5050506040518051601354600189015491925066038d7ea4c6800091600160a060020a03918216916370a08231911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561179457600080fd5b5af115156117a157600080fd5b505050604051805190508115156117b457fe5b88548c5492909104929092019250610100918290046001608060020a039081169290910416141561183057603293508082111561180957600e5460ff1660648115156117fc57fe5b0460ff168401935061182b565b8181111561182b57600e5460ff16606481151561182257fe5b0460ff16840393505b6118fe565b855489546001608060020a03610100928390048116929091041611156118ab57606493508181111561182b57600e548954875460ff90921691610100918290046001608060020a039081169290910481166064021681151561188e57fe5b046001608060020a03168115156118a157fe5b04840393506118fe565b808211156118fe57600e5486548a5460ff90921691610100918290046001608060020a03908116929091048116606402168115156118e557fe5b046001608060020a03168115156118f857fe5b04840193505b63ffffffff8b166000908152600d6020526040902042905561ffff80851690841610611a155760085461193b908b90610100900461ffff16613302565b94506000856001608060020a03161115611973576008805460001961ffff610100808404821692909201160262ffff00199091161790555b85546001608060020a03610100808304821688019091160270ffffffffffffffffffffffffffffffff00199091161786557f24758388bd6bf650dde3bbde100b1056920770025a9f1c5998b4587670d4f385878c87878760405163ffffffff95861681529390941660208401526001608060020a0390911660408084019190915261ffff91821660608401529216608082015260a001905180910390a1611b22565b600854611a2c908990610100900461ffff16613302565b94506000856001608060020a03161115611a64576008805460001961ffff610100808404821692909201160262ffff00199091161790555b88546001608060020a03610100808304821688019091160270ffffffffffffffffffffffffffffffff001990911617895560035463ffffffff640100000000909104161515611ab557611ab5612fb4565b7f24758388bd6bf650dde3bbde100b1056920770025a9f1c5998b4587670d4f3858b8887878760405163ffffffff95861681529390941660208401526001608060020a0390911660408084019190915261ffff91821660608401529216608082015260a001905180910390a15b5050505050505050505050565b6000805433600160a060020a03908116911614611b4b57600080fd5b5060005b81518160ff161015610ea557818160ff1681518110611b6a57fe5b9060200190602002015161ffff1666038d7ea4c680000260068260ff16815481101515611b9357fe5b90600052602060002090600291828204019190066010026101000a8154816001608060020a0302191690836001608060020a03160217905550600860009054906101000a900460ff1660ff16606460068360ff16815481101515611bf357fe5b6000918252602090912060028204015460019091166010026101000a90046001608060020a0316811515611c2357fe5b040260068260ff16815481101515611c3757fe5b90600052602060002090600291828204019190066010029054906101000a90046001608060020a03160360078260ff16815481101515611c7357fe5b60009182526020909120600282040180546001608060020a0393841660106001948516026101000a908102940219169290921790915501611b4f565b600080600080600033600160a060020a031632600160a060020a0316141515611cd757600080fd5b6006805460ff8816908110611ce857fe5b6000918252602090912060028204015460019091166010026101000a90046001608060020a031634811515611d1957fe5b600854600654929091049650610100900461ffff16945060ff8716101580611d7757506006805460ff8816908110611d4d57fe5b6000918252602090912060028204015460019091166010026101000a90046001608060020a031634105b80611d95575060085461ffff63010000009091048116858701909116115b15611d9f57600080fd5b60035463ffffffff169250600660ff87161015611fc257600354640100000000900463ffffffff161580611de35750600354640100000000900463ffffffff908116145b15611e09576003805467ffffffff00000000191664010000000063ffffffff8616021790555b600091505b8461ffff168260ff161015611f7557611e2f60ff8316848101908601613932565b608060405190810160405260ff8716808252600780546020840192908110611e5357fe5b6000918252602080832060028304015460019092166010026101000a9091046001608060020a0316835233600160a060020a0316838201524267ffffffffffffffff1660409384015260ff8616870163ffffffff16825260049052208151815460ff191660ff91909116178155602082015181546001608060020a03919091166101000270ffffffffffffffffffffffffffffffff0019909116178155604082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560608201516001918201805467ffffffffffffffff9290921660a060020a027bffffffffffffffff000000000000000000000000000000000000000019909216919091179055929092019150611e0e565b60ff86166000908152600960205260409020805461ffff19811661ffff91821688018216179091556008805462ffff0019811661010091829004841689019093160291909117905561211b565b5060005b8461ffff168160ff16101561211b57608060405190810160405260ff8716808252600780546020840192908110611ff957fe5b6000918252602080832060028304015460019092166010026101000a9091046001608060020a0316835233600160a060020a0316838201524267ffffffffffffffff1660409384015260ff8516870163ffffffff16825260049052208151815460ff191660ff91909116178155602082015181546001608060020a03919091166101000270ffffffffffffffffffffffffffffffff0019909116178155604082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560608201516001918201805467ffffffffffffffff9290921660a060020a027bffffffffffffffff000000000000000000000000000000000000000019909216919091179055919091019050611fc6565b6003805463ffffffff191661ffff8716850163ffffffff161790557ff7ad76543f114c7bb00ff2cd992ff749d502ed5c0c6f87901ad48f6871fceca133878786604051600160a060020a03909416845260ff909216602084015261ffff1660408084019190915263ffffffff90911660608301526080909101905180910390a1505050505050565b6000805b600660ff821610156121d75760ff811660009081526009602052604090205461ffff1691909101906001016121a7565b5090565b6008546301000000900461ffff1681565b600054600160a060020a031681565b600080600080600080600e60019054906101000a9004600160a060020a0316600160a060020a031633600160a060020a031614156123065761223c876139db565b63ffffffff8116600090815260046020526040902054600f54919750600660ff91821604160294508489101561227157600080fd5b600e546101009004600160a060020a03166323b872dd8b308860405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156122d957600080fd5b5af115156122e657600080fd5b5050506040518051905015156122f857fe5b612301866139e8565b610e0c565b60105433600160a060020a039081169116141561025857612326876139db565b63ffffffff81166000908152600460205260409020546007805492985060ff9091169550908590811061235557fe5b6000918252602080832060028304015463ffffffff8a1684526004909152604090922054600190911660100261010090810a9092046001608060020a039081169290910416146123a457600080fd5b600c60ff851610156123cc57601154600660ff86160660010160ff16029250600391506123ea565b60115460066003860160ff160660010160ff16026002029250600691505b5063ffffffff851660009081526012602052604081205490945060ff165b8160ff168160ff1610801561242757508060010160ff16830285018910155b1561243f5760010160ff811683029490940193612408565b601054600160a060020a03166323b872dd8b308860405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156124a257600080fd5b5af115156124af57600080fd5b5050506040518051905015156124c157fe5b6123018682613af4565b600e546101009004600160a060020a031681565b60005433600160a060020a039081169116146124fa57600080fd5b601155565b600a5481565b600d6020526000908152604090205481565b60005433600160a060020a0390811691161461253257600080fd5b600e805460ff191660ff92909216919091179055565b601354600160a060020a031681565b600060065b600c60ff821610156121d75760ff811660009081526009602052604090205461ffff16919091019060010161255c565b600681565b600b5481565b6000805433600160a060020a039081169116146125b357600080fd5b5060005b60085461ffff61010090910481169082161015612759576004600060028361ffff168154811015156125e557fe5b6000918252602080832060088304015463ffffffff6004600790941684026101000a909104168452830193909352604090910181206001015460028054600160a060020a03909216936108fc93909290919061ffff871690811061264557fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060000160019054906101000a90046001608060020a03166001608060020a03169081150290604051600060405180830381858888f1935050505015156126ca57600080fd5b6004600060028361ffff168154811015156126e157fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff1683528201929092526040019020805470ffffffffffffffffffffffffffffffffff19168155600190810180547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169055016125b7565b61276560026000613b9c565b506008805462ffff0019169055565b600381565b60005433600160a060020a0390811691161461279457600080fd5b6008805460ff191660ff92909216919091179055565b601054600160a060020a031681565b600080805b60085461ffff6101009091048116908216101561283a576004600060028361ffff168154811015156127ec57fe5b60009182526020808320600883040154600790921660040261010090810a90920463ffffffff1684528301939093526040909101902054046001608060020a031691909101906001016127be565b50600160a060020a0330163103919050565b60001981565b61285a613b61565b600080600080600060326040518059106128715750595b81815260209182028101909101604052600854909650610100900461ffff169150600090505b8161ffff168161ffff161015612d685733600160a060020a03166004600060028461ffff168154811015156128c857fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168352820192909252604001902060010154600160a060020a03161480156129785750426004600060028461ffff1681548110151561292757fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190206001015460a060020a900467ffffffffffffffff908116620151800116105b80156129d3575060028054600c916004916000919061ffff861690811061299b57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff16105b15612d60575b60008261ffff16118015612a4d575033600160a060020a03166004600060026001860361ffff16815481101515612a0c57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168352820192909252604001902060010154600160a060020a0316145b8015612ac05750426004600060026001860361ffff16815481101515612a6f57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190206001015460a060020a900467ffffffffffffffff908116620151800116105b8015612b1f575060028054600c916004916000919061ffff600019880116908110612ae757fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff16105b15612c5f57600280546000199093019261ffff8416908110612b3d57fe5b600091825260208083206008830401546007909216600490810261010090810a90930463ffffffff168085528183526040808620805460ff908116885260098652918720805461ffff19811661ffff9182166000190190911617905595829052919092529254909650046001608060020a0316939093019284908790871681518110612bc557fe5b63ffffffff928316602091820290920101526003546001909601958582166401000000009091049091161415612c07576003805467ffffffff00000000191690555b63ffffffff84166000908152600460205260409020805470ffffffffffffffffffffffffffffffffff1916815560010180547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690556129d9565b8060010161ffff168261ffff161115612d60576004600060028361ffff16815481101515612c8957fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060000160019054906101000a90046001608060020a03166001608060020a03168301925060028161ffff16815481101515612d0057fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff16868660ff1681518110612d3557fe5b63ffffffff90921660209283029091019091015260019094019360001990910190612d6081836130ea565b600101612897565b6008805462ffff00191661010061ffff8516021790557f1e6d26af567145cb0b46ea7135e21671f1e58e8d1f818dab12b0e10eb5ebb07b338488604051600160a060020a03841681526020810183905260606040820181815290820183818151815260200191508051906020019060200280838360005b83811015612df7578082015183820152602001612ddf565b5050505090500194505050505060405180910390a1600160a060020a03331683156108fc0284604051600060405180830381858888f193505050501515612e3d57600080fd5b600354640100000000900463ffffffff161515612e5c57612e5c612fb4565b505050505050565b60005433600160a060020a03908116911614612e7f57600080fd5b600c805460ff191660ff92909216919091179055565b600854610100900461ffff1681565b60005433600160a060020a03908116911614612ebf57600080fd5b600160a060020a0381161515612ed457600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a03908116911614612f5a57600080fd5b6008805461ffff90921663010000000264ffff00000019909216919091179055565b6002805482908110612f8a57fe5b9060005260206000209060089182820401919006600402915054906101000a900463ffffffff1681565b60001960005b60085461ffff610100909104811690821610156130b3578163ffffffff1660028261ffff16815481101515612feb57fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff1610801561306b5750600660ff166004600060028461ffff1681548110151561303357fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff16105b156130ab576002805461ffff831690811061308257fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1691505b600101612fba565b506003805463ffffffff9092166401000000000267ffffffff0000000019909216919091179055565b600154600160a060020a0316ff5b600060028361ffff168154811015156130ff57fe5b6000918252602080832060088304015463ffffffff6004600790941684026101000a909104811680855292825260408085205460ff16855260099092529220805460001961ffff808316919091011661ffff19909116179055600354909250640100000000900416811415613180576003805467ffffffff00000000191690555b63ffffffff81166000908152600460205260409020805470ffffffffffffffffffffffffffffffffff1916815560010180547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690556002805461ffff84169081106131e557fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1660028461ffff1681548110151561321e57fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff16021790555060028261ffff1681548110151561326457fe5b90600052602060002090600891828204019190066004026101000a81549063ffffffff0219169055505050565b6000600143034042600860019054906101000a900461ffff1684604051938452602084019290925261ffff167e010000000000000000000000000000000000000000000000000000000000000260408084019190915260428301919091526062909101905190819003902092915050565b60008060028461ffff1681548110151561331857fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168083526012909152604082205490925060ff1611156133885763ffffffff81166000908152601260205260408120805460ff19811660ff9182166000190190911617905591506133f4565b6004600060028661ffff1681548110151561339f57fe5b60009182526020808320600883040154600790921660040261010090810a90920463ffffffff16845283019390935260409091019020546000199490940193046001608060020a031691506133f484846130ea565b5092915050565b6000806000613408613b61565b600354600090819081908190640100000000900463ffffffff16151561343057613430612fb4565b600354640100000000900463ffffffff908116146134ae57600354640100000000900463ffffffff166000908152600460205260409020805470ffffffffffffffffffffffffffffffff00198116600a6001608060020a038d81169190910461010093849004821681019091169092021790915560090297506134b2565b8897505b600c9550856040518059106134c45750595b90808252806020026020018201604052509450600093505b8560ff168460ff1610156135515760ff841660009081526009602052604081205461ffff161115613546576007805460ff861690811061351857fe5b90600052602060002090600291828204019190066010029054906101000a90046001608060020a0316870196505b6001909301926134dc565b600092505b8560ff168360ff1610156136355760ff831660009081526009602052604081205461ffff16111561362a5760ff83166000818152600960205260409020546007805461ffff909216926001608060020a038b169281106135b257fe5b90600052602060002090600291828204019190066010029054906101000a90046001608060020a03168a026001608060020a03168115156135ef57fe5b046001608060020a031681151561360257fe5b04858460ff168151811061361257fe5b6001608060020a039092166020928302909101909101525b600190920191613556565b5060005b60085461ffff61010090910481169082161015613798576004600060028361ffff1681548110151561366757fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff9081169250861682101561379057846004600060028461ffff168154811015156136c257fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff168151811061370257fe5b906020019060200201516004600060028461ffff1681548110151561372357fe5b60009182526020808320600883040154600790921660040261010090810a90920463ffffffff16845283019390935260409091019020805470ffffffffffffffffffffffffffffffff00198116908390046001608060020a03908116949094019093169091029190911790555b600101613639565b505050505050505050565b600854600090819081908190610100900461ffff166137c186613291565b8115156137ca57fe5b6008549190069350600761ffff61010090920482160616156137ed57600761380e565b600854600b61ffff610100909204821606161561380b57600b61380e565b600d5b60ff1691508290505b600660ff166004600060028461ffff1681548110151561383357fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff161080156138d4575033600160a060020a03166004600060028461ffff1681548110151561389257fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168352820192909252604001902060010154600160a060020a031614155b156138e15780935061392a565b60085461ffff610100909104811690828401168115156138fd57fe5b06905061ffff8082169084161461391357613817565b600860039054906101000a900461ffff1660010193505b505050919050565b60025461ffff8216101561398c578160028261ffff1681548110151561395457fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff160217905550610ea5565b600280546001810161399e8382613bc4565b916000526020600020906008918282040191900660040284909190916101000a81548163ffffffff021916908363ffffffff160217905550505050565b6000806080519392505050565b63ffffffff811660009081526005602052604081205460ff1615613a0b57600080fd5b5063ffffffff81166000908152600560209081526040808320805460ff19166001179055600490915290208054600660ff919091161015613a4b57600080fd5b600854613a62908390610100900461ffff16613932565b6008805462ffff0019811660016101009283900461ffff9081168201811690930291909117909255825460ff1660009081526009602052604090819020805461ffff1981169084169094019092169290921790557f663f46f5a2fd740de613966ad0391fbc9d840f82898698e6d7f16ba0ed126b3b9083905163ffffffff909116815260200160405180910390a15050565b63ffffffff821660009081526012602052604090819020805460ff191660ff84161790557f088ba7785fd329abbf01eaa732bad30e14b205b9fc8ab9378f9f52957311355590839083905163ffffffff909216825260ff1660208201526040908101905180910390a15050565b60206040519081016040526000815290565b610140604051908101604052600a815b600081526000199091019060200181613b835790505090565b508054600082556007016008900490600052602060002090810190613bc19190613bfd565b50565b815481835581811511613bf8576007016008900481600701600890048360005260206000209182019101613bf89190613bfd565b505050565b613c1791905b808211156121d75760008155600101613c03565b905600a165627a7a723058201adc69fec903c54abe6b25688c6df16a0e864d1a4a5b7c0e49b7c8ad358a929a00290000000000000000000000008a01bc6a9358388588247127ff7be21b281b36d4000000000000000000000000ee7acd6b0fb65eebc11cf733fdc606619cf633d4000000000000000000000000d22d680d1fa045a07e8d335c1bb815ebfc4d4e5e000000000000000000000000822afedd7d48ed1056247747c8ed6df7f02b50fc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000003e8

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

-----Encoded View---------------
20 Constructor Arguments found :
Arg [0] : 0000000000000000000000008a01bc6a9358388588247127ff7be21b281b36d4
Arg [1] : 000000000000000000000000ee7acd6b0fb65eebc11cf733fdc606619cf633d4
Arg [2] : 000000000000000000000000d22d680d1fa045a07e8d335c1bb815ebfc4d4e5e
Arg [3] : 000000000000000000000000822afedd7d48ed1056247747c8ed6df7f02b50fc
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000200
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [10] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000014
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [14] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [15] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [16] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [17] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [18] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [19] : 00000000000000000000000000000000000000000000000000000000000003e8


   Swarm Source:
bzzr://1adc69fec903c54abe6b25688c6df16a0e864d1a4a5b7c0e49b7c8ad358a929a

 

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