Comment on page
Fully Automatic System
“performUpkeep” function in Lottery Smart Contract is designed to:
- Change state of a round: Start -> Active -> End
- Round state is Start: proceed to transfer tokens from Auto Pool to Lottery Pool based on settings in Auto Pool of players.
- Round state is End:
- Recalculate tickets of players, reset Hold Tickets to zero if they do not hold enough token as recognized in the first deposit.
- Find winners based on random numbers
- Reward the prize winners
- Initialize new round