My first Smart Contract (Lottery) 🥳 🥳 🥳 #1790
RobItu
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
Awesome! I will take a look. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
After completing the 🎉Solidity Basics🎉 I decided to integrate all that knowledge and make my first Smart Contract in Remix 🥳.
This is a special Lottery contract, where a predetermined number of players participate (entrance tickets cost 0.01ETH) and the winner, whose chosen at random, withdraws the funds. From what I've read, actual lottery companies give out 50% of their money as the prize and keep the remaining 50% as profit, so I used PaymentSplitter contract from OpenZeppelin to distribute the funds. I obtained a random number from Chainlink's VRF. Only one entry allowed per address (added only for complexity/practice purposes).
There was one bug that I still haven't been able to fix:
Took me almost a week to make this but I had tons of fun. Can't wait to revisit this project later and make it more gas efficient and more secured. Thank you for checking it out! I would love to hear your thoughts/criticisms on it 🤗
PS. And thank you @PatrickAlphaC for the great course!
Beta Was this translation helpful? Give feedback.
All reactions