Skip to content

Conversation

@chrislennon
Copy link
Owner

@chrislennon chrislennon commented Jul 26, 2021

To start implementing features state of events will need to be tracked.

This PR starts to implement a database model using sequelize. This should allow for on disk sqlite3 and any implementation chosen for the production systems - on disk or actual database.

Coin Flip: An event where many users can enter, staking x Satoshis, random number generator decides the winner which takes the pool.

CoinFlip event creation

  • User should be able to create a CoinFlip event using a /coinflip [number of players] [number of sats for entry] command
  • CoinFlip listing should hold the creators discord ID, interaction ID, entry fee, number of players
  • User should only have one active CoinFlip at a time - CoinFlips should have an status open/closed/completed field
  • Creator should be able to cancel a CoinFlip

CoinFlip event joining

  • User should be able to select the join button creating them a record of entry
  • This record should save the discord Id, interaction ID
  • User should not be able to join if balance is insufficient
  • User should not be able to join more than once
  • On addition of the last entrant disable further joiners

CoinFlip Execution

  • When number of entrants == max number of players execute the dice roll
  • Subtract balance from losers, credit to winner
  • Post winning text in the discord event body

Notes & edge cases

  • User may have balance at time of entry but no balance to pay winners at execution/completion time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants