Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write the raffle realm #159

Open
moul opened this issue Sep 26, 2023 · 0 comments
Open

Write the raffle realm #159

moul opened this issue Sep 26, 2023 · 0 comments

Comments

@moul
Copy link
Contributor

moul commented Sep 26, 2023

Objective

Develop the raffle realm to facilitate a transparent and verifiable raffle mechanism. The aim is to operate primarily on-chain, but we should consider off-chain solutions as a backup.

Requirements

1. gno.land/r/demo/chess Realm Enhancements:

  • On-chain Metrics Fetching:
    • Add a call to fetch a list of players, the number of finished games, the number of won games, and the count of moves.
    • Design for read-optimized calls. While write operations can bear slightly higher costs, the emphasis should be on efficient read operations.
    • To prevent overwhelming the system, either optimize for a large number of accounts or implement a pagination mechanism. Given that this is a primary realm, all enhancements should be finalized before the competition begins.

2. New Realm: demo/manual-rewards:

  • Manual Points Entry:
    • Allow whitelisted staff wallets to add entries. Each entry should record the address, associated points, and the reason for the reward.
    • This mechanism will be used to manually reward points during workshops or to acknowledge other notable contributions.

3. Development of demo/raffle Realm:

  • Import Data:
    • Fetch data from both demo/chess and demo/manual-rewards.
  • First call: Snapshot metrics:
    • An exclusive call for admins to compute scores based on live data from the other realms. Results should be saved persistently in a global variable.
  • Second call: Raffle computing:
    • Use a blend of hard-to-predict metrics (like height, timestamp, moves count, player data, etc.) to derive a seed for the raffle.
    • Ensure this method upholds fairness and randomness.
  • Result Rendering:
    • Develop a render function that displays:
      1. The computed numbers (from the first call).
      2. The winners of the raffle (from the second call).

Conclusion

While our primary focus is a fully on-chain solution, we should be adaptable and ready to pivot if needed. Timely completion, especially for primary realms, is essential to ensure a smooth competition experience for participants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant