Contract 0xcde881f8b37b41577c65a3904579fff6bb94f3c8

 

Contract Overview

Balance:
0.035133126806640625 Ether

EtherValue:
$4.32 (@ $122.92/ETH)
TxHash Block Age From To Value [TxFee]
0xe31463fbbd360bdf45fc44a98cd5f3d9ee010df97c51241370c5e274f263e7445298948331 days 3 hrs ago0x1e0dcc50c15581c4ad9cac663a8283dacca53271  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000067341
0x20c0672e25d6c7bbdf994347a03c2735d604154c2c8a628610dba869de85b48a5298948331 days 3 hrs ago0x1e0dcc50c15581c4ad9cac663a8283dacca53271  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000045428
0x7ca95516c691326d2a521dbfa12d8031fd6755b1ecf38bd3c1e23371b334e3e65298851331 days 3 hrs ago0xe3d1fc9b2c95dc12efb2caec104a92fb16da4de8  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000757525
0xe3e13777ee6ee982c45d4c71636179d7ade0488f56e8407ee4ec5c4db54f15975294248331 days 22 hrs ago0x1e0dcc50c15581c4ad9cac663a8283dacca53271  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.00005432174
0xe339f36679bdd0ee2405357e01a7a1915a7e6385f1f3590b41bb47a1fb64f9365294246331 days 22 hrs ago0x1e0dcc50c15581c4ad9cac663a8283dacca53271  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.00005496788
0xc48281a448ba268d2418af0776783c1d05dfc5ef253a425bde393d93e865c6af5292782332 days 4 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000089788
0x758d63f9ddc888734c7f3b65db9e12f690f83fc07cf7a6eab07c60a3e7b1b71b5292779332 days 4 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000532525
0x272117d99285ad0cc70d10aa1e2c19c508f4578b20fe6b9397aafa4c554665ca5286881333 days 4 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80.001 Ether0.001050192
0x180f273facf9463378ecd7dfb6b83d946b59196e3d40126eea863c929da5841e5286869333 days 4 hrs ago0xa683c1b815997a7fa38f6178c84675fc4c79ac2b  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80.001 Ether0.001215192
0x42f5a74f484918edc172e42baa584733f5733b8fc012cfd82bd9ff13c40c7fef5286864333 days 4 hrs ago0xa683c1b815997a7fa38f6178c84675fc4c79ac2b  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000269364
0x240fb1669c2c248bba3609eb4bf51add157e5208e0148ad217120357462e4fa45286862333 days 4 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000269364
0x8a5905f76e61b7be2702378978ed9703faab3ba0439dc33026ef35cf16cab84e5286857333 days 4 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.00127806
0x595b3e8923bf2b7f1b44d8d9c6853ea27ef4a3c4aabfab1cbc6bf33b2ed331d45280853334 days 4 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80.001 Ether0.001050192
0xc6512257c746eee2efbcc5b82a908a34604245f84395e37f25101fb5a56b182b5280848334 days 4 hrs ago0xa683c1b815997a7fa38f6178c84675fc4c79ac2b  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80.001 Ether0.001215192
0x21a07898c034211868e903ff67c5b8ef6844a7b593d4427bdf442d91f55e6aeb5280844334 days 4 hrs ago0xa683c1b815997a7fa38f6178c84675fc4c79ac2b  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000246917
0x1c92eefe5088fbc68d1532d2a5e389ee82022b80cee5520979041ad0d9997cf75280831334 days 4 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000246917
0xdc36d70901c7cbce2a1e44f70101ec60197c9832553de03fadc82002387068925280824334 days 4 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.001171555
0x48c8296a214259f1047ecf23435171030dbc0d643016401ff9a929a3f23208e05269486336 days 2 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80.003 Ether0.001145664
0x53637684f78846dfb72fd91bfa87ca9c00b0edfae3e7fb0f34d8a8085509631a5269480336 days 2 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000269364
0x95a19e1f80e7eb993d0e83f24bcc45bbc166fccb32842f05174d1d7f848499145269464336 days 2 hrs ago0xa683c1b815997a7fa38f6178c84675fc4c79ac2b  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80.003 Ether0.001325664
0xb2f4ea3137ed6bd31b57da36e482d0302173ee6b628d63a03bb8c3d7be159d995269459336 days 2 hrs ago0xa683c1b815997a7fa38f6178c84675fc4c79ac2b  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000269364
0x2e16c4b30c570d8764018e4f2803d0385349e60102b59900dbab8bb0341be0295269077336 days 4 hrs ago0x0dead0f75dea786f4ff8316da47a3beca0603047  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000532525
0x3813f469235799d89ef0bfd68ce80f4ad65594bb7364106fcf36b8b371d6d5a55261570337 days 10 hrs ago0xb03bef1d9659363a9357ab29a05941491accb4ec  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80.003 Ether0.001050192
0x9b2f8bc9f355ce30c3a496063ab021cb5e7dc511f10942349e14d2ddfef7cb215261566337 days 10 hrs ago0xa683c1b815997a7fa38f6178c84675fc4c79ac2b  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80.003 Ether0.001215192
0x4bc8ceaac5560f8abdb2a21a64a599099fb8072faf3c856f05caf8a59745b3575261559337 days 10 hrs ago0xa683c1b815997a7fa38f6178c84675fc4c79ac2b  IN   0xcde881f8b37b41577c65a3904579fff6bb94f3c80 Ether0.000246917
[ Download CSV Export 

Latest 22 Internal Transactions Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
0xe31463fbbd360bdf45fc44a98cd5f3d9ee010df97c51241370c5e274f263e7445298948331 days 3 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80x1e0dcc50c15581c4ad9cac663a8283dacca532710.017009980712890625 Ether
0xe3e13777ee6ee982c45d4c71636179d7ade0488f56e8407ee4ec5c4db54f15975294248331 days 22 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80x1e0dcc50c15581c4ad9cac663a8283dacca532710.0273348 Ether
0xc48281a448ba268d2418af0776783c1d05dfc5ef253a425bde393d93e865c6af5292782332 days 4 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xb03bef1d9659363a9357ab29a05941491accb4ec0.03401996142578125 Ether
0x42f5a74f484918edc172e42baa584733f5733b8fc012cfd82bd9ff13c40c7fef5286864333 days 4 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xa683c1b815997a7fa38f6178c84675fc4c79ac2b0.01772314609375 Ether
0x240fb1669c2c248bba3609eb4bf51add157e5208e0148ad217120357462e4fa45286862333 days 4 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xb03bef1d9659363a9357ab29a05941491accb4ec0.0665399228515625 Ether
0x21a07898c034211868e903ff67c5b8ef6844a7b593d4427bdf442d91f55e6aeb5280844334 days 4 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xa683c1b815997a7fa38f6178c84675fc4c79ac2b0.0350462921875 Ether
0x1c92eefe5088fbc68d1532d2a5e389ee82022b80cee5520979041ad0d9997cf75280831334 days 4 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xb03bef1d9659363a9357ab29a05941491accb4ec0.131579845703125 Ether
0x53637684f78846dfb72fd91bfa87ca9c00b0edfae3e7fb0f34d8a8085509631a5269480336 days 2 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xb03bef1d9659363a9357ab29a05941491accb4ec0.25865969140625 Ether
0xb2f4ea3137ed6bd31b57da36e482d0302173ee6b628d63a03bb8c3d7be159d995269459336 days 2 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xa683c1b815997a7fa38f6178c84675fc4c79ac2b0.068892584375 Ether
0x4bc8ceaac5560f8abdb2a21a64a599099fb8072faf3c856f05caf8a59745b3575261559337 days 10 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xa683c1b815997a7fa38f6178c84675fc4c79ac2b0.13658516875 Ether
0xb8594406d1e17391968d892b2cc7d823f42dec64993e41b5735f29965c2a18f55261555337 days 10 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xb03bef1d9659363a9357ab29a05941491accb4ec0.5128193828125 Ether
0x68bee947703dad7ff4830bffdfc1556255d4d8ca2635e1cbece4d8f9cb06edf35256727338 days 6 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xa683c1b815997a7fa38f6178c84675fc4c79ac2b0.2703703375 Ether
0x869266bc9690752a8866288cf2138547ac1b3d2487ed0c65617df5c4580682915256725338 days 6 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xb03bef1d9659363a9357ab29a05941491accb4ec1.015138765625 Ether
0x109b295f2a5ff44c45b7413d5fa82023df3baf8176b2eb7c4d62b4e01476302f5251895339 days 2 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xa683c1b815997a7fa38f6178c84675fc4c79ac2b0.531140675 Ether
0xe6a9ff91e0b13515c719bb8c63a3c1c031c2d0bdd10b6faf5ce8662e878ad6ab5251891339 days 2 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xb03bef1d9659363a9357ab29a05941491accb4ec1.99427753125 Ether
0x94fbe63113436690116d7bcff51929699ee6fd9d2faeea8fe11a91955d111fa65248409339 days 16 hrs ago0xd211168d8ee2baf6f411bf50b7ea73c852b44ba10xcde881f8b37b41577c65a3904579fff6bb94f3c80.02 Ether
0x2e942d5af0da3fd4649be76fa1f3e24323a62f7b149b8871c1b88133f4c6bfac5244829340 days 7 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xa683c1b815997a7fa38f6178c84675fc4c79ac2b1.03033175 Ether
0x0300046acfad9c47d54b900c8a310ae956b7fb4b3bb4decda0fcaf2dbd75084e5244829340 days 7 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xb03bef1d9659363a9357ab29a05941491accb4ec3.8687440625 Ether
0xf19b58c6849d441e7a5de34d22aff8ec751dbdcfcee99ab91b467b681cd170c95236559341 days 16 hrs ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80x1e0dcc50c15581c4ad9cac663a8283dacca532710.12300345 Ether
0xb99c5931203fc875c96f3c487bc4eaa92e841604f7befbde5a920d83eb8351825234542342 days 1 hr ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xb03bef1d9659363a9357ab29a05941491accb4ec7.119223375 Ether
0x45d5878b64607f7235d7f93c34f3fddc36e5ebee0cab45ba1ce42e053811dda75234542342 days 1 hr ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80xa683c1b815997a7fa38f6178c84675fc4c79ac2b1.8957929 Ether
0x0bc23f31e462e05fca6fb03a39501c188f4ffb2cb539c23951b0e8a6376499355228517343 days 1 hr ago0xcde881f8b37b41577c65a3904579fff6bb94f3c80x1e0dcc50c15581c4ad9cac663a8283dacca532710.83066325 Ether
[ Download CSV Export 
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: EthKing
Compiler Version: v0.4.19+commit.c4cbbb05
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.19;

/* King of the Hill, but with a twist

To with the pot, you must obtain 1 million points.
You obtain points by becoming and staying the King.
To become the King, you must pay 1% of the pot.
As the King, you earn (minutes)^2 points, where minutes
is the amount of time you remain King.

50% of the pot is used as an award, and the other 50%
seeds the pot for the next round.

20% of bids go to the bonus pot, which is given to the
second-place person when someone wins.

*/

contract EthKing {
	using SafeMath for uint256;

	// ------------------ Events -----------------------------

	event NewRound(
		uint _timestamp,
		uint _round,
		uint _initialMainPot,
		uint _initialBonusPot
  );

	event NewKingBid(
		uint _timestamp,
		address _address,
		uint _amount,
		uint _newMainPot,
		uint _newBonusPot
	);

	event PlaceChange(
		uint _timestamp,
		address _newFirst,
		address _newSecond,
		uint _firstPoints,
		uint _secondPoints
	);

	event Winner(
		uint _timestamp,
		address _first,
		uint _firstAmount,
		address _second,
		uint _secondAmount
	);

	event EarningsWithdrawal(
		uint _timestamp,
		address _address,
		uint _amount
	);

	// -------------------------------------------------------

	address owner;

	// ------------------ Game Constants ---------------------

	// Fraction of the previous pot used to seed the next pot
	// Currently 50%
	uint private constant NEXT_POT_FRAC_TOP = 1;
	uint private constant NEXT_POT_FRAC_BOT = 2;

	// Minimum fraction of the pot required to become the King
	// Currently 0.5%
	uint private constant MIN_LEADER_FRAC_TOP = 5;
	uint private constant MIN_LEADER_FRAC_BOT = 1000;

	// Fraction of each bid used for the bonus pot
	uint private constant BONUS_POT_FRAC_TOP = 20;
	uint private constant BONUS_POT_FRAC_BOT = 100;

	// Fractino of each bid used for the developer fee
	uint private constant DEV_FEE_FRAC_TOP = 5;
	uint private constant DEV_FEE_FRAC_BOT = 100;

	// Exponent for point calculation
	// Currently x^2
	uint private constant POINT_EXPONENT = 2;

	// How many points to win?
	uint private constant POINTS_TO_WIN = 1000000;
	
	// Null address for advancing round
    address null_address = address(0x0);

	// ----------------- Game Variables ----------------------

	// The current King, and when he was last put in power
	address public king;
	uint public crownedTime;

	// The current leader and the current 2nd-place leader
	address public first;
	address public second;

	// Player info
	struct Player {
		uint points;
		uint roundLastPlayed;
		uint winnings;
	}

	// Player mapping
	mapping (address => Player) private players;

	// Current round number
	uint public round;

	// Value of pot and bonus pot
	uint public mainPot;
	uint public bonusPot;

	// ----------------- Game Logic -------------------------

	function EthKing() public payable {
		// We should seed the game
		require(msg.value > 0);

		// Set owner and round
		owner = msg.sender;
		round = 1;

		// Calculate bonus pot and main pot
		uint _bonusPot = msg.value.mul(BONUS_POT_FRAC_TOP).div(BONUS_POT_FRAC_BOT);
		uint _mainPot = msg.value.sub(_bonusPot);

		// Make sure we didn't make a mistake
		require(_bonusPot + _mainPot <= msg.value);

		mainPot = _mainPot;
		bonusPot = _bonusPot;

		// Set owner as King
		// Crowned upon contract creation
		king = owner;
		first = null_address;
		second = null_address;
		crownedTime = now;
		players[owner].roundLastPlayed = round;
        players[owner].points = 0;
	}

	// Calculate and reward points to the current King
	// Should be called when the current King is being kicked out
	modifier payoutOldKingPoints {
		uint _pointsToAward = calculatePoints(crownedTime, now);
		players[king].points = players[king].points.add(_pointsToAward);

		// Check to see if King now is in first or second place.
		// If second place, just replace second place with King.
		// If first place, move first place down to second and King to first
		if (players[king].points > players[first].points) {
			second = first;
			first = king;

			PlaceChange(now, first, second, players[first].points, players[second].points);

		} else if (players[king].points > players[second].points && king != first) {
			second = king;

			PlaceChange(now, first, second, players[first].points, players[second].points);
		}

		_;
	}

	// Check current leader's points
	// Advances the round if he's at 1 million or greater
	// Pays out main pot and bonus pot
	modifier advanceRoundIfNeeded {
		if (players[first].points >= POINTS_TO_WIN) {
			// Calculate next pots and winnings
			uint _nextMainPot = mainPot.mul(NEXT_POT_FRAC_TOP).div(NEXT_POT_FRAC_BOT);
			uint _nextBonusPot = bonusPot.mul(NEXT_POT_FRAC_TOP).div(NEXT_POT_FRAC_BOT);

			uint _firstEarnings = mainPot.sub(_nextMainPot);
			uint _secondEarnings = bonusPot.sub(_nextBonusPot);

			players[first].winnings = players[first].winnings.add(_firstEarnings);
			players[second].winnings = players[second].winnings.add(_secondEarnings);

			// Advance round
			round++;
			mainPot = _nextMainPot;
			bonusPot = _nextBonusPot;

			// Reset first and second and King
			first = null_address;
			second = null_address;
			players[owner].roundLastPlayed = round;
			players[owner].points = 0;
			players[king].roundLastPlayed = round;
			players[king].points = 0;
			king = owner;
			crownedTime = now;

			NewRound(now, round, mainPot, bonusPot);
			PlaceChange(now, first, second, players[first].points, players[second].points);
		}

		_;
	}

	// Calculates the points a player earned in a given timer interval
	function calculatePoints(uint _earlierTime, uint _laterTime) private pure returns (uint) {
		// Earlier time could be the same as latertime (same block)
		// But it should never be later than laterTime!
		assert(_earlierTime <= _laterTime);

		// If crowned and dethroned on same block, no points
		if (_earlierTime == _laterTime) { return 0; }

		// Calculate points. Less than 1 minute is no payout
		uint timeElapsedInSeconds = _laterTime.sub(_earlierTime);
		if (timeElapsedInSeconds < 60) { return 0; }

		uint timeElapsedInMinutes = timeElapsedInSeconds.div(60);
		assert(timeElapsedInMinutes > 0);

		// 1000 minutes is an automatic win.
		if (timeElapsedInMinutes >= 1000) { return POINTS_TO_WIN; }

		return timeElapsedInMinutes**POINT_EXPONENT;
	}

	// Pays out current King
	// Advances round, if necessary
	// Makes sender King
	// Reverts if bid isn't high enough
	function becomeKing() public payable
		payoutOldKingPoints
		advanceRoundIfNeeded
	{
		// Calculate minimum bid amount
		uint _minLeaderAmount = mainPot.mul(MIN_LEADER_FRAC_TOP).div(MIN_LEADER_FRAC_BOT);
		require(msg.value >= _minLeaderAmount);

		uint _bidAmountToDeveloper = msg.value.mul(DEV_FEE_FRAC_TOP).div(DEV_FEE_FRAC_BOT);
		uint _bidAmountToBonusPot = msg.value.mul(BONUS_POT_FRAC_TOP).div(BONUS_POT_FRAC_BOT);
		uint _bidAmountToMainPot = msg.value.sub(_bidAmountToDeveloper).sub(_bidAmountToBonusPot);

		assert(_bidAmountToDeveloper + _bidAmountToBonusPot + _bidAmountToMainPot <= msg.value);

		// Transfer dev fee to owner's winnings
		players[owner].winnings = players[owner].winnings.add(_bidAmountToDeveloper);

		// Set new pot values
		mainPot = mainPot.add(_bidAmountToMainPot);
		bonusPot = bonusPot.add(_bidAmountToBonusPot);

		// Clear out King's points if they are from last round
		if (players[king].roundLastPlayed != round) {
			players[king].points = 0;	
		}
		
		// Set King
		king = msg.sender;
		players[king].roundLastPlayed = round;
		crownedTime = now;

		NewKingBid(now, king, msg.value, mainPot, bonusPot);
	}

	// Transfer players their winnings
	function withdrawEarnings() public {
		require(players[msg.sender].winnings > 0);
		assert(players[msg.sender].winnings <= this.balance);

		uint _amount = players[msg.sender].winnings;
		players[msg.sender].winnings = 0;

		EarningsWithdrawal(now, msg.sender, _amount);

		msg.sender.transfer(_amount);
	}

	// Fallback function.
	// If 0 ether, triggers tryAdvance()
	// If > 0 ether, triggers becomeKing()
	function () public payable {
		if (msg.value == 0) { tryAdvance(); }
		else { becomeKing(); }
	}

	// Utility function to advance the round / payout the winner
	function tryAdvance() public {
		// Calculate the King's current points.
		// If he's won, we payout and advance the round.
		// Equivalent to a bid, but without an actual bid.
		uint kingTotalPoints = calculatePoints(crownedTime, now) + players[king].points;
		if (kingTotalPoints >= POINTS_TO_WIN) { forceAdvance(); }
	}

	// Internal function called by tryAdvance if current King has won
	function forceAdvance() private payoutOldKingPoints advanceRoundIfNeeded { }
	
	// Gets a player's information
	function getPlayerInfo(address _player) public constant returns(uint, uint, uint) {
		return (players[_player].points, players[_player].roundLastPlayed, players[_player].winnings);
	}
	
	// Gets the sender's information
	function getMyInfo() public constant returns(uint, uint, uint) {
		return getPlayerInfo(msg.sender);		
	}
	
	// Get the King's current points
	function getKingPoints() public constant returns(uint) { return players[king].points; }
	
	// Get the first player's current points
	function getFirstPoints() public constant returns(uint) { return players[first].points; }
	
	// Get the second player's current points
	function getSecondPoints() public constant returns(uint) { return players[second].points; }
}

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
    /**
    * @dev Multiplies two numbers, throws on overflow.
    */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }
        uint256 c = a * b;
        assert(c / a == b);
        return c;
    }

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

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

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

