> For the complete documentation index, see [llms.txt](https://docs.sperax.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sperax.io/sperax-farms-protocol/technical-documents/smart-contracts/e721-farms/camelot-v3/camelotv3farmdeployer.md).

# CamelotV3FarmDeployer

[Git Source](https://github.com/Sperax/Demeter-Protocol/blob/cc93b9106874316d6dd016cdace652e2ca4ef8e1/contracts/e721-farms/camelotV3/CamelotV3FarmDeployer.sol)

**Inherits:** FarmDeployer

**Author:** Sperax Foundation.

This contract allows anyone to calculate fees, pay fees and create farms.

## State Variables

### CAMELOT\_V3\_FACTORY

```solidity
address public immutable CAMELOT_V3_FACTORY;
```

### NFPM

```solidity
address public immutable NFPM;
```

### CAMELOT\_UTILS

```solidity
address public immutable CAMELOT_UTILS;
```

### CAMELOT\_NFPM\_UTILS

```solidity
address public immutable CAMELOT_NFPM_UTILS;
```

## Functions

### constructor

Constructor of the contract.

```solidity
constructor(
    address _farmRegistry,
    string memory _farmId,
    address _camelotV3Factory,
    address _nfpm,
    address _camelotUtils,
    address _nfpmUtils
) FarmDeployer(_farmRegistry, _farmId);
```

**Parameters**

| Name                | Type      | Description                                                                                       |
| ------------------- | --------- | ------------------------------------------------------------------------------------------------- |
| `_farmRegistry`     | `address` | Address of the Farm Registry.                                                                     |
| `_farmId`           | `string`  | Id of the farm.                                                                                   |
| `_camelotV3Factory` | `address` | Address of CamelotV3 factory.                                                                     |
| `_nfpm`             | `address` | Address of Camelot NonfungiblePositionManager contract.                                           |
| `_camelotUtils`     | `address` | Address of CamelotUtils (Camelot helper) contract.                                                |
| `_nfpmUtils`        | `address` | Address of Camelot INonfungiblePositionManagerUtils (NonfungiblePositionManager helper) contract. |

### createFarm

Deploys a new CamelotV3 farm.

*The caller of this function should approve feeAmount to this contract before calling this function.*

```solidity
function createFarm(FarmData memory _data) external nonReentrant returns (address);
```

**Parameters**

| Name    | Type       | Description          |
| ------- | ---------- | -------------------- |
| `_data` | `FarmData` | Data for deployment. |

**Returns**

| Name     | Type      | Description                   |
| -------- | --------- | ----------------------------- |
| `<none>` | `address` | Address of the deployed farm. |

## Structs

### FarmData

```solidity
struct FarmData {
    address farmAdmin;
    uint256 farmStartTime;
    uint256 cooldownPeriod;
    CamelotPoolData camelotPoolData;
    RewardTokenData[] rewardData;
}
```
