Staking Contract Troubleshooting - Not Owned or Approved

Staking NFTs and earning rewards is a new way to earn passive income and is used very commonly in the web3 space.

 

A common issue when trying to stake an NFT using staking contracts is as follows: execution reverted: Not owned or approved

How to Stake NFTs using

To get started, here's a quick overview of how to stake NFTs:

  1. Deploy your NFT/token contract and mint tokens
  1. Deploy your staking contract that matches the token standard deployed above.
  1. To stake your NFTs, you need to approve the staking contract within your NFT contract. If you want to stake a single NFT, call the approve function in your NFT contract. This function grants permission to the staking contract to handle the staking process for that specific NFT. On the other hand, if you want to give access to all the NFTs from a particular collection, call the setApprovalForAll function in your NFT contract. This function allows the staking contract to handle the staking process for all the NFTs in that collection. For a detailed example and troubleshooting tips, please refer to the troubleshooting section below.
  1. Enter the NFT/token parameters into stake function of your deployed staking contract, and execute.

Not owned or approved Troubleshooting

If you are reaching an execution reverted: Not owned or approved error after following these steps, please verify the following:

 
  1. Ensure that you have enough funds in your account to pay for gas fees
  1. Ensure that you own the particular NFT that is being approved
  1. Verify that the staking contract has been granted approval on the NFT contract and the approved boolean value has been set to true. See the image below for an example.
    1. Notion image
  1. Confirm the parameters you’re entering into your staking contract meet the required formatting. For example:
      • the token ID field inside the stake function requires [brackets] like this → 0 to stake token ID 0.
        • Notion image
 

 

Can’t get this working? If you’ve followed the above and still have issues, contact our support team for help.

 
Did this answer your question?
😞
😐
🤩