# Identify version of contracts

## Identifying Your Staking Contract Version

Before using any of the guides below, you need to determine which version of the Decubate Staking contracts your project is using. There are two generations: **V1** and **V2**.

***

### Quick Identification Steps

#### Step 1: Open Your Contract on a Block Explorer

1. Go to the block explorer for your chain (e.g., Etherscan, BscScan, BaseScan, Polygonscan).
2. Paste your staking contract address in the search bar.
3. Navigate to the **"Read as Proxy"** tab (both versions use proxy patterns).

#### Step 2: Determine V1 or V2

| Function         | V1 | V2  |
| ---------------- | -- | --- |
| `hasRole`        | No | Yes |
| `setManagerRole` | No | Yes |

```
Do you see "hasRole" or "setManagerRole" in Read as Proxy?
├─ YES → V2. Continue to Step 3b.
└─ NO  → V1. Continue to Step 3a.
```

#### Step 3a: Identify Your V1 Contract Type

| Function / Field            | Compound (MasterChef) | Compound (Vault) | NFT Staking | Dynamic (MultiFarm) |
| --------------------------- | --------------------- | ---------------- | ----------- | ------------------- |
| `compounderContract`        | Yes                   | No               | No          | No                  |
| `poolInfo` returns `apy`    | Yes                   | No               | No          | No                  |
| `masterchef`                | No                    | Yes              | No          | No                  |
| `callFee`                   | No                    | Yes              | No          | No                  |
| `poolExt`                   | No                    | No               | Yes         | No                  |
| `setNFTInfo`                | No                    | No               | Yes         | No                  |
| `poolInfo` has `rewardRate` | No                    | No               | No          | Yes                 |

```
V1 — Which contract do you have?

a. See "compounderContract" and "apy" in poolInfo?
   → V1 Compound — MasterChef contract.

b. See "masterchef" and "callFee"?
   → V1 Compound — Vault contract (auto-compounder for MasterChef).

c. See "poolExt" and "setNFTInfo"?
   → V1 NFT Staking.

d. See "poolInfo" with "rewardRate" but none of the above?
   → V1 Dynamic (MultiFarm).
```

> **Note:** V1 Compound Staking uses **two contracts together** — the MasterChef and the Vault. Check the V1 Compound Guide for details on both.

#### Step 3b: Identify Your V2 Contract Type

All V2 contracts have `hasRole` and `setManagerRole`. Use these additional signals:

| Function / Field           | Compound (Staking) | Compound (Vault) | Dynamic | Liquidity |
| -------------------------- | ------------------ | ---------------- | ------- | --------- |
| `compounderContract`       | Yes                | No               | No      | No        |
| `poolInfo` returns `apy`   | Yes                | No               | No      | No        |
| `reinvest` / `reinvestAll` | Yes                | No               | No      | No        |
| `masterchef`               | No                 | Yes              | No      | No        |
| `callFee`                  | No                 | Yes              | No      | No        |
| `getPricePerFullShare`     | No                 | Yes              | No      | No        |
| `claimFee`                 | No                 | No               | Yes     | No        |
| `addLiquidityAndLock`      | No                 | No               | No      | Yes       |
| `unlockAndRemoveLP`        | No                 | No               | No      | Yes       |
| `router`                   | No                 | No               | No      | Yes       |

```
V2 — Which contract do you have?

a. See "addLiquidityAndLock" or "router"?
   → V2 Liquidity (LiqLocker).

b. See "compounderContract" and "apy" in poolInfo?
   → V2 Compound — Staking contract.

c. See "masterchef" and "callFee"?
   → V2 Compound — Vault contract (auto-compounder).

d. See "claimFee" and "claimAndRestake" but none of the above?
   → V2 Dynamic.
```

> **Note:** V2 Compound Staking also uses **two contracts** — the CompoundStaking and the Vault. Check the V2 Compound Guide for details on both.

***

### Version Summary

#### V1 — Ownable, No Role-Based Access

| Type      | Contract(s)                   | Guide              |
| --------- | ----------------------------- | ------------------ |
| Compound  | DecubateMasterChef + DCBVault | V1 Compound Guide  |
| NFT       | DCBNFTStaking                 | V1 NFT Guide       |
| Dynamic   | DCBMultiFarm                  | V1 Dynamic Guide   |
| Liquidity | LiqLocker (legacy)            | V1 Liquidity Guide |

#### V2 — Role-Based Access (MANAGER\_ROLE + DEFAULT\_ADMIN\_ROLE)

| Type      | Contract(s)             | Guide              |
| --------- | ----------------------- | ------------------ |
| Compound  | CompoundStaking + Vault | V2 Compound Guide  |
| Dynamic   | DecubateStaking         | V2 Dynamic Guide   |
| Liquidity | LiqLocker               | V2 Liquidity Guide |


---

# 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/identify-version-of-contracts.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.
