Inspiration

I am a backend developer and have always wanted to do something in blockchain but I haven't been able to start while just surfing the web I came across this hackathon. I clearly remember _ 14 hours to deadline _ I thought of taking this challenge and coming up with something after thinking of some ideas I finalized Chain Lottery.

What it does

A simple lottery program where participants pay 0.01 ETH to enter, and the lottery is drawn every Sunday 00:00 UTC or after the 100th transaction, restarting after each draw. 20% of the pool prize will be held on contract for the future.

How we built it

  1. Create a Solidity smart contract defining an entry fee of 0.01 ETH, triggering a lottery draw either every Sunday at 00:00 UTC or after the 100th transaction. [ntegrate chainlink automation to manage the Sunday schedule. ]
  2. Implement a function to randomly select a winner, distribute the prize pool, and reset the lottery for the next round.
  3. Deploy the contract on the Polygon Mumbai, enabling participants to enter by sending 0.01 ETH, and interact with the contract using a web interface or blockchain explorer. CHATGPT have been great help to me while building

Challenges we ran into

  1. Figuring out how to pick the winner every Sunday.
  2. Deploying on test server. First I tried to deploy on Goerli but I didn't have any eth on mainnet so I can't even faucet ETH on testnet. After that, I found Polygon Mumbai.

Accomplishments that we're proud of

I have deployed a smart contract on the test Polygon Mumbai [Contract Address: 0x4750cf17D9538175c8b048a78a688046Afefdba6 ] I have something on the blockchain it's a very big accomplishment.

What we learned

I learned about chainlink, polygon, solidity, and many more.

What's next for Chain Lottery

I have to work on the UI of it first. It's just a prototype I have to work more on it.

Built With

Share this project:

Updates

Submission history