feat: add community staking template with Anchor and Next.js frontend#325
feat: add community staking template with Anchor and Next.js frontend#325satyawaniaman wants to merge 8 commits intosolana-foundation:mainfrom
Conversation
Anchor program with 5 instructions (initialize, stake, unstake, claim, add_rewards) and a Next.js frontend with wallet integration, token faucet, and clean black/white UI. - Program: SPL token staking with PDAs, reward distribution, admin controls - Frontend: Next.js 16 + Tailwind 4 with Stake/Manage tabs - Tests: 4 passing anchor tests (initialize, stake, unstake, error handling) - Scripts: Pool initialization and token minting utilities
- oklch-based color tokens (matching supabase-auth convention) - bg-card/50 navbar with proper hover transitions - Link component for navigation - Cleaner wallet adapter overrides - Consistent border-border, outline-ring/50 base styles
- Light + dark oklch color schemes (matching supabase-auth convention) - ThemeProvider wrapping app with dark default, system detection - Sun/Moon toggle button in navbar - Wallet adapter overrides use CSS vars for theme-awareness
…WalletMultiButton` and removing wallet adapter UI specific styles.
|
@cxalem gentle ping for visibility, thanks. |
|
This pull request has been automatically marked as stale because it has not had any activity for 7 days. It will be closed in 7 days if no further activity occurs. If you believe this PR is still relevant, please add a comment or push new commits to keep it open. Thank you for your contributions! |
|
@cxalem Hi! just checking if there are any updates on this PR. Thanks! |
|
@catmcgee @cxalem @GuiBibeau @jacobcreech |
|
This pull request has been automatically marked as stale because it has not had any activity for 7 days. It will be closed in 7 days if no further activity occurs. If you believe this PR is still relevant, please add a comment or push new commits to keep it open. Thank you for your contributions! |
Demo
staking-walkthrough.mp4
Summary
Adds a new
community/stakingtemplate forpnpm create solana-dapp --template staking.This template provides a complete reference implementation of a Solana staking dApp including:
initialize,stake,unstake,claim, andadd_rewardsValidation
I verified the template locally with:
All checks completed successfully.
Manual Devnet Verification
I also validated the full workflow on devnet:
Notes
app/.env.localsync-program-id.jskeeps the program ID aligned across Rust, Anchor config, and frontend types/envinitialize-pool.jscreates the staking PDAsadd-rewards.jsfunds the reward pool and sets the emission rate