# V1 NFT Staking Guide

This guide covers the V1 **DCBNFTStaking** contract — stake NFTs to earn ERC-20 token rewards. If you are unsure which version you have, see the Staking Version Identification Guide.

***

### Prerequisites

* Your DCBNFTStaking contract address.
* A block explorer for your chain (e.g., Etherscan, BscScan).
* A wallet (e.g., MetaMask) connected to the correct network.
* NFTs from an eligible collection.

***

## Part 1: Investor Guide

### View Available Pools

1. Navigate to **"Read as Proxy"**.
2. Call **`getPools`** to see all pools.
3. Key fields:
   * `rewardRate`: Reward per NFT per second (in wei).
   * `lockPeriodInDays`: Lock period.
   * `endDate`: When rewards stop.
   * `hardCap`: Max NFTs the pool accepts.
   * `input`: NFT contract address.
   * `reward`: Reward token address.
   * `isWithdrawLocked`: If `true`, cannot unstake until lock period ends.
   * `startIdx` / `endIdx`: Eligible NFT token ID range.
   * `maxPerUser`: Max NFTs you can stake.

### Check Eligible NFTs

1. Call **`walletOfOwner`** with pool ID and your address.
2. Returns NFT token IDs in your wallet eligible for this pool.

### Check Staked NFTs

1. Call **`getDepositedIdsOfUser`** with pool ID and your address.

### Check Pending Rewards

1. Call **`payout`** with pool ID and your address.

> Rewards = `time elapsed × rewardRate × NFTs staked`. Multiplier may apply.

### Check If You Can Claim / Unstake

1. Call **`canClaim`** with pool ID and your address.

### Check Multiplier

1. Call **`multipliers`** with pool ID. If `active` is `true`, boost exists.
2. Call **`calcMultiplier`** — `100` = 1x, `150` = 1.5x.
3. Call **`ownsCorrectMulti`** to check eligibility (based on token balance).

### Approve NFTs (Before First Stake)

1. Go to the **NFT contract** on the block explorer.
2. Call **`setApprovalForAll`** with:
   * `operator`: The staking contract address.
   * `approved`: `true`.

### Stake NFTs

1. Navigate to **"Write as Proxy"**.
2. Call **`stake`** with:
   * `_pid`: Pool ID.
   * `_ids`: Array of token IDs, e.g., `[1, 5, 12]`.

> IDs must be within `startIdx`–`endIdx`. Cannot exceed `maxPerUser` or pool `hardCap`.

### Claim Rewards

1. Call **`claim`** with `_pid`. Or **`claimAll`** for all pools.

> Lock period must have passed.

### Claim and Restake

Claims rewards and resets lock timer to keep earning:

1. Call **`claimAndRestake`** with `_pid`.

### Unstake NFTs

1. Call **`unStake`** with `_pid` and `_ids` (array of token IDs).
2. Rewards are auto-claimed. NFTs returned to your wallet.

> If `isWithdrawLocked` is `true`, lock period must have passed.

***

## Part 2: Admin / Founder Guide

> **All write functions require contract owner.**

### Add a Pool

1. Call **`add`** with:
   * `_isWithdrawLocked`, `_rewardRate` (per NFT per second in wei), `_lockPeriodInDays`, `_endDate`, `_hardCap` (max NFTs), `_input` (NFT address), `_reward` (reward token).

### Update a Pool

1. Call **`set`** with pool ID and same params as `add`.

### Set NFT Pool Details

1. Call **`setNFTInfo`** with:
   * `_pid`, `_name`, `_logo`, `_headerLogo`, `_collection`, `_startIdx`, `_endIdx`, `_maxPerUser`.

### Set Multiplier

1. Call **`setMultiplier`** with:
   * `_pid`, `_name`, `_contractAdd` (token contract), `_isUsed`, `_multiplier` (base `100`), `_start` (min balance), `_end`.

### Expire a Pool

1. Call **`set`** and set `_endDate` to a past timestamp.

### Withdraw Stuck Tokens

1. Call **`transferStuckToken`** with token address. Sends full balance to owner.

### Withdraw Stuck NFTs

1. Call **`transferStuckNFT`** with NFT address and token ID.

### Fund Rewards

Transfer reward tokens directly to the staking contract address. Verify with `balanceOf` on the reward token.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tms-finance.gitbook.io/tms.finance/staking-contracts/v1-nft-staking-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
