Inspiration
This project is all about empowering Web2 developers to tap into the power of Web3 and create exciting contests that are not only easy to build but also profitable. With Ruba, developers can leverage the technologies they are familiar with to create innovative and engaging contests on the blockchain.
Whether it's a prediction market, a gaming tournament, or a social media challenge, Ruba makes it easy for developers to launch contests on Web3. With simple interface, developers can focus on building their ideas without worrying about the complexities of blockchain development.
What it does
Developers can create a contest by providing JavaScript or TypeScript code, a title, and a list of expected outcomes, as well as setting the minting and execution deadlines, ticket limit, and minimum ticket price. Developers must seed the contest with a small amount of FTM (currently 5 FTM).
During the contest's minting period, users can bet on the outcomes by minting tickets for the contest using FTM.
At the contest's execution deadline, validators run the code and submit the outcome. If more than two-thirds of validators participate, the contest is finalized, and the rewards are distributed among the winners. The contest developer and validators receive a percentage of the rewards.
If the validators do not agree on an outcome due to an error in the code or API, the contest is cancelled, and users are refunded. However, to prevent spamming, the initial deposit made by the developer is non-refundable.
How we built it
Smart contracts:
- RubaValidator(ERC721): simple ERC721, owner of each token could participate on outcome voting.
- Ruba(ERC721): Has contests and tickets logic. because tickets are ERC721, users can resale their tickets on open market. Administrative functions are behind 7 day time locked.
Back end:
- Rest API: to let user sign in using their wallet, publish metadata, and create secrets.
- Proxy: let developers hide their sensitive information.
Validation:
- Sandbox: container to run untrusted user code.
- Validator: monitors blockchain, schedules execution of sandbox and casts votes.
UI Subgraphs
Challenges we ran into
- What if a contest developer needs to call a private API? The submitted codes are publicly available inside ERC721's metadata, which could result in the leak of sensitive data.
To overcome this issue, we added a Secret Manager section, where developers can submit their secrets and receive a proxy URL in return. Calling the proxy URL around the execution time forwards the request to the API and injects the necessary authentication headers. This way, the developer can access the private API without worrying about sensitive data being exposed.
- Storing user generated metadata
Without having affordable onchain storage for metadata, Creating new ERC721 and publishing its metadata is not atomic operation, which could results in partially failed tasks.
Currently, Background jobs are checking if those operations are partially failed, and issue refund.
Accomplishments that we're proud of
We are proud of overcoming technical challenges, and delivering a high quality which could introduce dApp's to Web2 developers and help ridging the gap between them.
What we learned
Learning about smart contracts, Solidity, and the related toolchain was the biggest takeaway.
What's next for Ruba
Now that the project has been released, there are several areas where we can focus our efforts to continue improving and expanding the platform. Increasing test coverage should be a top priority, as this will ensure that the software is reliable and free from bugs. Additionally, growing the community and onboarding more users can help to increase adoption and drive further development. Improving subgraphs to have better analytics will provide valuable insights into platform usage and user behavior. Having validators more distributed will help to ensure network security and prevent centralization. Supporting more programming languages will make the platform more accessible to developers with different backgrounds and skill sets. Finally, improving UI/UX will make the platform more user-friendly and attractive to users, leading to increased engagement and adoption.
Log in or sign up for Devpost to join the conversation.