Open ferencdg opened 3 years ago
I think there are 2 smaller problems with this contract:
it seems you allow 38 different numbers, but a roulette only has 37 numbers: https://github.com/k26dr/ethereum-games/blob/3128272012f7dc6678332533aa97bad29411ba62/contracts/Gambling.sol#L114
you don't have any checks on the type of the bet here: https://github.com/k26dr/ethereum-games/blob/3128272012f7dc6678332533aa97bad29411ba62/contracts/Gambling.sol#L113
however you do check the type here: https://github.com/k26dr/ethereum-games/blob/3128272012f7dc6678332533aa97bad29411ba62/contracts/Gambling.sol#L133
this can cause bets accidentally submitted invalid BetTypes like 3 or 4 to be permanently stuck
Anyway, it was a great book overal, thank you!
I think there are 2 smaller problems with this contract:
it seems you allow 38 different numbers, but a roulette only has 37 numbers: https://github.com/k26dr/ethereum-games/blob/3128272012f7dc6678332533aa97bad29411ba62/contracts/Gambling.sol#L114
you don't have any checks on the type of the bet here: https://github.com/k26dr/ethereum-games/blob/3128272012f7dc6678332533aa97bad29411ba62/contracts/Gambling.sol#L113
however you do check the type here: https://github.com/k26dr/ethereum-games/blob/3128272012f7dc6678332533aa97bad29411ba62/contracts/Gambling.sol#L133
this can cause bets accidentally submitted invalid BetTypes like 3 or 4 to be permanently stuck
Anyway, it was a great book overal, thank you!