L

Lucky You

Your one GOLDEN way to CREATE and PARTICIPATE in giveaways of MATIC tokens

Carousel Gallery Item: 1
Carousel Gallery Item: 2
Carousel Gallery Item: 3
Carousel Gallery Item: 4
Carousel Gallery Item: 5

Last updated: 03 April 2022 03:05 PM

Flowchart Added

The problem Lucky You solves

Giveaway Scams

In Web2, there are many platforms where giveaways are controlled and maintained by middleman or middleware who claim to take care of the users funds which leads to scam where users lose their money and are retricted of the visibility to see how the platform works and its functioning. Often times they don't even declare the winners of the giveaways and keep the funds of the users into their pockets.

To prevent this, we the CHANAKYAs are presenting LUCKY YOU, a decentralised platform where you can create and participate in giveaways of Matic tokens. Since LUCKY YOU is built on blockchain, the law of code the smart contract has functions to create, participate, decalare winner, transferring amount and minting NFT's with full legitimacy. The users can view the contract and the functioning of LUCKY YOU, so that no scamming is involved.
We have used CHAINLINK to generate random number for declaring a winner when the giveaway ends.
We have used GELATO to automate contract to call endGiveaway() function when the time reaches deadline of a specific giveaway.

Features offered by LuckYou:

  • Creation and Participation in Giveaways of Matic tokens.

  • The winners can mint NFTs of the colour of their choice and can flex it to their friends.

  • Users can check the progress of the giveaway by heading over to Gelato Ops by clicking on Gelato Ops.

  • Users can provide with social links so that viewers could visit them.

  • Every NFT minted at LuckyYou is unique and spectacular.

  • Users can also sell their NFTs on Opensea which is the biggest NFT Marketplace.

Example of the NFTs minted using LuckyYou

Understand LuckyYou with help of a flowchart

Go Checkout LuckyYou 🚀

Challenges we ran into

Random No. Generation - CHAINLINK

Since in Blockchain, everything is visible to everyone, if we would have written an algorithm for generating a random nuumber in our smart contract, then people would have cheated and misused it to win every giveaway. So to prevent thant we learnt about CHAINLINK and used it to generate random number off the chain which is then used to declare a winner form a list of participants of a particular giveaway. We have use VRF v1 to generate random number. CHAINLINK takes its part only when the time reaches deadline of specific giveaway and then GELATO call the endGiveaway() function after which CHAINLINK comes into part.

Automating Smart Contract

In Blockchain, nothing works automatically, so to call endGiveaway() function we used GELATO services through which every Giveaway has its own specific taskID to distinguish and the function is called when the time reaches deadline.

We wanted to end a giveaway once its deadline has been reached. For this, we needed our smart contract to call a endgiveaway() function at that time. To call this function at a particular time, for every giveaway, we had two options either we build a custom bot or use the decentralised network of bots on Gelato network to automate our smart contract. Building a bot had many vulnerabilities like if it goes down our whole dapp breaks, it lacks decentralization, building it would have been a cumbersome task, etc. Gelato Ops solved all these issues. In addition, Gelato being available on multi-chains helped us to test our dapp on testnet, whereas in case of custom bots we would have to create a different bot for mainnet and testnet chains separately.

Discussion