D
D
DELOT
Search…
Fully Automatic System
Chainlink Keepers is used as the solution to make lottery game can run endlessly.
Basically, Lottery Smart Contract is Keeper-compatible. Upkeep in Chainlink Keepers on the Mainnet: https://keepers.chain.link/bsc/54
“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.
    • Call to Chainlink VRF to get randomness numbers
    • Find winners based on random numbers
    • Reward the prize winners
    • Initialize new round
Copy link