Contract Overview
Balance: 0.414119138826096497 Ether
Ether Value: $84.38 (@ $203.75/ETH)
Transactions: 31 txns
 Latest 25 txns From a total of 31 Transactions

TxHash Age From To Value [TxFee]
0x1b75ea3ecad9b276a1037bfdc9dc626220d2360f57ad4db02126f57ea75150dc15 days 11 hrs ago0x0779d5536c81a1512aa29f4777648570c2bd2ad3  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.0001788
0x693236c1d4d076b05b52e4e476fdbf585eabf7996874c99b2222c123501154ae18 days 2 hrs ago0x88ace5f352adef0955ec085817ff72a4ea483b5f  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000179712
0x415d33fa0ee843ea2951315bdb0ffac935edd2394b83e53498bdf8bdf9e4080b74 days 17 hrs ago0x249130e0413678c6d348bde0f577955621c198a5  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.00124064
0x64c3ad9019294cd6687c9abca5ea868cfe521dc7c8fc9105a08b143f85ee526974 days 17 hrs ago0x115ea7b7bed23067417cb896316081ad7e686a03  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.0012528
0x5f313f034c13afeb333ded122ddefa5da7d65f9bcf173506ada94119eee85180133 days 8 hrs ago0xfe81103ae134f50d211c17c58746ed00408b7587  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000224055
0x793f2ac3bde847e4a31a1a83d53508e55739cf1207412cd751e60aa08f2f9d78142 days 6 hrs ago0x42410eef00529657afacc13bd1c5d99f40ba6bb7  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000171976
0xe946eabd5ad4a9ba4c0b0947f28a11ec06126ade3f29c727c92549a50e087c26142 days 6 hrs ago0x42410eef00529657afacc13bd1c5d99f40ba6bb7  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00.07194062259048 Ether0.000586368
0x9e9f9dd10ba50fdf3c0b8e6c3e5954333bd23158093baab085d1b389d785077e154 days 1 hr ago0xfe81103ae134f50d211c17c58746ed00408b7587  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000722496
0xc7ea1e86f08a57f292ee09e604f74d3c6271670aeb9ebc7ae9eb8a47a9a5b80e154 days 23 hrs ago0xd4f56fc512b4ec9c685cf104a482832af9e98849  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000123895
0x85844d3ea821f083ae051a0e7cc5e20a2aa3b58181a6a11ac1d217c7b35cfd72154 days 23 hrs ago0xd4f56fc512b4ec9c685cf104a482832af9e98849  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000123895
0x0894da250564d68b18e31e63a075d7dddb94fd35fe452d23032edb7e1813fbbf155 days 8 mins ago0x754e551b370ec001bab652ae31d75c737e11ffea  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.00050112
0x85fa06c70d9f20ad6b3c9e2374046de5bb2371229c3844b978c4b70ddfe23718155 days 11 mins ago0xd4f56fc512b4ec9c685cf104a482832af9e98849  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000429968
0xff5a7f8c07afc29d5cc4ea6d114e83a4a861020aff33dfcb7ed3f629e57ddc04156 days 9 hrs ago0x3ff7c3fdf357098e63867142a67abe7ae3ecd336  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000358488
0x4a47e95fa07360d70d1aff28639f25daab110f2d5cc8fcd01bc87d2f543980e7156 days 17 hrs ago0x0779d5536c81a1512aa29f4777648570c2bd2ad3  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00.07194062259048 Ether0.00036648
0xb508ec2cea3959f0f107e6830c990cb1a8bcaed1f167a7af3bba0589c4a4b5aa157 days 4 hrs ago0x3ff7c3fdf357098e63867142a67abe7ae3ecd336  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000358488
0xb1e81ab287c227194df6662258d6d6363926450cb7ceda1b409a8dd2e31ac4ed157 days 6 hrs ago0xa2c324ec1787e19b9933d7cb778642eb90e035d5  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000672165
0x3a24466cd2c28b28a37b0b49361f505138bc9b2a34eb05f902d68b2c988fe9d5157 days 9 hrs ago0x88ace5f352adef0955ec085817ff72a4ea483b5f  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00.07194062259048 Ether0.000659664
0xf86c2e723bb9a77f8b1f0e5a9bd47f571622259700433089f460c1b5530a2a89157 days 11 hrs ago0xa2c324ec1787e19b9933d7cb778642eb90e035d5  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.00059904
0x4c4eb8b61dee2e8336de2efe192c182d3c1c76e1714ecc840adb1666db584528157 days 22 hrs ago0x3ff7c3fdf357098e63867142a67abe7ae3ecd336  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.000726144
0xc9fbba549d38dafb183ab77efb120899d9c704282cee10cad10a978838498a4e158 days 31 mins ago0xa1681a9664e9e85dd7b0279e92687105fcef9be3  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00 Ether0.00024568
0xe223f5b601dfd2e3bab2a6c7e9e97489d43c798f777726925bb210dd1157f159158 days 33 mins ago0xa1681a9664e9e85dd7b0279e92687105fcef9be3  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00.07194062259048 Ether0.00073296
0x93073a35c497d75a6fb97074b6d0f111cfe5fd75198e8d4ff0937675893e43ba158 days 1 hr ago0xfe81103ae134f50d211c17c58746ed00408b7587  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00.07194062259048 Ether0.00109944
0xd5dec8d323539b7c58691b08f9c08f6ef51d7e79a884acfbeab00440cb0f88d2158 days 5 hrs ago0xa2c324ec1787e19b9933d7cb778642eb90e035d5  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00.07194062259048 Ether0.000952848
0xa9fc34b14a644ba09f473f0375198150c01bbf1b773d50e26a3b5e28cd602117158 days 7 hrs ago0xa46c36438af7a4672e26e0a0e6bb670bd9c64f07  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00.07194062259048 Ether0.000952848
0x3ca0c9c2aab6f2d6655adcb733863395df3eab2fb112a8561606600b5330ccae158 days 9 hrs ago0x3ff7c3fdf357098e63867142a67abe7ae3ecd336  IN   0x59ddfe4b465c5e057bf1501690af8ea3f565efd00.07194062259048 Ether0.000806256
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 13 Internal Transactions

