Lottery Process
Last updated
Last updated
Each Lottery is encoded through the platform’s Manager Smart Contract (MSC), which controls and holds the creation, running, entering, finishing, and outcomes of a lottery. It is initialized with a Sponsor’s address and lottery parameters, then holds the pool of weighted tickets staked by Participants emitting events with each stake. As interactions with the Lottery take place a subgraph is generated which is used for UI, data analysis and most importantly, the off-chain computation and selection of winners.
In parallel to the MSC, a separate smart contract called the Asset Smart Contract (ASC) creates the NFTs representing claims to the lottery items (be they physical or digital). It is these NFTs that are transferred to the winners at the end of the lottery. The ASC utilizes an extendable ERC1155 protocol and also holds all Sponsor tokens and the platform treasury.
At the end date and time of the lottery (determined by the parameters), the smart contract acquires a random number from Chainlink’s VRF. An off-chain deterministic function, living on a Decentralized Oracle Network, calls the random number and ticket data subgraph from the MSC to determine the winners, and sends the list back on chain to both the MSC and the ASC.