Skip to content

rlmsinclair/solana_program

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Solana Coin Flip Program

On-chain Solana program for a simple coin flip gambling game, written in Rust. Players bet SOL against the house; the outcome is determined by the block timestamp (even = win, odd = lose).

How it works

  1. Player calls PlayGame with a bet amount in lamports
  2. SOL is transferred from the player to a PDA (Program Derived Address) house account
  3. Outcome determined by unix_timestamp % 2
  4. If player wins: house pays out 1.95× the bet
  5. If player loses: house keeps the SOL

The Withdraw instruction lets the contract owner withdraw from the house PDA.

Stack

  • Rust + solana-program crate
  • Borsh serialisation
  • Program Derived Address for the house bankroll
  • Frontend (App.tsx) — React/TypeScript wallet integration

Build

cargo build-bpf
solana program deploy target/deploy/solana_program.so

Related

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages