Inspiration

Having participated in numerous Twitter giveaways and other social media contests, I realized that a significant majority of them (around 90%) are scams designed to gain followers without any intention of rewarding participants. This rampant fraud motivated me to think about a decentralized solution that would restore trust in social media giveaways and prevent everyone from labeling them as scams.

What It Does

RaffleFair decentralizes giveaways on social platforms. Although I couldn't access the Twitter (X) API due to its high cost, the smart contract is fully functional. Here’s how it works:

  1. Add Giveaway: Users can create a giveaway by specifying the amount, the end time, and the number of winners.
  2. Smart Contract: The giveaway details are stored in a smart contract, which locks the funds until the giveaway ends.
  3. Node.js Integration: Once the time reaches, the system automatically retrieves the giveaway details. The Node.js server processes the entries and selects the winners.
  4. Chainlink Integration: Using Chainlink's time automation and external adapters, the smart contract calls the Node.js server to get the list of winners.
  5. Funds Distribution: The smart contract then distributes the funds to the winners. A 1% fee is taken as a service fee, and the rest is transferred to the winners.

Although we are currently not using any social media APIs due to their cost, the system was designed to work with posts like "Follow me and @chainlink, drop your address" on Twitter. Users would add the Twitter link, the giveaway amount, the number of winners, and the end time. This information is then processed to ensure the funds are securely held and distributed by the smart contract.

How We Built It

  • Smart Contract: Developed using Solidity, the contract handles the giveaway creation, fund holding, and winner selection.
  • Node.js Server: Manages the backend logic, including storing giveaway entries and selecting winners.
  • Chainlink Integration: Utilized Chainlink’s time automation and external adapters to interact with the smart contract and Node.js server.
  • Frontend: Created a user-friendly interface for users to create and participate in giveaways.

Challenges We Ran Into

  • API Costs: The high cost of accessing the Twitter API limited our ability to integrate directly with social media platforms.
  • Smart Contract Complexity: Ensuring the contract was secure and could handle multiple giveaways simultaneously was challenging.
  • Automation Timing: Implementing reliable timing mechanisms to trigger the giveaway end process was tricky.

Accomplishments That We're Proud Of

  • Successfully creating a working prototype that can decentralize and automate social media giveaways.
  • Integrating Chainlink for secure and reliable external API calls.
  • Developing a system that can potentially reduce the prevalence of giveaway scams.

What We Learned

  • Gained deep insights into using external APIs within smart contracts.
  • Learned the intricacies of Chainlink’s time automation and external adapter services.
  • Improved understanding of building secure and efficient decentralized applications.

What's Next for RaffleFair

  • API Integration: Integrate with more social media platforms to widen the scope of giveaways.
  • Enhanced Security: Further improve the security features of the smart contract.
  • Scalability: Optimize the system to handle a larger number of giveaways and participants.
  • User Experience: Enhance the user interface to make it more intuitive and user-friendly.
  • Community Engagement: Build a community around RaffleFair to increase trust and participation.

Built With

Share this project:

Updates