A decentralized staking platform built on Solana that allows users to stake SOL tokens and receive SamSOL tokens in return. The platform consists of a Solana program (smart contract), a Next.js web frontend, and a React Native mobile app.
- Web App: https://lst.100xsam.store/
- Mobile App: Download
app-release.apkfrom the repository
- Overview
- Architecture
- Features
- Tech Stack
- Project Structure
- Getting Started
- Contract Details
- Development
- Deployment
- Testing
- Contributing
SamSOL Staking Platform enables users to:
- Stake SOL: Deposit SOL tokens and receive SamSOL tokens (1:1 ratio)
- Unstake SamSOL: Burn SamSOL tokens to withdraw original SOL
- Cross-platform: Access via web browser or mobile app
- Testnet Ready: Currently deployed on Solana Devnet
The platform uses a vault-based architecture where staked SOL is stored in user-specific Program Derived Addresses (PDAs) and SamSOL tokens are minted/burned accordingly.
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Web Frontend β β Mobile App β β Solana Program β
β (Next.js) β β (React Native) β β (Anchor/Rust) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
βββββββββββββββββββ
β Solana Devnet β
β (Testnet) β
βββββββββββββββββββ
- Staking: Convert SOL to SamSOL tokens
- Unstaking: Convert SamSOL back to SOL
- Wallet Integration: Support for Phantom, Solflare, Backpack wallets
- Mobile Support: Native mobile app with wallet adapter
- Real-time Updates: Live transaction status and balance updates
- PDA-based Vaults: Each user has a unique vault for SOL storage
- Authority Controls: Global mint authority for SamSOL token management
- Input Validation: Comprehensive amount and authorization checks
- Error Handling: Detailed error messages and transaction rollbacks
- Framework: Anchor (Solana)
- Language: Rust
- Program ID:
AFU3sLSc7vXEEuBbEnZn2R3XnoFXryRaPqDEaoaJri9d - Network: Solana Devnet
- Framework: Next.js 15.5.0
- Language: TypeScript
- Styling: Tailwind CSS
- Wallet: Solana Wallet Adapter
- UI Components: Lucide React icons, Sonner notifications
- Framework: React Native with Expo
- Language: TypeScript
- Wallet: Solana Mobile Wallet Adapter
- Platform: Android (APK available)
lst-platform-latest/
βββ my-new-program/ # Solana smart contract
β βββ programs/
β β βββ my-new-program/
β β βββ src/lib.rs # Main contract logic
β βββ tests/ # Contract tests
β βββ migrations/ # Deployment scripts
β βββ Anchor.toml # Anchor configuration
βββ frontend/ # Next.js web application
β βββ components/ # React components
β β βββ StakeComponent.tsx
β β βββ UnStakeComponent.tsx
β β βββ WalletConnectionProvider.tsx
β βββ src/
β β βββ app/ # Next.js app router
β β βββ utils/ # Contract utilities
β βββ package.json
βββ staking-app/ # React Native mobile app
β βββ components/ # Mobile components
β βββ contexts/ # React contexts
β βββ utils/ # Mobile utilities
β βββ package.json
βββ scripts/ # Utility scripts
- Node.js 18+ and npm/yarn
- Rust and Cargo
- Solana CLI tools
- Anchor framework
- Git
-
Clone the repository
git clone <repository-url> cd lst-platform-latest
-
Install dependencies for each component
Smart Contract:
cd my-new-program yarn installWeb Frontend:
cd frontend npm installMobile App:
cd staking-app npm install -
Configure Solana CLI
solana config set --url devnet solana-keygen new --outfile ~/.config/solana/staking-wallet.json
Web Frontend:
cd frontend
npm run dev
# Access at http://localhost:3000Mobile App:
cd staking-app
npm start
# Follow Expo CLI instructionsContract Testing:
cd my-new-program
anchor testAFU3sLSc7vXEEuBbEnZn2R3XnoFXryRaPqDEaoaJri9d
- Global Mint Authority: Controls SamSOL token minting/burning
- User Stake Account: Tracks individual user staking data
- User Vault: PDA storing user's staked SOL
- SamSOL Mint: The token mint for SamSOL
- initialize_global_authority: Sets up the global mint authority
- create_user_stake_account: Creates a user's staking account
- stake: Stakes SOL and mints SamSOL (1:1 ratio)
- unstake: Burns SamSOL and returns SOL
The contract includes comprehensive error handling:
InvalidAmount: Amount must be greater than 0InsufficientStake: Not enough staked amount to unstakeUnauthorized: User doesn't own the stake accountOverflow/Underflow: Arithmetic operation errors
-
Build the contract:
cd my-new-program anchor build -
Deploy to devnet:
anchor deploy
-
Run tests:
anchor test
-
Environment Setup:
- Ensure contract is deployed
- Update contract address in frontend utils
- Configure RPC endpoint
-
Development Server:
cd frontend npm run dev
-
Expo Development:
cd staking-app npm start -
Android Build:
expo build:android
The contract is currently deployed on Solana Devnet. To redeploy:
cd my-new-program
anchor deploy --provider.cluster devnetThe web frontend is deployed at https://lst.100xsam.store/.
The Android APK (app-release.apk) is available for direct installation.
cd my-new-program
anchor testcd frontend
npm run lint- Connect wallet to web app
- Test staking functionality
- Verify SamSOL token minting
- Test unstaking process
- Confirm SOL withdrawal
Watch the complete walkthrough of the web application demonstrating staking and unstaking functionality:
πΊ View Web Demo on Google Drive
This demo covers:
- Wallet connection process
- Staking SOL to receive SamSOL tokens
- Unstaking SamSOL to withdraw SOL
- Real-time transaction status updates