ParentTxHash Block Age From To Value
0x1b75ea3ecad9b276a1037bfdc9dc626220d2360f57ad4db02126f57ea75150dc647567715 days 11 hrs ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00x0779d5536c81a1512aa29f4777648570c2bd2ad30.005533894045421538 Ether
0x693236c1d4d076b05b52e4e476fdbf585eabf7996874c99b2222c123501154ae645939818 days 2 hrs ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00x88ace5f352adef0955ec085817ff72a4ea483b5f0.011528945927961538 Ether
0x415d33fa0ee843ea2951315bdb0ffac935edd2394b83e53498bdf8bdf9e4080b612006974 days 17 hrs ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00x249130e0413678c6d348bde0f577955621c198a50.078904505201823416 Ether
0x64c3ad9019294cd6687c9abca5ea868cfe521dc7c8fc9105a08b143f85ee5269611997674 days 17 hrs ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00x115ea7b7bed23067417cb896316081ad7e686a030.120869868379603416 Ether
0x5f313f034c13afeb333ded122ddefa5da7d65f9bcf173506ada94119eee851805775722133 days 8 hrs ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00xfe81103ae134f50d211c17c58746ed00408b75870.005533894045421538 Ether
0x9e9f9dd10ba50fdf3c0b8e6c3e5954333bd23158093baab085d1b389d785077e5659080154 days 1 hr ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00xfe81103ae134f50d211c17c58746ed00408b75870.019729170740722545 Ether
0x0894da250564d68b18e31e63a075d7dddb94fd35fe452d23032edb7e1813fbbf5653718155 days 8 mins ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00x754e551b370ec001bab652ae31d75c737e11ffea0.151306285629421878 Ether
0x85fa06c70d9f20ad6b3c9e2374046de5bb2371229c3844b978c4b70ddfe237185653706155 days 11 mins ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00xd4f56fc512b4ec9c685cf104a482832af9e988490.058982486638305878 Ether
0xff5a7f8c07afc29d5cc4ea6d114e83a4a861020aff33dfcb7ed3f629e57ddc045645918156 days 9 hrs ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00x3ff7c3fdf357098e63867142a67abe7ae3ecd3360.00599505188254 Ether
0xb508ec2cea3959f0f107e6830c990cb1a8bcaed1f167a7af3bba0589c4a4b5aa5641316157 days 4 hrs ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00x3ff7c3fdf357098e63867142a67abe7ae3ecd3360.006540056599134545 Ether
0xb1e81ab287c227194df6662258d6d6363926450cb7ceda1b409a8dd2e31ac4ed5640901157 days 6 hrs ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00xa2c324ec1787e19b9933d7cb778642eb90e035d50.006540056599134545 Ether
0xf86c2e723bb9a77f8b1f0e5a9bd47f571622259700433089f460c1b5530a2a895639658157 days 11 hrs ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00xa2c324ec1787e19b9933d7cb778642eb90e035d50.015187464769101333 Ether
0x4c4eb8b61dee2e8336de2efe192c182d3c1c76e1714ecc840adb1666db5845285637214157 days 22 hrs ago0x59ddfe4b465c5e057bf1501690af8ea3f565efd00x3ff7c3fdf357098e63867142a67abe7ae3ecd3360.034457274391551333 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact Match)
Contract Name: CashCow
Compiler Text: v0.4.25-nightly.2018.5.16+commit.3897c367
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.0;
	contract CashCow {
	address public owner;
	uint256 private numberOfEntries;
	uint256 public cycleLength = 100;
	uint256 public price = 71940622590480000;
	uint256 public totalValue = 0;
	struct Player {
		uint256 lastCashOut;
		uint256[] entries;
	}
	// The address of the player and => the user info
	mapping(address => Player) public playerInfo;

	function() public payable {}

	constructor() public {
		owner = msg.sender;
		playerInfo[msg.sender].lastCashOut = 0;
		playerInfo[msg.sender].entries.push(numberOfEntries);
		numberOfEntries++;
	}

	function kill() public {
		if(msg.sender == owner) selfdestruct(owner);
	}


	//returns amount of ether a player is able to withdraw 
	function checkBalance(address player) public constant returns(uint256){
		uint256 lastCashOut = playerInfo[player].lastCashOut;
		uint256[] entries = playerInfo[player].entries;
		if(entries.length == 0){
			return 0;
		}
		uint256 totalBalance = 0;
		for(uint i = 0; i < entries.length; i++){
			uint256 entry = entries[i];
			uint256 cycle = entry / cycleLength;
			uint256 cycleEnd = (cycle+1) * cycleLength;
			//check if we have completed that cycle
			if(numberOfEntries >= cycleEnd) {
			    uint256 entryBalence;
				if(lastCashOut <= entry) {
					entryBalence = calculateBalance(entry % 100, 99);
					totalBalance += entryBalence;
				}
				if(lastCashOut > entry && lastCashOut < cycleEnd){
					entryBalence = calculateBalance(lastCashOut % 100, 99);
					totalBalance += entryBalence;
				}
			}
			if(numberOfEntries < cycleEnd) {
				if(lastCashOut <= entry) {
					entryBalence = calculateBalance(entry % 100, (numberOfEntries - 1) % 100);
					totalBalance += entryBalence;
				}
				if(lastCashOut > entry && lastCashOut < numberOfEntries){
					entryBalence = calculateBalance(lastCashOut % 100, (numberOfEntries - 1) % 100);
					totalBalance += entryBalence;
				}
			}
		}
		return totalBalance;
	}

	function calculateBalance(uint256 start, uint256 stop) public constant returns(uint256){
		if (start >= stop) return 0;
		uint256 balance  = 0;
		for(uint i = start + 1; i <= stop; i++) {
			balance += price / i;
		}
		return balance;
	}

	// buy into the contract
	function buy() public payable {
		require(msg.value >= price);
		playerInfo[msg.sender].entries.push(numberOfEntries);
		numberOfEntries++;
		totalValue += msg.value;
		//check if this starts a new cycle
		if(numberOfEntries % cycleLength == 0){
			playerInfo[owner].entries.push(numberOfEntries);
			numberOfEntries++;
		} 
	}


	function checkDeletable(address player) public constant returns(bool){
		uint256 finalEntry = playerInfo[player].entries[playerInfo[player].entries.length - 1];
		uint256 lastCycle = (finalEntry / cycleLength);
		uint256 cycleEnd = (lastCycle + 1) * cycleLength;
		return (numberOfEntries > cycleEnd);

	}

	function withdraw() public{
		uint256 balance = checkBalance(msg.sender); //check the balence to be withdrawn
		if(balance == 0) return;
		if(checkDeletable(msg.sender)){
			delete playerInfo[msg.sender];
		}
		else {
		    playerInfo[msg.sender].lastCashOut = numberOfEntries - 1;
		}
		totalValue -= balance;
		msg.sender.transfer(balance);
	}
}

    Contract ABI  
