GithubHelp home page GithubHelp logo

net2devcrypto / nftstaking Goto Github PK

View Code? Open in Web Editor NEW
104.0 5.0 79.0 1.69 MB

🔥🔥Stake your ERC721 NFTs and issue ERC20 Tokens as Rewards, A Repo to support the full video tutorial series on performing NFT Staking ERC721 and earn ERC20 tokens

Solidity 100.00%
alchemy axios blockchain erc20 erc721 ethereum ethers infura moralis nextjs

nftstaking's Introduction

nftstaking

🔥🔥Stake your ERC721 NFTs and issue ERC20 Tokens as Rewards, A Repo to support the full video tutorial series on performing NFT Staking ERC721 and earn ERC20 tokens

Net2Dev NFT Staking with ERC20 Token Rewards Youtube Video Tutorial Series https://www.youtube.com/watch?v=i6pPI5phMA0&list=PLLkrq2VBYc1YAIXfxuuh1DohmPZybsELt

A NFT ERC721 Staking smart contract that will issue reward tokens to all NFT holders. The files on the repo attached are used to:

  • Deploy the NFT Collection Smart Contract. (Collection.sol)
  • Deploy the ERC20 Staking Rewards Token Smart Token Contract. (N2DRewards.sol)
  • Deploy the NFT Staking Smart Contract. (NFTStaking.sol)
  • Stake and claim the ERC20 Staking Reward Tokens !!

** THE FILES ATTACHED TO THIS REPO ARE FOR EDUCATIONAL PURPOSES ONLY ** ** NOT FINANCIAL ADVISE ** ** USE IT AT YOUR OWN RISK, I'M NOT RESPONSIBLE FOR ANY USE, ISSUES ETC.. **

nftstaking's People

Contributors

0fatih avatar net2devcrypto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nftstaking's Issues

Claim and earningInfo() not working properly

Hello
NFTs rewards isn't working properly, when you stake id 4 and 5, and ID 4 have let's say 10 tokens of rewards, but ID 5 have 1 token and you claim 4 and 5 rewards, it only sends to you 1 token instead of 11 and then both go to 0 to start counting again. The same happens with earningInfo function, in this case it will only show 1 token of reward calling ["4","5"].

Staking Full-Reward Duration (aka Lockup Period)

As a contract owner, I want to implement a lockup period for NFT staking (aka stake NFTs at 100% of reward value for up to 365 days) so that I can encourage long-term staking

See humans.ai marketplace which features:

  • FIXED/LOCKED: 45% APR for 52 weeks (1 year)
  • FIXED/UNLOCKED: 40% APR for 52 weeks (1 year)
  • FIXED/LOCKED: 35% at 12 weeks
  • FIXED/LOCKED: 35% at 4 weeks
  • FLEXIBLE: 30% for any duration

Allow Owner To Update Token Reward Value

As an admin of the staking system (aka owner of contracts), I want to update the token reward using the onlyOwner function so that I can change incentive at any time and incentivize early users differently from later-stage users.

not possible to use approve function with USDC token testnets

Hi, i'm currently try to use USDC token to buy/sell NFT, and for that i need to approve my NFT Contract to be able to use transfer function

My wrote this part of the code :

function getApproval(uint256 _pid) public returns(bool){

    TokenInfo memory tokens = AllowedCrypto[_pid];
     IERC20 paytoken;
     paytoken = tokens.paytoken;
     uint256 cost;
     cost = tokens.costvalue;

     paytoken.approve(address(this), cost);
        
}

but it doesn't seems to work as expected, in didn't approve anything and it's impossible to use USDC this way... I con't find my mistake,

if someone as the answer

NFTStaking contract deployment using my own Nft Collection *query*

Hi, firstly thank you for your great contribution to the scene its been so helpful. I'm trying to deploy the NFT staking contract using my own ERC721 NFT contract thats already on chain. When trying to compile I'm getting the error shown below, I'd appreciate any advice on trying to resolve this. Also I've seen you mention in the comments I needed the approval function which my contract already has implemented. Thanks for your time and I appreciate all of your videos!
Kind regards

error shown below

from solidity:
DeclarationError: Identifier already declared.
--> contracts/NFTStaking.sol:6:1:
|
6 | import "https://github.com/MRgreen1705/StakingCats/PixelCatClub.sol");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: The previous declaration is here:
--> @openzeppelin/contracts/utils/Context.sol:16:1:
|
16 | abstract contract Context {
| ^ (Relevant source part starts here and spans across multiple lines)

Cannot Stake same Token ID, even though they are in separate vaults

Lets say I have 2 separate Nft collections and I create a vault 0 and vault 1. When I stake (NFT ID 1) into vault 0 it works. But when I go to stake (NFT ID 1) into vault 1 it says "already staked". but this is from a completely different collection. A user could technically have the same nft ID from 2 collections.

Cronos

Can you add cronos NFT staking by any chance?
Thanks

other user cant stake

I transferred the NFT using opensea to other account (a common way to send NFT) and tried to stake not working
i also tried to mint NFT on another account and stake not working
staking only works on the contract deployer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.