Project Story: KFC Crazy Thursday Smart Contract
Inspiration
The inspiration for this project comes from the popular "Crazy Thursday" promotion by KFC in China. Every Thursday, KFC offers significant discounts and special coupons, making it a highly anticipated day for many people. This has given rise to a meme where people humorously write stories or post in groups about their desire to get a free KFC meal, often playing up their situations or being humorous to try and get others to treat them. This cultural phenomenon sparked the idea to create a decentralized lottery system that operates on Thursdays, capturing the fun and excitement of Crazy Thursday in the form of a smart contract.
What We Learned
Through this project, we gained valuable insights into several key areas:
- Smart Contract Development: We deepened our understanding of Solidity, the programming language used for writing smart contracts on the Ethereum blockchain.
- Chainlink VRF and Keepers: We learned how to integrate Chainlink VRF (Verifiable Random Function) to ensure the randomness and fairness of the lottery selection process, and Chainlink Keepers to automate the weekly lottery draw.
- Decentralized Applications: We enhanced our knowledge of building decentralized applications (dApps) and the intricacies involved in deploying and maintaining them on the blockchain.
How We Built the Project
Conceptualization: We started by conceptualizing the project, drawing inspiration from the Crazy Thursday meme. We envisioned a fun, fair, and automated lottery system that would distribute all collected funds to a lucky participant every Thursday.
Smart Contract Development: Using Solidity, we wrote the smart contract to handle lottery entries, store funds, and execute the random selection of a winner. Chainlink VRF was integrated to ensure the randomness of the draw, and Chainlink Keepers were used to automate the lottery execution every Thursday.
Testing and Deployment: We rigorously tested the smart contract on Ethereum’s test networks to ensure its functionality and security. After thorough testing, we deployed the contract on the Ethereum mainnet.
Challenges Faced
Randomness and Fairness: Ensuring the randomness and fairness of the lottery selection was crucial. Integrating Chainlink VRF helped us achieve a reliable source of randomness, but it required us to learn and implement new concepts and technologies.
Automation: Automating the weekly lottery draw posed another challenge. Chainlink Keepers provided a solution, but integrating and configuring them correctly required significant effort and testing.
Gas Fees: High gas fees on the Ethereum network were a concern, as they could deter participants from entering the lottery. We optimized our contract to minimize gas usage and made sure to inform users about the potential costs.
Security: Security is paramount in any smart contract. We conducted multiple audits and peer reviews to ensure there were no vulnerabilities in our contract that could be exploited.
Conclusion
Building the KFC Crazy Thursday Smart Contract was an exciting journey that combined cultural elements with cutting-edge blockchain technology. We were inspired by a popular meme and turned it into a decentralized application that brings joy and excitement to participants every week. Through this project, we enhanced our technical skills, learned about new blockchain services, and overcame various challenges, ultimately delivering a fun and fair lottery system. We hope this project serves as a testament to the innovative potential of blockchain technology and its ability to bring cultural phenomena to life in new and engaging ways.
Built With
- ethscan
- javascript
- node.js
- solidity
Log in or sign up for Devpost to join the conversation.