Tikka is a decentralized raffle platform built on Stellar using Soroban smart contracts. Users can create raffles, sell tickets priced in Stellar assets, and distribute prizes securely on-chain.
- Deterministic winner selection derived from ledger data (timestamp + sequence)
- Simple and transparent process for a demo contract
- Designed for clarity, not production-grade randomness
- Ticket Purchases: Any Stellar asset contract
- Prizes: Same asset used for ticket purchases
- Flexible Pricing: Set ticket prices and prize amount per raffle
- Prizes are held in the smart contract until finalization
- Winners claim prizes after the raffle ends
- Total tickets sold per raffle
- Winner tracking and claim status
Creator β Create Raffle β Set Parameters
- Raffle creators specify:
- Description and end time
- Maximum ticket count
- Ticket price and payment asset
- Whether multiple tickets per person are allowed
- Prize amount (in the same payment asset)
Creator β Deposit Prize β Contract Escrow
- Prizes are transferred to the smart contract
- Contract holds the prize until raffle finalization
Participants β Buy Tickets β Contract Validation β Ticket Issuance
- Users purchase tickets with the raffle asset
- Contract validates payment and issues tickets
- One ticket equals one entry in the raffle
Raffle Ends β Finalize β Select Winner
- Winner is selected from sold tickets
- Selection uses ledger-derived data for demo purposes
Winner Selected β Claim Prize
- Winners claim their prizes
flowchart TD
Creator[Creator]
Buyer[TicketBuyer]
Token[StellarAssetContract]
Raffle[RaffleContract]
Creator -->|"create_raffle()"| Raffle
Creator -->|"deposit_prize()"| Token
Token -->|"transfer(prize)"| Raffle
Buyer -->|"buy_ticket()"| Token
Token -->|"transfer(ticket_price)"| Raffle
Raffle -->|"finalize_raffle()"| Raffle
Raffle -->|"select_winner(ledger_data)"| Raffle
Buyer -->|"claim_prize()"| Raffle
Raffle -->|"transfer(prize)"| Token
Token -->|"transfer(prize)"| Buyer
- Soroban (Rust): Smart contract implementation
- Stellar: Network and asset contracts
pub fn create_raffle(... ) -> u64;
pub fn deposit_prize(... );
pub fn buy_ticket(... ) -> u32;
pub fn finalize_raffle(... ) -> Address;
pub fn claim_prize(... );
pub fn get_raffle(... ) -> Raffle;
pub fn get_tickets(... ) -> Vec<Address>;pub struct Raffle {
pub id: u64,
pub creator: Address,
pub description: String,
pub end_time: u64,
pub max_tickets: u32,
pub allow_multiple: bool,
pub ticket_price: i128,
pub payment_token: Address,
pub prize_amount: i128,
pub tickets_sold: u32,
pub is_active: bool,
pub prize_deposited: bool,
pub prize_claimed: bool,
pub winner: Option<Address>,
}- Only one winner per raffle
- Prize and ticket payments use the same Stellar asset
- Winner selection is deterministic and not production-grade randomness
- Contract Address: TBD
- Rust toolchain
- Stellar CLI (optional for deployment)
cargo test -p hello-worldcargo build -p hello-worldFor local setup, build, and test workflows, see DEVELOPMENT.md.
See CONTRIBUTING.md for contribution guidelines and PR expectations.
- Stellar Soroban: https://developers.stellar.org/docs/build/smart-contracts/overview
- Soroban Examples: https://github.com/stellar/soroban-examples
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check our guides
- Issues: Report bugs and feature requests
- Community: Join our Discord for discussions
Built with β€οΈ on Stellar