Dice Betting

Custom purpose

Call placeBet with minimum minBet and maximum maxBet. The hash of the block generated 2 blocks later from the bet will be used to calculate a random number between 1 and 100. If the number is less or equal to 49 (2% edge for the house) - the bet is winning and a bet*2 prize is sent to the bettor.


  1. feePercent:_ sets the fee percent
  2. minBet: sets minimum bet in ether
  3. maxBet: sets maximum bet in ether

Exposed methods

  1. fallback
  2. remainingBets gets the remaining bets
  3. owner gets the owner
  4. house gets the house amount
  5. getPseudoRandom gets pseudo random
  6. bets gets the bets value from bets array
  7. checkWinners gets the winners
  8. placeBet gets the winners
  9. setFeeAccount sets the fee account
  10. setFeePercent sets the fee percent
  11. setMaxBet sets the maximum bet
  12. setMinBet sets the minimum bet
  13. transferOwnership sets new owner account


  • feePercent:_ 5
  • minBet: 1
  • maxBet: 10
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract