{"repo":"antonio-gaskin/solana-crash-game-smart-contract","free":true,"listed":false,"github":"https://github.com/antonio-gaskin/solana-crash-game-smart-contract","clone":"git clone https://github.com/antonio-gaskin/solana-crash-game-smart-contract.git","description":"Decentralized crash game vault system on Solana with secure fund management and PDA-based access control.","language":"TypeScript","stars":10,"topics":["anchor","blockchain","crash-game","crypto","defi","gamefi","onchain","rust","smart-contracts","solana"],"license":null,"category":"blockchain-web3","readme_excerpt":"Solana Crash Game Vault System A production-ready Solana smart contract for a Crash game vault system, built using the Anchor framework. Features - Game authority management through PDAs - Secure deposit/withdrawal system with SOL - On-chain user balance tracking - Bet placement and resolution - Admin-only controls for resolving bets Smart Contract Instructions 1. initialize(authority) - Creates the game authority account (PDA) with the signer as the admin. 2. deposit(user, amount) - Transfers SOL from the user wallet to a vault PDA. - Increases the user's on-chain balance (stored in a PDA). 3. withdraw(user) - Transfers the full balance back to the user's wallet. - Resets their on-chain balance to 0. 4. place bet(user, amount) - Deducts SOL from the user's on-chain balance. 5. resolve bet(user, win amount) - Admin-only function. Adds winnings to the user's balance. Technical Architecture - Vault PDA: [b\"vault\"] - User Balance PDA: [user pubkey, b\"balance\"] - Game Authority PDA: game authority initialized via initialize . Security Features - Reentrancy protection by zeroing balance before withdrawals - Overflow/underflow prevention with checked math operations - Unauthorized access prevention with Signer and authority checks Testing The contract includes comprehensive tests for all instructions: - Test deposit (check SOL moved + balance increased) - Test withdraw (check SOL returned + balance reset) - Test place bet (balance deducted) - Test resolve bet (admin adds winnings) ","default_branch":null,"files":null,"tree":[],"storefront":"/r/antonio-gaskin","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/antonio-gaskin/solana-crash-game-smart-contract/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}