{"id":25353605,"url":"https://github.com/immutal0/solana-nft-staking-example","last_synced_at":"2026-05-04T07:39:06.512Z","repository":{"id":277262089,"uuid":"931457157","full_name":"Immutal0/solana-nft-staking-example","owner":"Immutal0","description":"Solana nft, pnft, cnft staking example website","archived":false,"fork":false,"pushed_at":"2025-02-13T17:10:18.000Z","size":39275,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T00:47:35.763Z","etag":null,"topics":["cnft","nft","pnft","rewards","solana","staking"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Immutal0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-12T10:04:36.000Z","updated_at":"2025-03-28T19:09:26.000Z","dependencies_parsed_at":"2025-02-13T02:43:29.451Z","dependency_job_id":null,"html_url":"https://github.com/Immutal0/solana-nft-staking-example","commit_stats":null,"previous_names":["immutal0/solana-nft-staking-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Immutal0%2Fsolana-nft-staking-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Immutal0%2Fsolana-nft-staking-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Immutal0%2Fsolana-nft-staking-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Immutal0%2Fsolana-nft-staking-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Immutal0","download_url":"https://codeload.github.com/Immutal0/solana-nft-staking-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247953092,"owners_count":21023945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnft","nft","pnft","rewards","solana","staking"],"created_at":"2025-02-14T19:33:54.741Z","updated_at":"2026-05-04T07:39:06.464Z","avatar_url":"https://github.com/Immutal0.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solana NFT Staking (NFT, PNFT, CNFT)\n\nThis project enables users to stake their NFTs (Non-Fungible Tokens) on the Solana blockchain, including traditional NFTs, PNFTs (Pre-Tokenized NFTs), and CNFTs (Compressed NFTs). The staking system allows users to earn rewards by staking their NFTs into a pool, and rewards are distributed periodically. \n\nThis repository contains both the smart contract and the frontend/backend components necessary to interact with the staking system.\n\n---\n\n## Table of Contents\n\n- [Project Overview](#project-overview)\n- [Features](#features)\n- [Tech Stack](#tech-stack)\n- [Smart Contract](#smart-contract)\n- [Frontend](#frontend)\n- [Backend](#backend)\n- [How to Run](#how-to-run)\n- [How to Contribute](#how-to-contribute)\n- [License](#license)\n\n---\n\n## Project Overview\n\nThis repository contains a full-stack solution for Solana-based NFT staking:\n\n- **Smart Contract:** Written in Rust using the Anchor framework, allowing users to stake and unstake NFTs, and claim rewards.\n- **Frontend:** A React.js app that allows users to connect their Solana wallet (via Phantom, Sollet, etc.) and interact with the staking contract.\n- **Backend:** A simple Node.js backend using Express.js for managing rewards and interacting with the Solana blockchain.\n\nThe project supports different types of NFTs:\n- **NFT:** Standard Solana NFTs (minted on Solana using Metaplex).\n- **PNFT:** Pre-Tokenized NFTs, designed for faster interaction with the blockchain.\n- **CNFT:** Compressed NFTs, designed for more efficient storage.\n\n---\n\n## Features\n\n- **Stake NFTs:** Users can stake their NFTs into a staking pool.\n- **Reward System:** NFTs staked will earn rewards over time.\n- **Multiple NFT Types Supported:** Supports standard NFTs, PNFTs, and CNFTs.\n- **Unstake NFTs:** Users can unstake their NFTs at any time.\n- **Reward Claiming:** Rewards are calculated based on the duration the NFTs are staked.\n- **Transaction History:** Users can view transaction history of staking and reward claims.\n- **Multi-Wallet Support:** Supports wallets like Phantom, Sollet, and others for user interaction.\n\n---\n\n## Tech Stack\n\n- **Solana Blockchain**: The smart contract is deployed on the Solana blockchain.\n- **Rust \u0026 Anchor Framework**: Used to write and deploy the smart contract.\n- **React.js**: For building the frontend of the application.\n- **Node.js \u0026 Express.js**: Backend server to handle interactions with the Solana blockchain and provide API endpoints.\n- **Metaplex**: For working with Solana NFTs (including CNFTs and PNFTs).\n- **Phantom Wallet**: Solana wallet extension for connecting users' wallets.\n\n---\n\n## Smart Contract\n\nThe smart contract is written in Rust using the Anchor framework and is responsible for the staking logic, reward distribution, and NFT management.\n\n### Key Features of the Smart Contract:\n- **Stake NFTs:** The contract allows users to stake Solana NFTs, including PNFTs and CNFTs.\n- **Rewards Calculation:** It calculates and stores rewards for staked NFTs.\n- **Unstake NFTs:** Users can unstake their NFTs and claim rewards.\n- **Ownership Verification:** Ensures that only the owner of a specific NFT can stake it.\n\n### How to Deploy the Smart Contract:\n1. Clone the repository.\n2. Navigate to the `smart-contract` directory.\n3. Install Anchor and Rust dependencies:\n   ```bash\n   anchor install\n   rustup install nightly\n   ```\n4. Build and deploy the smart contract to the Solana devnet:\n   ```bash\n   anchor build\n   anchor deploy --provider.cluster devnet\n   ```\n5. Interact with the deployed contract using the provided frontend and backend.\n\n---\n\n## Frontend\n\nThe frontend is built using **React.js** and provides a user-friendly interface to interact with the staking smart contract.\n\n### Key Features:\n- **Wallet Integration:** Users can connect their Solana wallets (e.g., Phantom, Sollet) to the frontend to manage their NFTs.\n- **Stake NFTs:** Interface to select and stake NFTs.\n- **Claim Rewards:** Users can claim rewards earned by staking.\n- **Unstake NFTs:** Users can unstake their NFTs and view transaction history.\n\n### Setup and Running the Frontend:\n1. Clone the repository.\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n3. Start the frontend development server:\n   ```bash\n   npm start\n   ```\n4. Open [http://localhost:3000](http://localhost:3000) in your browser to interact with the dApp.\n\n---\n\n## Backend\n\nThe backend is built using **Node.js** and **Express.js**. It handles requests from the frontend, interacts with the Solana blockchain to manage staking and rewards, and stores staking data in a database.\n\n### Key Features:\n- **API for Staking and Unstaking NFTs:** Provides API endpoints for staking and unstaking NFTs.\n- **Reward Calculation:** Calculates rewards based on the duration of NFT staking.\n- **Transaction History:** Stores and retrieves the user's staking transaction history.\n\n### Setup and Running the Backend:\n1. Clone the repository.\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n3. Configure your Solana cluster and wallet in the `.env` file.\n4. Start the backend server:\n   ```bash\n   npm start\n   ```\n5. The backend server will run on [http://localhost:5000](http://localhost:5000).\n\n---\n\n## How to Run\n\n### Prerequisites:\n- Install [Node.js](https://nodejs.org/) (v14 or above)\n- Install [Solana CLI](https://docs.solana.com/cli/install-solana-cli-tools)\n- Install [Anchor Framework](https://project-serum.github.io/anchor/getting-started/introduction.html)\n- Create a Solana wallet (e.g., Phantom) and fund it with test SOL for development.\n\n### Running the Full Stack Locally:\n1. Clone the repository.\n2. Set up the Solana environment by running the following commands:\n   ```bash\n   solana config set --url devnet\n   solana airdrop 2\n   ```\n3. Run the smart contract:\n   ```bash\n   anchor build\n   anchor deploy --provider.cluster devnet\n   ```\n4. Run the backend:\n   ```bash\n   cd backend\n   npm install\n   npm start\n   ```\n5. Run the frontend:\n   ```bash\n   cd frontend\n   npm install\n   npm start\n   ```\n6. Open [http://localhost:3000](http://localhost:3000) to access the frontend.\n\n---\n\n## How to Contribute\n\n1. Fork the repository.\n2. Create a new branch: `git checkout -b feature-branch`.\n3. Make your changes.\n4. Commit your changes: `git commit -am 'Add new feature'`.\n5. Push to the branch: `git push origin feature-branch`.\n6. Open a Pull Request.\n\n---\n\n## Contact\n\nFor any questions, feel free to contact me:\n- **Telegram:** [@Immutal0](https://t.me/Immutal0)\n- **Twitter:** [@Immutal0_](https://x.com/Immutal0_)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimmutal0%2Fsolana-nft-staking-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimmutal0%2Fsolana-nft-staking-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimmutal0%2Fsolana-nft-staking-example/lists"}