This project is a Solana-based staking management system for NFTs, pNFTs (programmable NFTs), and cNFTs (compressed NFTs). Users can stake their NFTs to earn rewards, track staking progress, and manage their assets within the ecosystem.
- Stake & Unstake NFTs: Users can stake and unstake their NFTs seamlessly.
- Support for pNFTs & cNFTs: The staking protocol supports Solana's compressed and programmable NFTs.
- Reward Distribution: Users earn staking rewards based on predefined logic.
- Claim Rewards: Stakeholders can claim rewards in SPL tokens.
- Admin Controls: A dedicated admin interface to configure staking parameters.
- Solana Smart Contract (Anchor Framework): The program is developed using the Anchor framework for security and reliability.
- Solana Blockchain
- Rust (Anchor Framework) for smart contract development
- TypeScript & React for frontend interface
- Metaplex for NFT handling
- SPL Tokens for rewards distribution
Ensure you have the following installed:
- Solana CLI
- Anchor CLI
- Node.js
- Yarn or npm
git clone https://github.com/muffin819/solana-NFT-staking.git
cd solana-NFT-staking
yarn install # or npm install
anchor build
anchor deploy
Create a .env
file in the root directory and add the necessary configurations:
RPC_URL=https://api.mainnet-beta.solana.com
WALLET_KEYPAIR=./keypair.json
PROGRAM_ID=YOUR_DEPLOYED_PROGRAM_ID
yarn dev # or npm run dev
The smart contract consists of the following core functions:
initialize_pool
: Initializes the staking pool.stake_nft
: Allows users to stake their NFTs.unstake_nft
: Enables users to unstake their NFTs.claim_rewards
: Lets users claim staking rewards.update_pool
: Admin function to update staking parameters.
If using a backend service, here are some example API endpoints:
POST /stake
- Stake an NFT.POST /unstake
- Unstake an NFT.GET /rewards
- Fetch reward details.POST /claim
- Claim staking rewards.
- Integration with Solana Pay for reward redemptions.
- Multi-chain NFT staking support.
- UI improvements with additional analytics.
Pull requests are welcome! Feel free to fork the repo and create a PR with your changes.
This project is licensed under the MIT License.