BetGod (OP)
Newbie
Offline
Activity: 42
Merit: 0
|
|
March 30, 2016, 11:31:11 PM Last edit: April 07, 2016, 08:31:05 AM by BetGod |
|
|
|
|
|
BetGod (OP)
Newbie
Offline
Activity: 42
Merit: 0
|
|
March 30, 2016, 11:36:25 PM |
|
I`ve filled up the balance with 1 Ethereum to get started, I believe this casino will grow big, we are the first ones that do work without bugs! Happy gambling, good luck!
|
|
|
|
clangtrump
|
|
March 31, 2016, 12:21:52 AM |
|
I`ve talked with BetGod over Skype a few hours ago, and I`ve also reviewed his code, and from my 8 year javascript programming experience and from my proven stable and working TreasureChest contract track-record, I can safely say that his code is safe. Keep up the good work, we need ethereum casinos too!
|
|
|
|
Katatsuki
|
|
March 31, 2016, 11:25:11 AM |
|
I don't really have time to test the code right now, but I'd be quite cautious, there are some quite sketchy things about it. if(uint(sha3(gamblerlist[list_length].etherAddress)) % 2==0 && list_length % 2==0 && Bankroll > 0) //if the hashed length of your address is even, { //which is a 25% chance, then you get paid out all balance! gamblerlist[list_length].etherAddress.send(Bankroll); //send pay out to participant Total_Payouts += Bankroll; //update paid out amount Bankroll = 0; //bankroll update } I could be wrong, but as far as I know, sha3 always returns the same hash given a certain input. In other words, if you address' hash % 2 isn't 0, it will never be, and so, you'll never get to win no matter how many times you try. I haven't checked yet, but I bet the the owner's address (or an alternative account of his, if he's smart) conveniently matches the criteria. I'll report back with results soon. Another thing I find odd is this: // payout fees to the owner if (Fees != 0) { owner.send(Fees); //send fee to owner Total_Payouts+=Fees; //update paid out amount } Why count the money the owner gets from fees as a payout? It's a bit misleading. Also, there are no dice involved here, the payout logic depends on your position in the entries list and the aforementioned hash result. Hardly random.
|
|
|
|
Lutpin
Copper Member
Legendary
Offline
Activity: 1904
Merit: 1874
Goodbye, Z.
|
|
March 31, 2016, 11:28:01 AM |
|
If we're talking about the first working Ether dice game, I think we at crypto-games.net have beaten you to that. Of course, it's not using smart contracts, but you didn't specify that in your thread title.
|
| | | | ███████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ███████ | | | |
▄████████████████████████████████████████████████████████████▄ ██ ▄▄▄▄▄▄ ██ ██ ██████ ▄██████████▄ ████████████████████▀ ██ ████████ ▄████▀ ▀████▄ ████▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ██ ████ ████ ████▀ ▀██▀ ████ ██ ████ ████ ▄███▀ ████ ██ ████ ████ ███▀ ████▄▄▄▄▄▄▄▄▄▄ ██ ████ ████ ███ ██████████████ ██ ████ ████ ███▄ ████▀▀▀▀▀▀▀▀▀▀ ██ ████████████████████ ▀████ ████ ██ ██████████████████████ ▀████▄ ▄██▄ ████ ██ ████ ████ ▀████▄ ▄████▀ ████▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ██ ████ ████ ▀██████████▀ ████████████████████▄ ██ ▀▀▀▀▀▀ ██ ▀█████████████████████████████████████████████████████████████████████▀ | | |
|
|
|
BetGod (OP)
Newbie
Offline
Activity: 42
Merit: 0
|
|
March 31, 2016, 02:24:13 PM Last edit: March 31, 2016, 02:35:41 PM by BetGod |
|
Good questions, let me address them! I don't really have time to test the code right now, but I'd be quite cautious, there are some quite sketchy things about it.
I could be wrong, but as far as I know, sha3 always returns the same hash given a certain input. In other words, if you address' hash % 2 isn't 0, it will never be, and so, you'll never get to win no matter how many times you try. I haven't checked yet, but I bet the the owner's address (or an alternative account of his, if he's smart) conveniently matches the criteria. I'll report back with results soon.
Also, there are no dice involved here, the payout logic depends on your position in the entries list and the aforementioned hash result. Hardly random.
Yes you are definitely wrong, the sha3 hash returns the hash of the input (address), which is a long sequence of bytes in the byte32 format. I have specifically read the manual and I`m familiar with all variable types. The '%' operator is the MOD operator, which is either 1 or 0, so we take the length of the byres in uint format, it will be a long number, and we see if the number is odd or even (50% chance), Then we take the order of the depositor, either odd or even, wich is also 50%. That gives us a mix of 25% chance. (50% * 50% /100) Its the best random number generator system currently available since there is no RAND() function in solidity yet. // payout fees to the owner if (Fees != 0) { owner.send(Fees); //send fee to owner Total_Payouts+=Fees; //update paid out amount } Why count the money the owner gets from fees as a payout? It's a bit misleading. It's still a payout. The money goes in is the total deposit, and the money that goes out is the total payout. Therefore you can see how much money went in and went out. And you can calculate the fees from that.
|
|
|
|
BetGod (OP)
Newbie
Offline
Activity: 42
Merit: 0
|
|
March 31, 2016, 02:27:37 PM |
|
If we're talking about the first working Ether dice game, I think we at crypto-games.net have beaten you to that. Of course, it's not using smart contracts, but you didn't specify that in your thread title. Ok I changed the title, it's a DAPP game. Plus there was another dice game but their code was broken. So we are the first working ether dice dapp game!
|
|
|
|
Katatsuki
|
|
March 31, 2016, 02:41:26 PM |
|
Yes you are definitely wrong, the sha3 hash returns the hash of the input (address), which is a long sequence of bytes in the byte32 format.
I have specifically read the manual and I`m familiar with all variable types.
The '%' operator is the MOD operator, which is either 1 or 0, so we take the length of the byres in uint format, it will be a long number, and we see if the number is odd or even (50% chance),
In your current implementation you're only hashing the address, maybe you intended to hash the address with the length of the array sha3(address, array.length). The result will always be the same the way it's coded.
|
|
|
|
BetGod (OP)
Newbie
Offline
Activity: 42
Merit: 0
|
|
March 31, 2016, 02:44:37 PM |
|
Yes you are definitely wrong, the sha3 hash returns the hash of the input (address), which is a long sequence of bytes in the byte32 format.
I have specifically read the manual and I`m familiar with all variable types.
The '%' operator is the MOD operator, which is either 1 or 0, so we take the length of the byres in uint format, it will be a long number, and we see if the number is odd or even (50% chance),
In your current implementation you're only hashing the address, maybe you intended to hash the address with the length of the array sha3(address, array.length). The result will always be the same the way it's coded. Different from different addresses. That is why the order variable is there. Depends on what order you deposit. So that is 2 sources of entropy. sha3(address, array.length) that is the same as sha3(address) && array.length %2 from randomness standpoint.
|
|
|
|
Katatsuki
|
|
March 31, 2016, 03:08:29 PM |
|
Yes you are definitely wrong, the sha3 hash returns the hash of the input (address), which is a long sequence of bytes in the byte32 format.
I have specifically read the manual and I`m familiar with all variable types.
The '%' operator is the MOD operator, which is either 1 or 0, so we take the length of the byres in uint format, it will be a long number, and we see if the number is odd or even (50% chance),
In your current implementation you're only hashing the address, maybe you intended to hash the address with the length of the array sha3(address, array.length). The result will always be the same the way it's coded. Different from different addresses. That is why the order variable is there. Depends on what order you deposit. So that is 2 sources of entropy. sha3(address, array.length) that is the same as sha3(address) && array.length %2 from randomness standpoint. Well, I'd love to hear other people's opinions. I'm pretty sure it's not the same. If someone's address' hash % 2 is not 0 it will never be 0, it's a static value. That makes that person unable to win in this game. If (false && true) always returns false. Only people whose address matches the criteria can win if the array's length is even. If you had used the formula I mentioned that would be different, because then the first result can be true or false depending on the length. Edit: Either way, even if it worked the way you want it to, people can simply calculate the result before playing, thus knowing beforehand if they're gonna win or lose. There's nothing random about this.
|
|
|
|
sHeRiLyN1618
|
|
March 31, 2016, 07:48:30 PM |
|
Wow its very exciting to see a gambling game finally!
I will play here!
|
|
|
|
|
sHeRiLyN1618
|
|
April 01, 2016, 05:11:34 PM |
|
I was one of the depositors Unfortunately i`m not the winner, but i`ll gamble again soon, and next time i`ll be the winner
|
|
|
|
clangtrump
|
|
April 01, 2016, 08:49:31 PM |
|
Nice to see that ethereum now has a working dice game, i can only wonder what other good inventions we will see soon
|
|
|
|
likegames
Newbie
Offline
Activity: 26
Merit: 0
|
|
April 02, 2016, 10:19:42 PM |
|
Nice to see that ethereum now has a working dice game, i can only wonder what other good inventions we will see soon This one is working too -> Bet On Hash It's similar to a dice game. 6 people are playing in a round and the lucky ones will win.
|
|
|
|
DustBluster
Member
Offline
Activity: 76
Merit: 10
Play Shiny Squirrels - Multiply Your Ether
|
|
April 03, 2016, 01:52:38 AM |
|
This is in NO WAY random. It is deterministic and predictable. I wrote a little contract in Solidity to demonstrate: https://chriseth.github.io/browser-solidity/?gist=c4432bc46c6733652a4e784ed1efc20econtract EthereumDiceDebunker { function wouldIWinDice(uint list_length) constant returns (bool result) { result = uint(sha3(msg.sender)) % 2==0 && list_length % 2==0 ; }
function wouldTheyWinDice(uint list_length, address them) constant returns (bool result) { result = (uint(sha3(them)) % 2==0 && list_length % 2==0) ; } }
These are the completely predictable results I receive when testing with various combinations of list_length and address: This address never wins: false == wouldTheyWinDice(1, "0x446D1696a5527018453cdA3d67aa4C2cd189b9f6") false == wouldTheyWinDice(2, "0x446D1696a5527018453cdA3d67aa4C2cd189b9f6") false == wouldTheyWinDice(3, "0x446D1696a5527018453cdA3d67aa4C2cd189b9f6") false == wouldTheyWinDice(4, "0x446D1696a5527018453cdA3d67aa4C2cd189b9f6") This address wins when list length is even: true == wouldTheyWinDice(0, "0xd7AAC26DA63A9B3e4beF54b5585A563A6ca248F9") false == wouldTheyWinDice(1, "0xd7AAC26DA63A9B3e4beF54b5585A563A6ca248F9") true == wouldTheyWinDice(2, "0xd7AAC26DA63A9B3e4beF54b5585A563A6ca248F9") false == wouldTheyWinDice(3, "0xd7AAC26DA63A9B3e4beF54b5585A563A6ca248F9") This address also wins when list length is even: true == wouldTheyWinDice(0, "0xdAe545ef6946d833b6a2B34b3d8823da2788718a") false == wouldTheyWinDice(1, "0xdAe545ef6946d833b6a2B34b3d8823da2788718a") true == wouldTheyWinDice(2, "0xdAe545ef6946d833b6a2B34b3d8823da2788718a") false == wouldTheyWinDice(3, "0xdAe545ef6946d833b6a2B34b3d8823da2788718a") In reality, you have a 0% or a 100% chance of winning based on conditions which can be known in advance.
|
|
|
|
BetGod (OP)
Newbie
Offline
Activity: 42
Merit: 0
|
|
April 03, 2016, 02:52:46 AM |
|
This is in NO WAY random.
I will have to look into it.
|
|
|
|
losoya
|
|
April 03, 2016, 03:57:29 AM |
|
Interesting dice game, i just made a wealth fountain a few days ago and it works, you can maybe check it out!
|
|
|
|
|