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.
├── 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
Install deps
yarn installBuild project
anchor buildSee anchor keys and look for the programID output
anchor keys listRun tests
anchor testRun local validator
solana-test-validatorSee solana logs
solana logs --url localhostRun tests with local validator
anchor test --skip-local-validatorRun tests in testing environment
anchor test -- --features "testing"