The technical flow on the platform for the player happens in two transaction and goes as follows:
The first transaction consists of placing the wager and paying the VRF fee (1):
- A player calls the play function on any Game Contract and places a wager. The wager (bet token) is transferred to the Game Contract.
- 2.VRF fee
- The VRF fee is charged in the native token.
- For chains using Chainlink VRF, the VRF fee is transferred to the Game Contract and in the same transaction a refund of the VRF fee is sent to the player when the player has paid too much.
- For chains using Randomizer VRF, the VRF fee is sent to the Randomizer contract. If a player has overpaid for the VRF, the player will get a refund back the next time they play the same game.
- 1.The Game Contract makes an RNG request to the VRF Contract to supply the necessary random numbers. (2)
- 2.The VRF Contract resolves the request of the random numbers and informs the Game Contract. (3)
- 3.The Game Contract determines the outcome and transfers the wager to the Diamond Contract (bankroll) (4).
- 4.When the player draws or wins, the bankroll sends the payout to the player at the same time. (5)
- 1.When the player loses, there is no payout and the bankroll keeps the wager.
Note: player's funds are never at risk. If the VRF request fails or if the bankroll can't payout, the transaction either reverts or the wager gets stuck in the Game Contract. The player can then remove their bet with the refund function at Pending VRF Requests on their profile page.