[{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"playerInfo","outputs":[{"name":"lastCashOut","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"player","type":"address"}],"name":"checkBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"price","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"buy","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"player","type":"address"}],"name":"checkDeletable","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"start","type":"uint256"},{"name":"stop","type":"uint256"}],"name":"calculateBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalValue","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cycleLength","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"}]

  Contract Creation Code Switch To Opcodes View
6080604052606460025566ff959d766d0e80600355600060045534801561002557600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016001549080600181540180825580915050906001820390600052602060002001600090919290919091505550600160008154809291906001019190505550610a228061013d6000396000f3006080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633ccfd60b146100b157806341c0e1b5146100c85780634b114691146100df5780635f515226146101365780638da5cb5b1461018d578063a035b1fe146101e4578063a6f2ae3a1461020f578063bb4c006c14610219578063c2108a9214610274578063d4c3eea0146102bf578063eac471a0146102ea575b005b3480156100bd57600080fd5b506100c6610315565b005b3480156100d457600080fd5b506100dd610444565b005b3480156100eb57600080fd5b50610120600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104d5565b6040518082815260200191505060405180910390f35b34801561014257600080fd5b50610177600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104f3565b6040518082815260200191505060405180910390f35b34801561019957600080fd5b506101a26106f3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b506101f9610718565b6040518082815260200191505060405180910390f35b61021761071e565b005b34801561022557600080fd5b5061025a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061087b565b604051808215151515815260200191505060405180910390f35b34801561028057600080fd5b506102a9600480360381019080803590602001909291908035906020019092919050505061094e565b6040518082815260200191505060405180910390f35b3480156102cb57600080fd5b506102d46109a4565b6040518082815260200191505060405180910390f35b3480156102f657600080fd5b506102ff6109aa565b6040518082815260200191505060405180910390f35b6000610320336104f3565b9050600081141561033057610441565b6103393361087b565b1561039d57600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008082016000905560018201600061039691906109b0565b50506103e9565b6001805403600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b806004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561043f573d6000803e3d6000fd5b505b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156104d3576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b565b60056020528060005260406000206000915090508060000154905081565b6000806000806000806000806000600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549750600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010196506000878054905014156105a057600098506106e6565b60009550600094505b86805490508510156106e25786858154811015156105c357fe5b90600052602060002001549350600254848115156105dd57fe5b049250600254600184010291508160015410151561065057838811151561061d5761061560648581151561060d57fe5b06606361094e565b905080860195505b838811801561062b57508188105b1561064f5761064760648981151561063f57fe5b06606361094e565b905080860195505b5b8160015410156106d55783881115156106915761068960648581151561067257fe5b066064600180540381151561068357fe5b0661094e565b905080860195505b83881180156106a1575060015488105b156106d4576106cc6064898115156106b557fe5b06606460018054038115156106c657fe5b0661094e565b905080860195505b5b84806001019550506105a9565b8598505b5050505050505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b600354341015151561072f57600080fd5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160015490806001815401808255809150509060018203906000526020600020016000909192909190915055506001600081548092919060010191905055503460046000828254019250508190555060006002546001548115156107d057fe5b06141561087957600560008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160015490806001815401808255809150509060018203906000526020600020016000909192909190915055506001600081548092919060010191905055505b565b600080600080600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001016001600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101805490500381548110151561091857fe5b906000526020600020015492506002548381151561093257fe5b0491506002546001830102905080600154119350505050919050565b60008060008385101515610965576000925061099c565b600091506001850190505b8381111515610998578060035481151561098657fe5b04820191508080600101915050610970565b8192505b505092915050565b60045481565b60025481565b50805460008255906000526020600020908101906109ce91906109d1565b50565b6109f391905b808211156109ef5760008160009055506001016109d7565b5090565b905600a165627a7a72305820d5f82d117947a6b8390fc36071dbc9c011c71fdaefe3cce6249ca22d5e1ad74c0029

   Swarm Source:
bzzr://d5f82d117947a6b8390fc36071dbc9c011c71fdaefe3cce6249ca22d5e1ad74c

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.