
Lucky Summer
A custom raffle generator frame with on-chain follower verification. Deploy your raffle with custom ERC-20's with few clicks.
Demo
About
The problem it solves ## Introduction Building a frame is a complex task, even though frames are perfect for community interaction. Additionally, users can only join the frames you build, necessitating multiple frames for various raffles. ## Why Lucky Summer? As a project owner or community member of a specific token, you can create an on-chain customized raffle for any ERC-20 with just a few clicks. ## 🛠 Customizable Parameters - Number of raffle winners - Reward per winner - Number of raffle participants - Required follows for participation - ERC-20 address ## How It Works It begins with a main frame available at https://summer-luck.vercel.app/ 1. Approve the raffle factory contract's spending. 2. Specify parameters in the Factory contract via the UI. 3. After successful contract creation, the app provides: - Raffle contract address - Frame URL 4. Share the Frame URL on Warpcast. Users with verified addresses who follow the specified caster can join. 5. Once conditions are met, the raffle ends, and prizes are distributed. *Raffle can't end within 24 hours if the target user count isn't reached. If the target is met, the last user finishes the lottery. After 24 hours, if the target isn't met, the host can end the raffle.* Lucky Summer uses Pyth Entropy (https://pyth.network/entropy) to determine the winner, with the last user paying the fee. ## On-Chain Follower Verification A signature verification algorithm via frames.js hooks checks follower status on Warpcast. If a user follows the caster, a signature is generated and sent to the contract for verification. A valid signature allows the user to join the raffle. ## FAQ #### Why pay an extra fee? The incentive: the host deploys 0.00075 ETH to the Raffle contract, including a 0.0005 ETH incentive. #### What if the host doesn’t finish the lottery? The host pays 5% extra ERC-20 tokens and gets this amount back when the lottery ends.
How it's made
Challenges we ran into We had a lot of trouble with fc:frame (spesifically fc:frame:image) properties. Even though the examples of frames.js were having the same mistakes when we were trying to test. The worst part was not having the errors, but the buttons which is not being rendered without any errors. The reason if this is either the VERCEL_URL at page.tsx, or the static image links in route.tsx. The lack of comprehensive examples were also problematic. Best examples were built by the community, but those weren't categorized and ordered. Integration of wallet connection with the existing projects was harder than I expected and I faced with lots of erros. So, I moved with a custom wallet connect component.