A decentralized scouting platform for football players and scouts built on Solana.
Scout Chain is a smart contract built using the Anchor framework that facilitates a transparent scouting ecosystem. It allows players to showcase their stats and scouts to provide verified on-chain reviews.
The program utilizes Program Derived Addresses (PDAs) to ensure data integrity and user-specific ownership. It implements a full CRUD (Create, Read, Update, Delete) cycle for:
- Players: Personal profiles with stats and video links.
- Scouts: Professional profiles with organization and experience.
- Reviews: Dynamic reviews linked between a scout and a player.
- Create Profile: Initialize a unique PDA based on the user's wallet.
- Update Stats: Edit position, age, and performance metrics (CRUD: Update).
- On-Chain Metrics: Track total reviews and average ratings (CRUD: Read).
- Verified Scouts: Only registered scouts can leave reviews.
- Dynamic Review PDAs: Reviews are derived using the player's key, the scout's key, and a review counter.
- Deactivation: Ability to deactivate profiles to prevent further interactions.
- Rent Recovery: Delete reviews to close accounts and recover SOL (CRUD: Delete).
- Owner Validation:
require!macros ensure only the account creator can modify their data. - PDA Seeds:
["player", authority]["scout", authority]["review", player_pubkey, scout_pubkey, review_count]
Player {
authority: Pubkey,
name: String,
position: String,
age: u8,
stats: String,
video_url: String,
review_count: u32,
rating_sum: u32,
is_active: bool,
}["player", player_authority_pubkey]
["scout", scout_authority_pubkey]
["review", player_pda, scout_pda, review_index]
The program is live on Solana Devnet. You can verify the instructions and account states on the explorer:
Program ID: CXYaPQ451V8DD43pWCepNyddkf2Pnjk3mqvLgchJR5Fb
The test suite is built in TypeScript and performs a full lifecycle check. It uses fresh Keypair generation for every run to avoid PDA collisions and provides direct links to the explorer for each transaction.
- Ensure you have Devnet SOL in your local wallet (
solana balance). - Run the following command:
anchor test --provider.cluster devnet --skip-deploy --skip-local-validator
The test will log:
- Transaction Links: Direct URLs to Solana Explorer for every action.
- CRUD Logs: Confirmation of player creation (Pedri), scout creation (Xavi), and review management.
| Requirement | Version |
|---|---|
| Rust | Latest stable |
| Solana CLI | 1.18+ |
| Anchor CLI | 0.30+ |
| Node.js | 20+ |
# Clone the repository
git clone [https://github.com/cesarMalanco/scout-chain.git](https://github.com/cesarMalanco/scout-chain.git)
# Navigate into project
cd scout-chain
# Install dependencies
npm install
# Build the program
anchor build
# Run tests on Devnet
anchor test --provider.cluster devnet
Custom errors defined in the program:
InvalidRating: Rating must be between 1 and 5.Unauthorized: Only the owner can modify the account.InactiveProfile: Cannot interact with deactivated accounts.
This project is licensed under the MIT License.
César Malanco
Built with ❤️ using Rust, Anchor & Solana
