Soroban smart contract and frontend for Tossd, a provably fair coinflip game on Stellar with a streak-based payout system.
This repository is in the early implementation stage.
Implemented today:
- Core Soroban contract scaffold
- Contract error enum
- Core data types for game/config/stats
- Persistent storage keys and helper functions
- Contract initialization with fee and wager validation
- Basic unit tests
- Basic property tests for config and stats storage
Not implemented yet:
- Multiplier and payout logic
- Commit-reveal verification and outcome generation
- Game lifecycle functions (
start_game,reveal,cash_out,continue_game) - Admin update functions
- Query functions
- Timeout recovery
- Integration flow tests
- Frontend and backend integration
The source of truth for planned work is:
Tossd-contract/
├── contract/
│ ├── Cargo.toml
│ └── src/
│ └── lib.rs
└── frontend/
├── package.json
└── components/
cargo build --manifest-path contract/Cargo.tomlFor a release build:
cargo build --manifest-path contract/Cargo.toml --target wasm32-unknown-unknown --releasecargo test --manifest-path contract/Cargo.tomlCurrent test coverage is limited to setup, initialization, and early storage behavior. It does not yet cover the full game flow.
npm --prefix frontend startThe current contract exposes:
initialize
Internal helpers currently exist for:
- config storage
- stats storage
- player game storage
The next major milestones are:
- Finish storage round-trip coverage
- Add multiplier and payout logic
- Implement commit-reveal randomness
- Build the full game flow
- Add admin and query functions
- Add timeout recovery and safety checks
- Expand unit, property, and integration test coverage
- Prepare deployment and product integration
Issue drafts for contributors are tracked in:
- The README intentionally reflects the code that exists today.
- If product behavior and code disagree, use the spec documents as the implementation target and the contract source as the implementation status.