Inspiration

I love PDLs and Hedera and wanted to improve my skills and practice developing with Hedera. I had the idea to make a decentralized lottery (though of course I am not the first!) and typically when I put my mind to doing something I will do it.

What it does

Participants send Hbar to smart contract which will then randomly select a winner and send them the money. In the future 50% of the innings will go to a charity which is voted on by the winner.

How I built it

Using NextJS React framework for the front end and API. Solidity for the contracts. Canva and photoshop for graphics

Challenges I ran into

Mainly time pressure. Currently I have university exams / finals and am also running a student storage business so have a lot on my plate

Accomplishments that I'm proud of

Successfully integrating the smart contract service into my idea. Initially it was only using the native HTS with the js sdk and used NFTs as the lottery tickets. The winner would be picked from random out of the owners of the NFTs. This is less decentralized and requires more human-time than compared with a smart contract

What I learnt

  • Connecting hashpack to webapp for signing transactions
  • Deeper understanding of the Hedera Hashgraph
  • Improved navigation around the docs

What's next for Hash Raffle

Next I want to use the smart contract service to send the buyer an NFT / FT so that they receive something tangible in return for their entry. This could also then be used by them to cast their vote of the charity they would like to pick (the idea is that 50% of the money to the smart contract will go to charity, though this hasn't been integrated in yet). I also want to post regular content for the social media.

Long term, I would like to add more games into the web app and support for different languages. One of my favourite parts about PDLs is that it does no matter where you are in the world you can take part!

NOTE: the link added to the live website (https://hashraffle.com) does NOT use the smart contract service. That is just a link to the current live project

Built With

Share this project:

Updates