Skip to content

Staking Template #156

@GuiBibeau

Description

@GuiBibeau

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

  1. community/staking/ directory with working template code
  2. README.md explaining:
    • Architecture overview of the staking system
    • Links to relevant Anchor and Solana documentation
  3. 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
  4. Example features:
    • Time-based reward calculations
    • Lock period handling
    • Transaction confirmation and error handling
  5. package.json with a create-solana-dapp block for post-install guidance
  6. Registration in templates.json so template is discoverable under Community Templates

Acceptance Criteria

  • A new directory community/staking exists with both smart contract and frontend code
  • Frontend demonstrates stake, unstake, and claim operations
  • Reward calculation is implemented and documented
  • User dashboard displays relevant staking information
  • README.md includes security considerations
  • Template is registered in templates.json
  • pnpm create solana-dapp --template staking works end-to-end

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions