Skip to content

Anchor-based Solana contracts for Timba Coinflip/Giveaway games with commit-reveal fairness and secure on-chain settlement

License

Notifications You must be signed in to change notification settings

timbagame/contracts

Repository files navigation

Timba Contracts

Anchor-based Solana smart contracts for the Timba game platform.

What this program does

  • Runs token-based Coinflip and Giveaway games.
  • Uses a commit-reveal flow for verifiable randomness.
  • Settles payouts on-chain and accrues protocol fees per token config.
  • Supports both SPL Token and Token-2022 flows.
  • Provides timeout + oracle-buffer protections so players can recover funds if completion stalls.

For the full trust model and security details, see SECURITY.md.

Repository layout

  • programs/timba/src - on-chain program (instructions, state, events, errors).
  • tests - integration and behavior tests (anchor test runner).
  • scripts/update-idl.ts - copies generated IDL/types to sibling consumers.
  • target/idl and target/types - generated artifacts committed for downstream tooling.

Prerequisites

  • Rust
  • Solana CLI
  • Anchor CLI (0.32.1)
  • Node.js
  • Bun

The repo also includes a .devcontainer for containerized setup in VS Code/Cursor/Codespaces.

Quick start

bun install
anchor build
anchor test

Common commands

# Build program and regenerate IDL/types
anchor build

# Run full test suite
anchor test

# Sync generated IDL/types to sibling repos
bun run update-idl

# Formatting checks
bun run lint
bun run lint:fix

Program ID

32Jr4JnXWvqq9GqPQynkooHsszaucUUvZfNLh2hdX2L5

Additional docs

About

Anchor-based Solana contracts for Timba Coinflip/Giveaway games with commit-reveal fairness and secure on-chain settlement

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors