k26dr/ethereum-games

CasinoRoulette issues

Opened this issue · 0 comments

I think there are 2 smaller problems with this contract:

  1. it seems you allow 38 different numbers, but a roulette only has 37 numbers:

    require(choice >= -1 && choice <= 36);

  2. you don't have any checks on the type of the bet here:

however you do check the type here:

else if (bet.betType == BetType.Number) {

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!