Ticket Price: - • - Tickets Sold • - Total Tickets.
Uppon creation of a new lottery the contract's owner provides a keccak256() hash of a secure stored SERVER_SALT + SERVER_ROLL.
Then, after all lottery tickets have been sold, the owner will call finalizeLottery() method to close the lottery and reveal the SERVER_SALT and SERVER_ROLL to the contract. The contract will then verify the keccak256() matches the original provided hash for this SERVER_SALT and SERVER_ROLL and then will combine the SERVER_ROLL and the last ticket sale timestamp to create the final random number that will reveal the lottery winning ticket.
In this proccess that's called Provably Fair Gaming, if the owner of the lottery changes the original SERVER_ROLL pre-generated at the lottery's creation, the contract keccak256() check will simply fail and the lottery could not be closed, allowing the participans to claim a full refund of their tickets.
After this proccess is completed, the contract will put the lottery's winner funds on escrow for him to withdraw inmediately.
To add more certancy to the lottery, if the contract owner does not closes the lottery in a two hour frame from the sale of the last ticket, participans could call the contract lotteryCloseInsurance() method to claim for a 100% refund of their tickets.
Any participant with funds available to withdraw can call contract's withdraw() method anytime to get their funds into their ethereum wallet.