Solana lottery dApp
In this dApp where players can come and participate in lottery rounds where one person starts a lottery by specifying the price of a ticket. A random winner is then chosen to claim the total pot.
Created on 25th February 2023
•
Solana lottery dApp
In this dApp where players can come and participate in lottery rounds where one person starts a lottery by specifying the price of a ticket. A random winner is then chosen to claim the total pot.
The problem Solana lottery dApp solves
It solves the problem which many lottery and gambling platforms are accused of. RIGGING. First off , since it uses a solana smart contract as it's backend. It is assured that NOONE can ever break through your system to edit the backend code to favour a particular outcome since it is being fetched directly from the blockchain. Secondly , users pay and recieve SOLANA , which is a cryptocurrency and hence it reduces the use of paper based traditional currency which is harmful for the environment. And finally, its completely secure as the funds are transferred to the right wallet everytime as the logic for that is being fetched from the smart contract and unlike a web2 app where hackers can edit the backend code to steal the funds, its very difficult to do so in a smart contract.
Challenges I ran into
Writing the smart contract was a challange in itself. I ran into so many bugs which I had to resolve by going through the docs of solana , rust and anchor. Thankfully these docs were helpful but sometimes I didn't find the solution in the docs so I had to look through stackoverflow and other forums and on youtube. Then after completing the contract, I integrated its functionality into a next app which was the easy part cuz I'm cool with next.
Technologies used