OpenViSTAI · Agents · Blockchain · Crypto
Menu
Consumer Crypto Apps

Solotery

Solotery is an open-source Rust smart-contract project for a decentralized lottery on Solana. Its README describes initializing a lottery account, accepting SOL-funded ticket transactions, recording participants, and selecting a winner based on a time condition or participant limit.

Independent OpenViST project profile, based on linked sources.

Solotery — OpenViST project profile in Consumer Crypto Apps.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use the repository when evaluating or studying a Solana lottery program’s described ticket and draw mechanics; the supplied documentation does not establish a complete user-facing participation workflow.

Who it is for

  • Solana users researching a participant-funded lottery mechanism.
  • Developers inspecting or adapting an Apache-2.0 Rust lottery program.

Documented uses

  • Review how ticket transactions are checked and recorded.
  • Understand the described lottery account initialization and winner-selection flow.
  • Inspect a Rust implementation that uses Solana accounts and a program-derived address.
Before you choose

Requirements & limits

The repository is public and identified as open source under the Apache-2.0 license.

  • The README describes a participant cap of 300 and a draw triggered by the participant limit or a time condition.
  • Ticket purchases are described as SOL transfers recorded by the program.
  • The documentation shows initialization and ticket-handling code but not a complete installation, deployment, or player-facing guide.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Initialize the SOLotery stake account

Set up the lottery account and initialize its state using the documented `create_stake` program function.

Before you start

  • A Solana program containing the documented create_stake function and Create accounts structure.
  • A user signer account to pay for initialization.
  • The solotery account is initialized with SoLotery::SIZE + 8 bytes of space, as specified in the account constraint.
  • The Solana system program account.

Steps

  1. Derive the stake PDA using the SOLOTERY seed and the program ID.

  2. Initialize the solotery account with the PDA seed, bump, payer, and required account space.

  3. Run the documented initialization logic to store the bump, reset players and winner state, set the time check, and initialize ticket sales.

Expected outcome

The lottery account is initialized with its bump and starting state, including reset player and winner fields and initialized ticket sales.

Guide limitations

  • The time check is set to DAY_OF_DEPLOY; the source does not explain how that value is defined.
  • The source does not document wallet setup or the amount required to initialize the account.
Source-based practical guide

Submit a ticket through the documented lottery instruction

Use the documented `ticket` program logic to add a participant to the current lottery state or, after a winner is selected, transfer funds to the winner.

Before you start

  • An initialized SOLotery account and the stake PDA derived using the SOLOTERY seed.
  • A signer account for the ticket transaction with at least TICKET_PRICE lamports when no winner has been selected.
  • The supplied winner public key must match the winner public key stored in the SOLotery account.
  • The program accounts required by the Ticket structure, including the system program.

Steps

  1. Provide the accounts expected by the Ticket structure: solotery, signer from, stake, winner_publickey, and system_program.

  2. Submit the ticket instruction with the stake account matching the expected PDA and the winner key matching the stored key.

  3. When no winner has been selected, the program checks the sender's balance, transfers TICKET_PRICE to the lottery account, and records the participant and ticket.

  4. If the player limit is reached or the time check has passed, the program selects a winner; if a winner was already selected, the documented logic instead calls the winner-transfer function.

Expected outcome

A valid ticket call either records a participant and may trigger winner selection, or invokes the winner-transfer logic when the lottery is already in the winner-selected state.

Guide limitations

  • The README does not give values for TICKET_PRICE, MAX_PLAYERS, or the program ID.
  • The source describes automatic winner selection but does not document how randomness is generated or provide transaction-submission instructions.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
mateolafalce/SOLotery · Official homepage title · retained in its source language