Latest 25 transactions from a total of 88 transactions

TxHash Age From To Value [TxFee]
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a60257 days 19 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.00389404
0x8885ceb22d67794eb3eff9aa0e547896e54c9bacd6a9f2f150bb2045591a7596257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000682806
0x842d46033236c6f6c3e2745d18ef72f1939dc88184c74591d9b3297632a30deb257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000410028
0x8eb413a5d7e992611ae6f01496973e48be7768fc4b2a1dac70a4eeb0acd2a40e257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000574032
0xf7387184ffd7b977869b1ad968fb5aa10cdaa5f9ec49a94aa13f4180b4896e83257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000662118
0x2681461b08fbbefa769f81493890720e6ddeaf64fa6efbc7241501faf8e31725257 days 20 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000962621
0xc50550f76559f76b9cd8efb7a953a1434f53edbd50aec9dcdffd5f96506ad330257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd4 Ether0.001316532
0xd09141314168a305ff7041cc4df72e01f86f1a906407d71dfbc77ae3b8dc04e9257 days 20 hrs ago0x1659acf7231739825c900e0caadd37aca5d272ab  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000367248
0xc0b6a9dc8460ca0fbe3cf5f717fcee5596e7e738c5f3067c478cc13968738c46257 days 20 hrs ago0x1659acf7231739825c900e0caadd37aca5d272ab  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0.01 Ether0.000471594
0xc06b973787adfaf4a14a7d5eb808fbe42a49989ad05e120a687c21a874f298b4257 days 20 hrs ago0x1659acf7231739825c900e0caadd37aca5d272ab  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0.05 Ether0.001595778
0x9da376705f00182768e42964af6d1f6a93c414db88de84aa4e32009f50aa1355257 days 20 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.0008820042
0x50f542fb44489e115004add0f740a902e3387f3f53b2e102227cf50b8fb64a96257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000517998
0xc5e1701aaa91368dbbd68619e7afe40eeaf3e012a9b0d064b675476ab97d57f9257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000195144
0x7a78f9b3cce5de5a10949bfbe7d0c51e4a1073d73345eb017b2abdb82fddf5c4257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000422286
0xc2aaa8781455fbe3f4e9e2ebd889c54fe3b1b267c5ef80a7986b8747cfe5d011257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.00047925
0x3a4b32a7a32eb82d8a3e63581980d4d9f4d6088c4947f21e2c43b4a0c6323448257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000463998
0x46cab6e0e07a4ba42b994267e11bb2c30cc97beaaaadfc60c5c9154cb11749d2257 days 20 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.0011779878
0xb1063036d9b3b0fc9d6c27ceebd378f941da69e4351c56d74836309b786f57e7257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd5 Ether0.001597878
0x22b7482a455b6e45859c7199af2d57bf9523018ddcda5779fbf9ecfd1be5ee6e257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000336636
0x395db8293d90d239d99f0cb49c94ab3365fdc2c273236627a0ff3ebee2f3d925257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000361038
0xe2d36aa511f5195b14ca45253683fbba65fb0bce6df391693a93c863d602802b257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000336636
0x2082bab98726143da1ccd4d44f6f5f78e86f3d9577d232a66fc917a1ad907ea7257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000336636
0x9b4f51642154cf4196309d510735505ed40c3b0253d4f0fcf58623b181d5ce67257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.000258018
0x1bac79b6d3d2a432bc8fd02428837ec3634eb2c8d9ff86a45e581a9703c5f8fd257 days 20 hrs ago0x2831de120827570cf8c7cfcb9b788c222e307de4  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0 Ether0.0010448988
0x6d3be215d0451f021350ba98ef0734f55bac9d5c34f6c4dc1b60a46ceff13695257 days 20 hrs ago0x47b5ed2279478151d1631014aa90f876fec4a136  IN   0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0.05 Ether0.001595778
[ 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
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x2831de120827570cf8c7cfcb9b788c222e307de40.38387700000000006 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x1659acf7231739825c900e0caadd37aca5d272ab0.010126166481995113 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x1659acf7231739825c900e0caadd37aca5d272ab0.010126166481995113 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x1659acf7231739825c900e0caadd37aca5d272ab0.010126166481995113 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x1659acf7231739825c900e0caadd37aca5d272ab0.010126166481995113 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x1659acf7231739825c900e0caadd37aca5d272ab0.010126166481995113 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x47b5ed2279478151d1631014aa90f876fec4a1361.042457139256184061 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x2831de120827570cf8c7cfcb9b788c222e307de40.059431899015111279 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x47b5ed2279478151d1631014aa90f876fec4a1361.208453105343247638 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x24def1747d6e244018ae54d475862593284bad7f0.015301430443682708 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x1659acf7231739825c900e0caadd37aca5d272ab0.010126166481995113 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x47b5ed2279478151d1631014aa90f876fec4a1361.023057139256184061 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x24def1747d6e244018ae54d475862593284bad7f0.020631899015111279 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x24def1747d6e244018ae54d475862593284bad7f0.020631899015111279 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x47b5ed2279478151d1631014aa90f876fec4a1360.998169125330115967 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x8a01bc6a9358388588247127ff7be21b281b36d40 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x8a01bc6a9358388588247127ff7be21b281b36d40 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0xee7acd6b0fb65eebc11cf733fdc606619cf633d40 Ether
0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a603398767257 days 19 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0xee7acd6b0fb65eebc11cf733fdc606619cf633d40 Ether
0x8885ceb22d67794eb3eff9aa0e547896e54c9bacd6a9f2f150bb2045591a75963398536257 days 20 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0x8885ceb22d67794eb3eff9aa0e547896e54c9bacd6a9f2f150bb2045591a75963398536257 days 20 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0x8885ceb22d67794eb3eff9aa0e547896e54c9bacd6a9f2f150bb2045591a75963398536257 days 20 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0x8885ceb22d67794eb3eff9aa0e547896e54c9bacd6a9f2f150bb2045591a75963398536257 days 20 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
0x842d46033236c6f6c3e2745d18ef72f1939dc88184c74591d9b3297632a30deb3398534257 days 20 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0xd22d680d1fa045a07e8d335c1bb815ebfc4d4e5e0 Ether
0x842d46033236c6f6c3e2745d18ef72f1939dc88184c74591d9b3297632a30deb3398534257 days 20 hrs ago0xb5eaf7fe4c3e5a99db41c1d478a868cbc479b9dd0x822afedd7d48ed1056247747c8ed6df7f02b50fc0 Ether
[ Download CSV Export  ] 
Contract Self Destruct Called At TxHash 0x5590625e1c28af4539d4a9f9d0d935ad73161d029a6ce20fed783863f3d22a60

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;


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

}

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

	/** 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 teleportToken;
	/** the price for teleportation*/
	uint public teleportPrice;
	/** the neverdue token contract used to purchase protection from eruptions and fights */
	Token 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 sklToken;
	/** the XP token contract **/
	Token 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 = 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 {
		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);
			}
			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);
			}
		}
		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]].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]].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];
				}
				//if the last character does not belong to the player, replace the players character by this last one
				if (nchars > i + 1 && characters[ids[nchars - 1]].owner != msg.sender) {
					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(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 {
		if (knightID != ids[knightIndex])
			knightID = 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 * knight.value) / dragon.value / fightFactor);
			} else if (dragonPower > knightPower) {
				base_probability -= uint16((100 * dragon.value) / knight.value / 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);
		}
  
		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;
			cooldown[knightID] = now;
			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(msg.sender == characters[characterId].owner);
		require(characters[characterId].characterType < 2*numDragonTypes);
		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 *************************/

	/**
	 * 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":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":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":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":"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":"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
606060405234156200001057600080fd5b60405162003e5b38038062003e5b833981016040528080519190602001805191906020018051919060200180519190602001805191906020018051919060200180519190602001805182019190602001805160008054600160a060020a03338116600160a060020a031992831681178085556001805490941682179093559390950194919350839283929190911614620000a957600080fd5b6008805460ff191660ff8816179055600092505b84516002028360ff1610156200023d576006805460018101620000e183826200048c565b6000928352602090922060028204019060011660100287600660ff88160660ff16815181106200010d57fe5b9060200190602002015161ffff1666038d7ea4c6800002909190916101000a8154816001608060020a0302191690836001608060020a0316021790555050600780548060010182816200016191906200048c565b600092835260209092206008546006805460028504909301936001166010029260ff9283169260649291908a169081106200019857fe5b6000918252602090912060028204015460019091166010026101000a90046001608060020a0316811515620001c957fe5b040260068760ff16815481101515620001de57fe5b90600052602060002090600291828204019190066010029054906101000a90046001608060020a031603909190916101000a8154816001608060020a0302191690836001608060020a03160217905550508280600101935050620000bd565b84516002029150600090505b83518160ff161015620003c55760068054600181016200026a83826200048c565b9160005260206000209060029182820401919006601002868460ff16815181106200029157fe5b9060200190602002015161ffff1666038d7ea4c6800002909190916101000a8154816001608060020a0302191690836001608060020a031602179055505060078054806001018281620002e591906200048c565b600092835260209092206008546006805460028504909301936001166010029260ff928316926064929190881689019081106200031e57fe5b6000918252602090912060028204015460019091166010026101000a90046001608060020a03168115156200034f57fe5b040260068560ff1687018154811015156200036657fe5b90600052602060002090600291828204019190066010029054906101000a90046001608060020a031603909190916101000a8154816001608060020a0302191690836001608060020a0316021790555050808060010191505062000249565b50505060ff610e109095028516600a555050600c80549290931660ff19928316179092556008805464025800000064ffff000000199091161790556003805463ffffffff19166001179055600e8054670de0b6b3a7640000600f81905560108054600160a060020a03998a16600160a060020a0319918216179091556011919091559787166101000261010060a860020a031990911617909116600417905550601380549284169285169290921790915560148054919092169216919091179055620004ec565b815481835581811511620004c3576001016002900481600101600290048360005260206000209182019101620004c39190620004c8565b505050565b620004e991905b80821115620004e55760008155600101620004cf565b5090565b90565b61395f80620004fc6000396000f3006060604052600436106102215763ffffffff60e060020a60003504166307da68f581146102265780630fa6002e1461023b57806311a5a7931461025757806319f353bb146102805780631e466eee146102a557806328acb002146102b857806329b20bb6146102d75780633728bec2146103075780633c3c22b31461035c5780633ccfd60b14610388578063453348941461039b5780634597dc8e146103b157806349b3b29f146103c45780634ad6e648146103f65780634f255b801461040957806350c88103146104255780635e383d211461043b578063603709e3146104515780636121e5221461052857806361b8ce8c1461053b57806372ad21c71461054e578063773e1e841461056a5780637825396b1461058d578063797e2aec146105dc578063851ad4d6146105ea5780638882ddc9146105fd5780638da5cb5b146106105780638f4ffcb11461063f578063acd782b1146106ab578063afb7e495146106c1578063b066ef3c146106d4578063b1b79120146106f0578063b32dbcd814610709578063bc447a6d1461071c578063c10435cc1461072f578063c205240314610742578063c8f490c814610755578063cb122a0914610768578063db8d55f114610781578063dc9bb7db14610794578063e9fad8ee146107a7578063eb8fb32c146107ba578063f1be42f1146107d3578063f2fde38b146107e6578063f501500014610805578063fac333ac1461081f578063fbe6529f14610835575b600080fd5b341561023157600080fd5b610239610848565b005b341561024657600080fd5b61023963ffffffff6004351661087d565b341561026257600080fd5b61026a6109f4565b60405160ff909116815260200160405180910390f35b341561028b57600080fd5b6102936109fd565b60405190815260200160405180910390f35b34156102b057600080fd5b610239610a03565b34156102c357600080fd5b6102396001608060020a0360043516610cee565b34156102e257600080fd5b6102f060ff60043516610d70565b60405161ffff909116815260200160405180910390f35b341561031257600080fd5b61032363ffffffff60043516610d86565b60405160ff90931683526001608060020a039091166020830152600160a060020a03166040808301919091526060909101905180910390f35b341561036757600080fd5b61036f610dc5565b60405163ffffffff909116815260200160405180910390f35b341561039357600080fd5b610239610dd9565b34156103a657600080fd5b610239600435610fcb565b34156103bc57600080fd5b610293610feb565b34156103cf57600080fd5b6103da600435610ff2565b6040516001608060020a03909116815260200160405180910390f35b341561040157600080fd5b61026a61102d565b341561041457600080fd5b6102f063ffffffff60043516611036565b341561043057600080fd5b6102396004356110a2565b341561044657600080fd5b6103da6004356110c2565b341561045c57600080fd5b61046b61ffff600435166110d0565b604051808561014080838360005b83811015610491578082015183820152602001610479565b5050505090500184600a60200280838360005b838110156104bc5780820151838201526020016104a4565b5050505090500183600a60200280838360005b838110156104e75780820151838201526020016104cf565b5050505090500182600a60200280838360005b838110156105125780820151838201526020016104fa565b5050505090500194505050505060405180910390f35b341561053357600080fd5b610293611286565b341561054657600080fd5b61036f61128c565b341561055957600080fd5b61026a63ffffffff60043516611298565b341561057557600080fd5b61023963ffffffff6004351661ffff602435166112ad565b341561059857600080fd5b61023960046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496506119c595505050505050565b61023960ff60043516611b45565b34156105f557600080fd5b6102f0611f7c565b341561060857600080fd5b6102f0611fb4565b341561061b57600080fd5b610623611fc5565b604051600160a060020a03909116815260200160405180910390f35b341561064a57600080fd5b61023960048035600160a060020a0390811691602480359260443516919060849060643590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650611fd495505050505050565b34156106b657600080fd5b6102396004356122a4565b34156106cc57600080fd5b6102936122c4565b34156106df57600080fd5b61029363ffffffff600435166122ca565b34156106fb57600080fd5b61023960ff600435166122dc565b341561071457600080fd5b6102f061230d565b341561072757600080fd5b61026a612342565b341561073a57600080fd5b610293612347565b341561074d57600080fd5b61023961234d565b341561076057600080fd5b61026a612522565b341561077357600080fd5b61023960ff60043516612527565b341561078c57600080fd5b610293612558565b341561079f57600080fd5b61036f6125eb565b34156107b257600080fd5b6102396125f1565b34156107c557600080fd5b61023960ff60043516612b85565b34156107de57600080fd5b6102f0612bb6565b34156107f157600080fd5b610239600160a060020a0360043516612bc5565b341561081057600080fd5b61023961ffff60043516612c60565b341561082a57600080fd5b61036f600435612c9d565b341561084057600080fd5b610239612cd5565b60005433600160a060020a0390811691161461086357600080fd5b61086b610dd9565b61087361234d565b61087b612dfd565b565b63ffffffff811660009081526004602052604081206001015433600160a060020a039081169116146108ae57600080fd5b63ffffffff8216600090815260046020526040902054600c60ff909116106108d557600080fd5b5063ffffffff81166000908152600460205260409020546008805462ffff001981166101009182900461ffff908116600019011682021790915590046001608060020a031661093761092683611036565b600854610100900461ffff16612e0b565b600160a060020a0333166001608060020a03821680156108fc0290604051600060405180830381858888f19350505050151561097257600080fd5b600354640100000000900463ffffffff16151561099157610991612cd5565b7fe5cc68f68d9672681158062a835b6abc2ff3fba89f8db70f3a227d4ac35da3c382338360405163ffffffff9093168352600160a060020a0390911660208301526001608060020a03166040808301919091526060909101905180910390a15050565b600c5460ff1681565b60115481565b6000806000806000806000610a1661387a565b600080600a54600b54014210151515610a2e57600080fd5b600854600061010090910461ffff1611610a4757600080fd5b42600b55600854600c5461ffff61010090920482169750606460ff909116880282160416945063ffffffff62013880612710880201169350841515610a8b57600194505b8463ffffffff16604051805910610a9f5750595b90808252806020026020018201604052509250600091505b8463ffffffff168260ff161015610b7d578561ffff16610add8360ff16600b5401612faa565b811515610ae657fe5b06975060028861ffff16815481101515610afc57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff16965086838360ff1681518110610b3457fe5b63ffffffff909216602092830290910190910152610b52888761301b565b98506000896001608060020a03161115610b6e57600019909501945b98880198600190910190610ab7565b506008805461ffff87166101000262ffff00199091161790556001608060020a038084163a0290818116908b161115610c5157610bbb818b03613114565b7fa06ad7d0261a795ad8f33fdbef7cf65a0f9f9a825353b13358a96a750acd6b3d83828c03836040516001608060020a0380841660208301528216604082015260608082528190810185818151815260200191508051906020019060200280838360005b83811015610c37578082015183820152602001610c1f565b5050505090500194505050505060405180910390a1610ce2565b7fa06ad7d0261a795ad8f33fdbef7cf65a0f9f9a825353b13358a96a750acd6b3d836000836040516001608060020a0380841660208301528216604082015260608082528190810185818151815260200191508051906020019060200280838360005b83811015610ccc578082015183820152602001610cb4565b5050505090500194505050505060405180910390a15b50505050505050505050565b6000805433600160a060020a03908116911614610d0a57600080fd5b610d12612558565b9050808267016345785d8a0000016001608060020a03161015610d6c57600154600160a060020a03166001608060020a03831680156108fc0290604051600060405180830381858888f193505050501515610d6c57600080fd5b5050565b60096020526000908152604090205461ffff1681565b63ffffffff166000908152600460205260409020805460019091015460ff8216926101009092046001608060020a031691600160a060020a0390911690565b600354640100000000900463ffffffff1681565b60008054819033600160a060020a03908116911614610df757600080fd5b601054600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610e4757600080fd5b5af11515610e5457600080fd5b5050506040518051601054600154919450600160a060020a03908116925063a9059cbb91168460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610ebd57600080fd5b5af11515610eca57600080fd5b505050604051805190501515610edc57fe5b600e546101009004600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610f3157600080fd5b5af11515610f3e57600080fd5b5050506040518051600e54600154919350600160a060020a036101009091048116925063a9059cbb91168360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610fac57600080fd5b5af11515610fb957600080fd5b505050604051805190501515610d6c57fe5b60005433600160a060020a03908116911614610fe657600080fd5b600f55565b6201518081565b600680548290811061100057fe5b9060005260206000209060029182820401919006601002915054906101000a90046001608060020a031681565b600e5460ff1681565b6000805b60025461ffff82161015610221578263ffffffff1660028261ffff1681548110151561106257fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff1614156110945780915061109c565b60010161103a565b50919050565b60005433600160a060020a039081169116146110bd57600080fd5b600a55565b600780548290811061100057fe5b6110d861388c565b6110e061388c565b6110e861388c565b6110f061388c565b600080600080600860019054906101000a900461ffff1661ffff1689600a0161ffff16116111215788600a0161112e565b600854610100900461ffff165b61ffff169350600092508890505b8363ffffffff168161ffff16101561127b576002805461ffff831690811061116057fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff169150818860ff8516600a811061119657fe5b63ffffffff9283166020918202929092019190915290831660009081526004909152604090205460ff9081169088908516600a81106111d157fe5b60ff9283166020918202929092019190915263ffffffff841660009081526004909152604090205461010090046001608060020a03169087908516600a811061121657fe5b6001608060020a039092166020928302919091015263ffffffff8316600090815260049091526040902060010154600160a060020a03168560ff8516600a811061125c57fe5b600160a060020a0390921660209290920201526001928301920161113c565b505050509193509193565b600f5481565b60035463ffffffff1681565b60126020526000908152604090205460ff1681565b600080600080600080600080600060028a61ffff168154811015156112ce57fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff908116908c161461130c576113058b611036565b61ffff169a505b63ffffffff8b166000908152600460209081526040808320600d909252909120549099504262015180909101111561134357600080fd5b600189015433600160a060020a0390811691161461136057600080fd5b8854600c60ff9091161061137357600080fd5b8854600660ff909116101561138757600080fd5b6113968b63ffffffff166134bc565b60085490985061ffff63010000009091048116908916106113b357fe5b6002805461ffff8a169081106113c557fe5b6000918252602080832060088304015463ffffffff6004600790941684026101000a9091048116808552929091526040909220909850965060649061140b908d16612faa565b81151561141457fe5b60145460018c0154929091069450600160a060020a03908116916370a08231911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561147357600080fd5b5af1151561148057600080fd5b505050604051805160135460018c015491925066038d7ea4c6800091600160a060020a03918216916370a08231911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156114ed57600080fd5b5af115156114fa57600080fd5b5050506040518051905081151561150d57fe5b60145460018a015492909104929092019350600160a060020a03918216916370a08231911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561157057600080fd5b5af1151561157d57600080fd5b5050506040518051601354600189015491925066038d7ea4c6800091600160a060020a03918216916370a08231911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156115ea57600080fd5b5af115156115f757600080fd5b5050506040518051905081151561160a57fe5b88548c5492909104929092019250610100918290046001608060020a03908116929091041614156116e857603293508082111561169057600e5486548a5460ff90921691610100918290046001608060020a039081169290910481166064021681151561167357fe5b046001608060020a031681151561168657fe5b04840193506116e3565b818111156116e357600e548954875460ff90921691610100918290046001608060020a03908116929091048116606402168115156116ca57fe5b046001608060020a03168115156116dd57fe5b04840393505b611799565b855489546001608060020a03610100928390048116929091041611156117465760649350818111156116e357600e548954875460ff90921691610100918290046001608060020a03908116929091048116606402168115156116ca57fe5b8082111561179957600e5486548a5460ff90921691610100918290046001608060020a039081169290910481166064021681151561178057fe5b046001608060020a031681151561179357fe5b04840193505b61ffff80851690841610611898576008546117be908b90610100900461ffff1661301b565b94506000856001608060020a031611156117f6576008805460001961ffff610100808404821692909201160262ffff00199091161790555b85546001608060020a03610100808304821688019091160270ffffffffffffffffffffffffffffffff00199091161786557f24758388bd6bf650dde3bbde100b1056920770025a9f1c5998b4587670d4f385878c87878760405163ffffffff95861681529390941660208401526001608060020a0390911660408084019190915261ffff91821660608401529216608082015260a001905180910390a16119b8565b6008546118af908990610100900461ffff1661301b565b94506000856001608060020a031611156118e7576008805460001961ffff610100808404821692909201160262ffff00199091161790555b88546001608060020a03610100808304821688019091160270ffffffffffffffffffffffffffffffff001990911617895563ffffffff808c166000908152600d60205260409020429055600354640100000000900416151561194b5761194b612cd5565b7f24758388bd6bf650dde3bbde100b1056920770025a9f1c5998b4587670d4f3858b8887878760405163ffffffff95861681529390941660208401526001608060020a0390911660408084019190915261ffff91821660608401529216608082015260a001905180910390a15b5050505050505050505050565b6000805433600160a060020a039081169116146119e157600080fd5b5060005b81518160ff161015610d6c57818160ff1681518110611a0057fe5b9060200190602002015161ffff1666038d7ea4c680000260068260ff16815481101515611a2957fe5b90600052602060002090600291828204019190066010026101000a8154816001608060020a0302191690836001608060020a03160217905550600860009054906101000a900460ff1660ff16606460068360ff16815481101515611a8957fe5b6000918252602090912060028204015460019091166010026101000a90046001608060020a0316811515611ab957fe5b040260068260ff16815481101515611acd57fe5b90600052602060002090600291828204019190066010029054906101000a90046001608060020a03160360078260ff16815481101515611b0957fe5b60009182526020909120600282040180546001608060020a0393841660106001948516026101000a9081029402191692909217909155016119e5565b600080600080600060068660ff16815481101515611b5f57fe5b6000918252602090912060028204015460019091166010026101000a90046001608060020a031634811515611b9057fe5b600854600654929091049650610100900461ffff16945060ff8716101580611bee57506006805460ff8816908110611bc457fe5b6000918252602090912060028204015460019091166010026101000a90046001608060020a031634105b80611c0c575060085461ffff63010000009091048116858701909116115b15611c1657600080fd5b60035463ffffffff169250600660ff87161015611dea57600354640100000000900463ffffffff161580611c5a5750600354640100000000900463ffffffff908116145b15611c80576003805467ffffffff00000000191664010000000063ffffffff8616021790555b600091505b8461ffff168260ff161015611d9d57611ca660ff831684810190860161364b565b606060405190810160405260ff8716808252600780546020840192908110611cca57fe5b6000918252602080832060028304015460019092166010026101000a9091046001608060020a0316835233600160a060020a03169281019290925260ff8516860163ffffffff1681526004909152604090208151815460ff191660ff91909116178155602082015181546001608060020a03919091166101000270ffffffffffffffffffffffffffffffff001990911617815560408201516001918201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055929092019150611c85565b60ff86166000908152600960205260409020805461ffff19811661ffff91821688018216179091556008805462ffff00198116610100918290048416890190931602919091179055611ef4565b5060005b8461ffff168160ff161015611ef457606060405190810160405260ff8716808252600780546020840192908110611e2157fe5b6000918252602080832060028304015460019092166010026101000a9091046001608060020a0316835233600160a060020a03169281019290925260ff8416860163ffffffff1681526004909152604090208151815460ff191660ff91909116178155602082015181546001608060020a03919091166101000270ffffffffffffffffffffffffffffffff001990911617815560408201516001918201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055919091019050611dee565b6003805463ffffffff191661ffff8716850163ffffffff161790557ff7ad76543f114c7bb00ff2cd992ff749d502ed5c0c6f87901ad48f6871fceca133878786604051600160a060020a03909416845260ff909216602084015261ffff1660408084019190915263ffffffff90911660608301526080909101905180910390a1505050505050565b6000805b600660ff82161015611fb05760ff811660009081526009602052604090205461ffff169190910190600101611f80565b5090565b6008546301000000900461ffff1681565b600054600160a060020a031681565b600080600080600080600e60019054906101000a9004600160a060020a0316600160a060020a031633600160a060020a031614156120df57612015876136f4565b63ffffffff8116600090815260046020526040902054600f54919750600660ff91821604160294508489101561204a57600080fd5b600e546101009004600160a060020a03166323b872dd8b308860405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156120b257600080fd5b5af115156120bf57600080fd5b5050506040518051905015156120d157fe5b6120da86613701565b610ce2565b60105433600160a060020a0390811691161415610221576120ff876136f4565b63ffffffff81166000908152600460205260409020546007805492985060ff9091169550908590811061212e57fe5b6000918252602080832060028304015463ffffffff8a1684526004909152604090922054600190911660100261010090810a9092046001608060020a0390811692909104161461217d57600080fd5b600c60ff851610156121a557601154600660ff86160660010160ff16029250600391506121c3565b60115460066003860160ff160660010160ff16026002029250600691505b5063ffffffff851660009081526012602052604081205490945060ff165b8160ff168160ff1610801561220057508060010160ff16830285018910155b156122185760010160ff8116830294909401936121e1565b601054600160a060020a03166323b872dd8b308860405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561227b57600080fd5b5af1151561228857600080fd5b50505060405180519050151561229a57fe5b6120da868261380d565b60005433600160a060020a039081169116146122bf57600080fd5b601155565b600a5481565b600d6020526000908152604090205481565b60005433600160a060020a039081169116146122f757600080fd5b600e805460ff191660ff92909216919091179055565b600060065b600c60ff82161015611fb05760ff811660009081526009602052604090205461ffff169190910190600101612312565b600681565b600b5481565b6000805433600160a060020a0390811691161461236957600080fd5b5060005b60085461ffff61010090910481169082161015612507576004600060028361ffff1681548110151561239b57fe5b6000918252602080832060088304015463ffffffff6004600790941684026101000a909104168452830193909352604090910181206001015460028054600160a060020a03909216936108fc93909290919061ffff87169081106123fb57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060000160019054906101000a90046001608060020a03166001608060020a03169081150290604051600060405180830381858888f19350505050151561248057600080fd5b6004600060028361ffff1681548110151561249757fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff1683528201929092526040019020805470ffffffffffffffffffffffffffffffffff191681556001908101805473ffffffffffffffffffffffffffffffffffffffff191690550161236d565b612513600260006138b5565b506008805462ffff0019169055565b600381565b60005433600160a060020a0390811691161461254257600080fd5b6008805460ff191660ff92909216919091179055565b600080805b60085461ffff610100909104811690821610156125d9576004600060028361ffff1681548110151561258b57fe5b60009182526020808320600883040154600790921660040261010090810a90920463ffffffff1684528301939093526040909101902054046001608060020a0316919091019060010161255d565b50600160a060020a0330163103919050565b60001981565b6125f961387a565b600080600080600060326040518059106126105750595b81815260209182028101909101604052600854909650610100900461ffff169150600090505b8161ffff168161ffff161015612a895733600160a060020a03166004600060028461ffff1681548110151561266757fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168352820192909252604001902060010154600160a060020a0316148015612702575060028054600c916004916000919061ffff86169081106126ca57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff16105b15612a81575b60008261ffff1611801561277c575033600160a060020a03166004600060026001860361ffff1681548110151561273b57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168352820192909252604001902060010154600160a060020a0316145b80156127db575060028054600c916004916000919061ffff6000198801169081106127a357fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff16105b1561291357600280546000199093019261ffff84169081106127f957fe5b600091825260208083206008830401546007909216600490810261010090810a90930463ffffffff168085528183526040808620805460ff908116885260098652918720805461ffff19811661ffff9182166000190190911617905595829052919092529254909650046001608060020a031693909301928490879087168151811061288157fe5b63ffffffff9283166020918202909201015260035460019096019585821664010000000090910490911614156128c3576003805467ffffffff00000000191690555b63ffffffff84166000908152600460205260409020805470ffffffffffffffffffffffffffffffffff19168155600101805473ffffffffffffffffffffffffffffffffffffffff19169055612708565b8060010161ffff168261ffff1611801561298e575033600160a060020a03166004600060026001860361ffff1681548110151561294c57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168352820192909252604001902060010154600160a060020a031614155b15612a81576004600060028361ffff168154811015156129aa57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060000160019054906101000a90046001608060020a03166001608060020a03168301925060028161ffff16815481101515612a2157fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff16868660ff1681518110612a5657fe5b63ffffffff90921660209283029091019091015260019094019360001990910190612a818183612e0b565b600101612636565b6008805462ffff00191661010061ffff8516021790557f1e6d26af567145cb0b46ea7135e21671f1e58e8d1f818dab12b0e10eb5ebb07b338488604051600160a060020a03841681526020810183905260606040820181815290820183818151815260200191508051906020019060200280838360005b83811015612b18578082015183820152602001612b00565b5050505090500194505050505060405180910390a1600160a060020a03331683156108fc0284604051600060405180830381858888f193505050501515612b5e57600080fd5b600354640100000000900463ffffffff161515612b7d57612b7d612cd5565b505050505050565b60005433600160a060020a03908116911614612ba057600080fd5b600c805460ff191660ff92909216919091179055565b600854610100900461ffff1681565b60005433600160a060020a03908116911614612be057600080fd5b600160a060020a0381161515612bf557600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a03908116911614612c7b57600080fd5b6008805461ffff90921663010000000264ffff00000019909216919091179055565b6002805482908110612cab57fe5b9060005260206000209060089182820401919006600402915054906101000a900463ffffffff1681565b60001960005b60085461ffff61010090910481169082161015612dd4578163ffffffff1660028261ffff16815481101515612d0c57fe5b6000918252602090912060088204015460079091166004026101000a900463ffffffff16108015612d8c5750600660ff166004600060028461ffff16815481101515612d5457fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff16105b15612dcc576002805461ffff8316908110612da357fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1691505b600101612cdb565b506003805463ffffffff9092166401000000000267ffffffff0000000019909216919091179055565b600154600160a060020a0316ff5b600060028361ffff16815481101515612e2057fe5b6000918252602080832060088304015463ffffffff6004600790941684026101000a909104811680855292825260408085205460ff16855260099092529220805460001961ffff808316919091011661ffff19909116179055600354909250640100000000900416811415612ea1576003805467ffffffff00000000191690555b63ffffffff81166000908152600460205260409020805470ffffffffffffffffffffffffffffffffff19168155600101805473ffffffffffffffffffffffffffffffffffffffff191690556002805461ffff8416908110612efe57fe5b90600052602060002090600891828204019190066004029054906101000a900463ffffffff1660028461ffff16815481101515612f3757fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff16021790555060028261ffff16815481101515612f7d57fe5b90600052602060002090600891828204019190066004026101000a81549063ffffffff0219169055505050565b6000600143034042600860019054906101000a900461ffff1684604051938452602084019290925261ffff167e010000000000000000000000000000000000000000000000000000000000000260408084019190915260428301919091526062909101905190819003902092915050565b60008060028461ffff1681548110151561303157fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168083526012909152604082205490925060ff1611156130a15763ffffffff81166000908152601260205260408120805460ff19811660ff91821660001901909116179055915061310d565b6004600060028661ffff168154811015156130b857fe5b60009182526020808320600883040154600790921660040261010090810a90920463ffffffff16845283019390935260409091019020546000199490940193046001608060020a0316915061310d8484612e0b565b5092915050565b600080600061312161387a565b600354600090819081908190640100000000900463ffffffff16151561314957613149612cd5565b600354640100000000900463ffffffff908116146131c757600354640100000000900463ffffffff166000908152600460205260409020805470ffffffffffffffffffffffffffffffff00198116600a6001608060020a038d81169190910461010093849004821681019091169092021790915560090297506131cb565b8897505b600c9550856040518059106131dd5750595b90808252806020026020018201604052509450600093505b8560ff168460ff16101561326a5760ff841660009081526009602052604081205461ffff16111561325f576007805460ff861690811061323157fe5b90600052602060002090600291828204019190066010029054906101000a90046001608060020a0316870196505b6001909301926131f5565b600092505b8560ff168360ff16101561334e5760ff831660009081526009602052604081205461ffff1611156133435760ff83166000818152600960205260409020546007805461ffff909216926001608060020a038b169281106132cb57fe5b90600052602060002090600291828204019190066010029054906101000a90046001608060020a03168a026001608060020a031681151561330857fe5b046001608060020a031681151561331b57fe5b04858460ff168151811061332b57fe5b6001608060020a039092166020928302909101909101525b60019092019161326f565b5060005b60085461ffff610100909104811690821610156134b1576004600060028361ffff1681548110151561338057fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff908116925086168210156134a957846004600060028461ffff168154811015156133db57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff168151811061341b57fe5b906020019060200201516004600060028461ffff1681548110151561343c57fe5b60009182526020808320600883040154600790921660040261010090810a90920463ffffffff16845283019390935260409091019020805470ffffffffffffffffffffffffffffffff00198116908390046001608060020a03908116949094019093169091029190911790555b600101613352565b505050505050505050565b600854600090819081908190610100900461ffff166134da86612faa565b8115156134e357fe5b6008549190069350600761ffff6101009092048216061615613506576007613527565b600854600b61ffff610100909204821606161561352457600b613527565b600d5b60ff1691508290505b600660ff166004600060028461ffff1681548110151561354c57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff16835282019290925260400190205460ff161080156135ed575033600160a060020a03166004600060028461ffff168154811015156135ab57fe5b6000918252602080832060088304015460079092166004026101000a90910463ffffffff168352820192909252604001902060010154600160a060020a031614155b156135fa57809350613643565b60085461ffff6101009091048116908284011681151561361657fe5b06905061ffff8082169084161461362c57613530565b600860039054906101000a900461ffff1660010193505b505050919050565b60025461ffff821610156136a5578160028261ffff1681548110151561366d57fe5b90600052602060002090600891828204019190066004026101000a81548163ffffffff021916908363ffffffff160217905550610d6c565b60028054600181016136b783826138dd565b916000526020600020906008918282040191900660040284909190916101000a81548163ffffffff021916908363ffffffff160217905550505050565b6000806080519392505050565b63ffffffff811660009081526005602052604081205460ff161561372457600080fd5b5063ffffffff81166000908152600560209081526040808320805460ff19166001179055600490915290208054600660ff91909116101561376457600080fd5b60085461377b908390610100900461ffff1661364b565b6008805462ffff0019811660016101009283900461ffff9081168201811690930291909117909255825460ff1660009081526009602052604090819020805461ffff1981169084169094019092169290921790557f663f46f5a2fd740de613966ad0391fbc9d840f82898698e6d7f16ba0ed126b3b9083905163ffffffff909116815260200160405180910390a15050565b63ffffffff821660009081526012602052604090819020805460ff191660ff84161790557f088ba7785fd329abbf01eaa732bad30e14b205b9fc8ab9378f9f52957311355590839083905163ffffffff909216825260ff1660208201526040908101905180910390a15050565b60206040519081016040526000815290565b610140604051908101604052600a815b60008152600019909101906020018161389c5790505090565b5080546000825560070160089004906000526020600020908101906138da9190613916565b50565b8154818355818115116139115760070160089004816007016008900483600052602060002091820191016139119190613916565b505050565b61393091905b80821115611fb0576000815560010161391c565b905600a165627a7a72305820e375b10d3030d6872bd5bbc46d069fa40fcf3f5baf31b1db055798c4f0524d2a00290000000000000000000000008a01bc6a9358388588247127ff7be21b281b36d4000000000000000000000000ee7acd6b0fb65eebc11cf733fdc606619cf633d4000000000000000000000000d22d680d1fa045a07e8d335c1bb815ebfc4d4e5e000000000000000000000000822afedd7d48ed1056247747c8ed6df7f02b50fc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000003e8

    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://e375b10d3030d6872bd5bbc46d069fa40fcf3f5baf31b1db055798c4f0524d2a

 

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