Skip to content

Slamjam Homerun v1 Solana program implementation using Rust and Anchor.

Notifications You must be signed in to change notification settings

Farber98/slamjam-homerun-v1

Repository files navigation

Slamjam Homerun v1

Contains all the blockchain side logic for Slamjam Homerun v1.

In a nutshell, the game is a baseball strike game where you have fixed rounds and a pot to claim. You pay a fee for entering the game, and that fee goes to the pot. When the round finishes, the user that got the highest score will be able to claim the pot through a grace period. Once the grace ends, anyone will be able to claim.

Program structure

├── src                   
│   ├── constants.rs      # General constants (eg. FEE, COMMISION, TIME_ROUND)
│   ├── context.rs        # Context definition for each instruction.
│   ├── errors.rs         # Custom errors for instructions.
│   ├── lib.rs            # Instructions definition and implementation (a.k.a "the program")
│   └── state.rs          # PDA structure that will contain game state

Setup

Install deps

    yarn install

Build project

    anchor build

Useful commands for testing

See anchor keys and look for the programID output

    anchor keys list

Run tests

    anchor test

Run local validator

    solana-test-validator

See solana logs

    solana logs --url localhost

Run tests with local validator

    anchor test --skip-local-validator

Run tests in testing environment

    anchor test -- --features "testing" 

About

Slamjam Homerun v1 Solana program implementation using Rust and Anchor.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published