Skip to content

NFT-Gated Staking is a smart contract-based staking system where users must hold a specific NFT to participate.

Notifications You must be signed in to change notification settings

sorXCode/NFT-Gated-Staking

Repository files navigation

NFT-Gated Staking

Overview

NFT-Gated Staking is a smart contract-based staking system that requires users to hold a specific NFT to participate. This allows NFT projects to create exclusive staking pools, reward loyal holders, and add more utility to their NFTs.

Features

  • NFT-Gated Access – Only NFT holders can stake tokens
  • Customizable Rewards – Different rewards based on NFT ownership and staking duration
  • Secure Smart Contracts – Built with Solidity and follows best practices
  • Flexible Staking Periods – Support for multiple lock-up durations
  • Optimized Gas Usage – Efficient transactions to minimize costs

Use Cases

  • Exclusive Staking Pools – Reward NFT holders with exclusive staking options
  • DAO Membership Benefits – Provide staking incentives for governance participation
  • Play-to-Earn & Gaming – Require NFTs for access to special staking rewards

Tech Stack

  • Solidity – Smart contract development
  • Hardhat – Development, testing, and deployment framework
  • OpenZeppelin – Secure contract standards
  • Ethereum & EVM-Compatible Chains – Deployable on multiple networks

Installation

Clone the repository:

git clone https://github.com/sorXCode/NFT-Gated-Staking.git
cd NFT-Gated-Staking

Install dependencies:

yarn install

Deployment

Compile the smart contract:

yarn hardhat compile

Run tests:

npx hardhat test

Deploy to a local blockchain: You'll need 2 terminals for this; one to run the node, and the other to run the project. In one terminal:

npx hardhat node

In another:

npx hardhat run scripts/deploy.js --network localhost

Deploy to a testnet:

npx hardhat run scripts/deploy.js --network ropsten

Usage

  1. Ensure users hold the required NFT.
  2. Interact with the staking contract to deposit tokens.
  3. Rewards accumulate based on the staking period and NFT tier.
  4. Withdraw staked tokens and claim rewards after the lock-up period.

Smart Contract Details

  • NFT Verification: Uses ERC-721/ERC-1155 standards to verify ownership.
  • Reward Mechanism: Rewards are distributed proportionally based on staking duration and NFT tier.
  • Security Measures: Implements best practices to prevent reentrancy and exploits.

License

This project is licensed under the MIT License.


🚀 Start staking with NFT access today!

About

NFT-Gated Staking is a smart contract-based staking system where users must hold a specific NFT to participate.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published