Background
The Solana Foundation maintains a templates repo with both official and community templates. Developers use these templates with create-solana-dapp to quickly scaffold projects.
Token staking is a fundamental feature in many Solana projects. This task proposes adding a comprehensive Staking template that demonstrates how to build a full-featured staking application with both on-chain program and frontend.
Goal
Add a community template at community/staking that includes:
- A Next.js + Tailwind + TypeScript frontend application
- Stake/unstake operations with reward calculations
- User dashboard for monitoring stakes
- Security considerations and best practices documentation
Deliverables
community/staking/ directory with working template code
README.md explaining:
- Architecture overview of the staking system
- Links to relevant Anchor and Solana documentation
- Frontend components:
- Stake input form with balance checks
- Unstake interface
- Rewards display and claim button
- User dashboard showing active stakes and earned rewards
- Pool statistics overview
- Example features:
- Time-based reward calculations
- Lock period handling
- Transaction confirmation and error handling
package.json with a create-solana-dapp block for post-install guidance
- Registration in
templates.json so template is discoverable under Community Templates
Acceptance Criteria
Background
The Solana Foundation maintains a templates repo with both official and community templates. Developers use these templates with create-solana-dapp to quickly scaffold projects.
Token staking is a fundamental feature in many Solana projects. This task proposes adding a comprehensive Staking template that demonstrates how to build a full-featured staking application with both on-chain program and frontend.
Goal
Add a community template at
community/stakingthat includes:Deliverables
community/staking/directory with working template codeREADME.mdexplaining:package.jsonwith acreate-solana-dappblock for post-install guidancetemplates.jsonso template is discoverable under Community TemplatesAcceptance Criteria
community/stakingexists with both smart contract and frontend codeREADME.mdincludes security considerationstemplates.jsonpnpm create solana-dapp --template stakingworks end-to-end