feat: add community staking template with Anchor and Next.js frontend#325
Open
satyawaniaman wants to merge 8 commits intosolana-foundation:mainfrom
Open
feat: add community staking template with Anchor and Next.js frontend#325satyawaniaman wants to merge 8 commits intosolana-foundation:mainfrom
satyawaniaman 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.
Author
|
@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! |
Author
|
@cxalem Hi! just checking if there are any updates on this PR. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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