Contract ABI
[{"constant":true,"inputs":[],"name":"round","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"first","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_player","type":"address"}],"name":"getPlayerInfo","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"second","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"becomeKing","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"tryAdvance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMyInfo","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"bonusPot","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"mainPot","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getFirstPoints","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getKingPoints","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawEarnings","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"crownedTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getSecondPoints","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"king","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":true,"stateMutability":"payable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_timestamp","type":"uint256"},{"indexed":false,"name":"_round","type":"uint256"},{"indexed":false,"name":"_initialMainPot","type":"uint256"},{"indexed":false,"name":"_initialBonusPot","type":"uint256"}],"name":"NewRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_timestamp","type":"uint256"},{"indexed":false,"name":"_address","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"},{"indexed":false,"name":"_newMainPot","type":"uint256"},{"indexed":false,"name":"_newBonusPot","type":"uint256"}],"name":"NewKingBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_timestamp","type":"uint256"},{"indexed":false,"name":"_newFirst","type":"address"},{"indexed":false,"name":"_newSecond","type":"address"},{"indexed":false,"name":"_firstPoints","type":"uint256"},{"indexed":false,"name":"_secondPoints","type":"uint256"}],"name":"PlaceChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_timestamp","type":"uint256"},{"indexed":false,"name":"_first","type":"address"},{"indexed":false,"name":"_firstAmount","type":"uint256"},{"indexed":false,"name":"_second","type":"address"},{"indexed":false,"name":"_secondAmount","type":"uint256"}],"name":"Winner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_timestamp","type":"uint256"},{"indexed":false,"name":"_address","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"EarningsWithdrawal","type":"event"}]

Contract Creation Code
606060405260018054600160a060020a0319169055600080348190116200002557600080fd5b60008054600160a060020a03191633600160a060020a031617905560016007556200007b6064620000663460146401000000006200011b8102620010211704565b906401000000006200104c6200015582021704565b9150620000973483640100000000620010636200016d82021704565b9050348282011115620000a957600080fd5b6008556009556000805460028054600160a060020a03928316600160a060020a0319918216811790925560018054600480549186169184168217905560058054909316179091554260035560075491845260066020526040808520909101919091558254909116825281205562000180565b6000808315156200013057600091506200014e565b508282028284828115156200014157fe5b04146200014a57fe5b8091505b5092915050565b60008082848115156200016457fe5b04949350505050565b6000828211156200017a57fe5b50900390565b6110c180620001906000396000f3006060604052600436106100da5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663146ca53181146100f85780633df4ddf41461011d578063593284011461014c5780635a8ac02d1461018f5780636708cc63146100ee5780636c1475ad146101a25780637daa10ce146101b557806381cd5eec146101c85780638f2ee2df146101db5780638f7d4dad146101ee578063aa64767314610201578063b73c6ce914610214578063ba9072ea14610227578063c11c0cc11461023a578063cc181ca81461024d575b3415156100ee576100e9610260565b6100f6565b6100f66102a0565b005b341561010357600080fd5b61010b610928565b60405190815260200160405180910390f35b341561012857600080fd5b61013061092e565b604051600160a060020a03909116815260200160405180910390f35b341561015757600080fd5b61016b600160a060020a036004351661093d565b60405180848152602001838152602001828152602001935050505060405180910390f35b341561019a57600080fd5b610130610965565b34156101ad57600080fd5b6100f6610260565b34156101c057600080fd5b61016b610974565b34156101d357600080fd5b61010b61098d565b34156101e657600080fd5b61010b610993565b34156101f957600080fd5b61010b610999565b341561020c57600080fd5b61010b6109b7565b341561021f57600080fd5b6100f66109d5565b341561023257600080fd5b61010b610ace565b341561024557600080fd5b61010b610ad4565b341561025857600080fd5b610130610af2565b600254600160a060020a03166000908152600660205260408120546003546102889042610b01565b019050620f4240811061029d5761029d610b84565b50565b60008060008060006102b460035442610b01565b600254600160a060020a03166000908152600660205260409020549091506102e2908263ffffffff61100716565b60028054600160a060020a0390811660009081526006602052604080822094909455600454821681528381205492549091168152919091205411156103c6576004805460058054600160a060020a03808416600160a060020a0319928316179283905560025481169190931617928390559181166000818152600660205260408082205494909316808252908390205460008051602061107683398151915294429490919051948552600160a060020a039384166020860152919092166040808501919091526060840192909252608083015260a0909101905180910390a16104a3565b600554600160a060020a0390811660009081526006602052604080822054600254909316825290205411801561040d5750600454600254600160a060020a03908116911614155b156104a35760025460058054600160a060020a031916600160a060020a039283161790819055600454821660008181526006602052604080822054939094168082529084902054600080516020611076833981519152944294919051948552600160a060020a039384166020860152919092166040808501919091526060840192909252608083015260a0909101905180910390a15b600454600160a060020a0316600090815260066020526040812054819081908190620f4240901061072e576104f560026104e9600160085461102190919063ffffffff16565b9063ffffffff61104c16565b935061051260026104e9600160095461102190919063ffffffff16565b600854909350610528908563ffffffff61106316565b60095490925061053e908463ffffffff61106316565b600454600160a060020a031660009081526006602052604090206002015490915061056f908363ffffffff61100716565b600454600160a060020a0390811660009081526006602052604080822060029081019490945560055490921681522001546105b0908263ffffffff61100716565b60058054600160a060020a0390811660009081526006602052604080822060029081019590955560078054600190810180835560088c815560098c8155835460048054918a16600160a060020a031992831681179091558a5482161790995586548816875285872084019290925585548716865284862086905583548954881687528587209093019290925587548616855283852085905593548754951694909516939093179094554260038190559154925490547fb5d8636ab45e6cac7a4a61cb7c77f77f61a454d73aa2e6139ff8dcaf463537e594929392518085815260200184815260200183815260200182815260200194505050505060405180910390a1600454600554600160a060020a0391821660008181526006602052604080822054939094168082529084902054600080516020611076833981519152944294919051948552600160a060020a039384166020860152919092166040808501919091526060840192909252608083015260a0909101905180910390a15b61074a6103e86104e9600560085461102190919063ffffffff16565b9850348990101561075a57600080fd5b61077060646104e934600563ffffffff61102116565b975061078860646104e934601463ffffffff61102116565b96506107aa8761079e348b63ffffffff61106316565b9063ffffffff61106316565b955034888801870111156107ba57fe5b60008054600160a060020a03168152600660205260409020600201546107e6908963ffffffff61100716565b60008054600160a060020a0316815260066020526040902060020155600854610815908763ffffffff61100716565b60085560095461082b908863ffffffff61100716565b600955600754600254600160a060020a03166000908152600660205260409020600101541461087057600254600160a060020a03166000908152600660205260408120555b60028054600160a060020a03191633600160a060020a0390811691909117808355600754908216600090815260066020526040908190206001019190915542600381905592546008546009547fba7431323f46ac3719ae2c8685fda2c5cae744de7d04a2c2850d6206d3c467229594929092169234929051948552600160a060020a0390931660208501526040808501929092526060840152608083019190915260a0909101905180910390a1505050505050505050565b60075481565b600454600160a060020a031681565b600160a060020a03166000908152600660205260409020805460018201546002909201549092565b600554600160a060020a031681565b60008060006109823361093d565b925092509250909192565b60095481565b60085481565b600454600160a060020a031660009081526006602052604090205490565b600254600160a060020a031660009081526006602052604090205490565b600160a060020a0333166000908152600660205260408120600201548190116109fd57600080fd5b600160a060020a033381166000908152600660205260409020600201543090911631901115610a2857fe5b5033600160a060020a038116600090815260066020526040808220600201805492905590917f9722cdc65dd852fc27a66eb73f3075ebafbfe00a914437ce1b7b8c8d9fcde12791429190849051928352600160a060020a0390911660208301526040808301919091526060909101905180910390a1600160a060020a03331681156108fc0282604051600060405180830381858888f19350505050151561029d57600080fd5b60035481565b600554600160a060020a031660009081526006602052604090205490565b600254600160a060020a031681565b6000808083851115610b0f57fe5b83851415610b205760009250610b7c565b610b30848663ffffffff61106316565b9150603c821015610b445760009250610b7c565b610b5582603c63ffffffff61104c16565b905060008111610b6157fe5b6103e88110610b7557620f42409250610b7c565b6002810a92505b505092915050565b6000610b9260035442610b01565b600254600160a060020a0316600090815260066020526040902054909150610bc0908263ffffffff61100716565b60028054600160a060020a039081166000908152600660205260408082209490945560045482168152838120549254909116815291909120541115610ca4576004805460058054600160a060020a03808416600160a060020a0319928316179283905560025481169190931617928390559181166000818152600660205260408082205494909316808252908390205460008051602061107683398151915294429490919051948552600160a060020a039384166020860152919092166040808501919091526060840192909252608083015260a0909101905180910390a1610d81565b600554600160a060020a03908116600090815260066020526040808220546002549093168252902054118015610ceb5750600454600254600160a060020a03908116911614155b15610d815760025460058054600160a060020a031916600160a060020a039283161790819055600454821660008181526006602052604080822054939094168082529084902054600080516020611076833981519152944294919051948552600160a060020a039384166020860152919092166040808501919091526060840192909252608083015260a0909101905180910390a15b600454600160a060020a0316600090815260066020526040812054819081908190620f4240901061100057610dc760026104e9600160085461102190919063ffffffff16565b9350610de460026104e9600160095461102190919063ffffffff16565b600854909350610dfa908563ffffffff61106316565b600954909250610e10908463ffffffff61106316565b600454600160a060020a0316600090815260066020526040902060020154909150610e41908363ffffffff61100716565b600454600160a060020a039081166000908152600660205260408082206002908101949094556005549092168152200154610e82908263ffffffff61100716565b60058054600160a060020a0390811660009081526006602052604080822060029081019590955560078054600190810180835560088c815560098c8155835460048054918a16600160a060020a031992831681179091558a5482161790995586548816875285872084019290925585548716865284862086905583548954881687528587209093019290925587548616855283852085905593548754951694909516939093179094554260038190559154925490547fb5d8636ab45e6cac7a4a61cb7c77f77f61a454d73aa2e6139ff8dcaf463537e594929392518085815260200184815260200183815260200182815260200194505050505060405180910390a1600454600554600160a060020a0391821660008181526006602052604080822054939094168082529084902054600080516020611076833981519152944294919051948552600160a060020a039384166020860152919092166040808501919091526060840192909252608083015260a0909101905180910390a15b5050505050565b60008282018381101561101657fe5b8091505b5092915050565b600080831515611034576000915061101a565b5082820282848281151561104457fe5b041461101657fe5b600080828481151561105a57fe5b04949350505050565b60008282111561106f57fe5b50900390560071c960b6df4a6d327a11790ddd078fcb97dcfdf70011981280641d0b207c376ea165627a7a723058208a4aaa6f85a6a433f39d3418c1d8d543cbbfefb4389aca39f408d0999542d49a0029


   Swarm Source:
bzzr://8a4aaa6f85a6a433f39d3418c1d8d543cbbfefb4389aca39f408d0999542d49a
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.