About this project

N2D Lottery is an innovative and exciting game that combines the thrill of traditional lottery with the power of blockchain technology. Unlike conventional lotteries, N2D Lottery pays out prizes in the form of your very own ERC-20 token, adding an extra layer of excitement and potential value for the players.

In N2D Lottery, participants will have the opportunity to choose six numbers of their preference. These numbers will be entered into the game system, and at regular intervals, the winning numbers will be drawn. If any player matches all the correct numbers, they will be awarded the coveted jackpot prize.

To bring this thrilling experience to life, we have developed a cutting-edge web front-end using NextJS. With NextJS, we can create a seamless and interactive user interface that allows players to easily engage with the game. The front-end will provide a user-friendly interface for buying tickets, checking the latest draw results, and claiming prizes.

The integration of Chainlink's powerful API technology is at the core of N2D Lottery. By utilizing Chainlink, we can obtain accurate and tamper-proof draw results directly from the blockchain. This ensures transparency and fairness, as players can trust that the winning numbers are determined through a decentralized and secure process.

As players buy tickets and participate in the lottery, their transactions will be processed on the blockchain, and the prize pool will grow accordingly. The value of the prize pool is denominated in the native ERC-20 token, which adds an exciting dimension to the game. As the token gains popularity and value, players not only have the chance to win prizes but also potentially increase their overall wealth.

N2D Lottery offers a captivating and immersive gaming experience, providing users with the opportunity to engage with blockchain technology in an exciting and entertaining way. Whether you're a seasoned lottery player or new to the world of blockchain, N2D Lottery welcomes players of all backgrounds to play, win, and be a part of the future of gaming.

Usage of Chainlink services

In our quest to create a truly fair and transparent lottery game, we have integrated Chainlink's powerful VRF (Verifiable Random Function) subscription service into our smart contract. This integration allows us to obtain secure and tamper-proof random numbers, ensuring the utmost integrity in the draw results.

With the Chainlink VRF subscription service, we can generate random numbers on-chain in a decentralized manner. This means that the generation process is not controlled by any single entity, making it impossible for anyone to manipulate the outcomes. By leveraging Chainlink's robust infrastructure, we can introduce a new level of trust and credibility to our lottery game.

In the context of N2D Lottery, the random number generation process is a crucial element in determining the winning numbers. When players purchase tickets and choose their six numbers, these selections are stored in an array within our smart contract. To ensure fairness, we need to sort this array in ascending order.

To accomplish this, we have implemented a bubble sort algorithm in our smart contract. Bubble sort is a simple yet effective sorting technique that compares adjacent elements and swaps them if they are in the wrong order. By repeatedly iterating through the array and performing these comparisons and swaps, we can achieve the desired sorted result.

However, for the sorting process to be truly unbiased and fair, we need randomization. This is where Chainlink's VRF subscription service comes into play. By subscribing to the VRF, we can obtain a secure random number from Chainlink's oracle network. This number will serve as the basis for our sorting algorithm, introducing an element of unpredictability to the process.

Once we receive the random number from the Chainlink VRF, we incorporate it into our bubble sort algorithm. This randomized sorting ensures that the order of the numbers is not predetermined or influenced by any external factors. The resulting sorted array represents the winning numbers for each draw, offering players a genuine chance at winning the jackpot.

By leveraging Chainlink's VRF subscription service and integrating it with our smart contract, we can guarantee the transparency and fairness of the N2D Lottery. Players can rest assured that the random number generation and sorting processes are conducted in a decentralized and secure manner, minimizing the risk of manipulation and providing an authentic gaming experience.

The usage of Chainlink's VRF subscription service not only enhances the integrity of our lottery game but also showcases the power of blockchain technology in delivering trust and fairness to various applications. Through our integration, we demonstrate how smart contracts can leverage decentralized oracle networks to access critical off-chain data and execute complex operations in a reliable and verifiable manner.

As we continue to develop the N2D Lottery and explore the capabilities of Chainlink's services, we are excited to unlock new possibilities in the world of gaming and beyond. The seamless integration of Chainlink's VRF subscription service with our smart contract ensures that players can enjoy a truly transparent and unbiased lottery experience, raising the bar for fairness and trust in the industry.

Built With

Share this project:

Updates