CamelotV3FarmDeployer

Git Source

Inherits: FarmDeployer

Author: Sperax Foundation.

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

State Variables

CAMELOT_V3_FACTORY

address public immutable CAMELOT_V3_FACTORY;

NFPM

address public immutable NFPM;

CAMELOT_UTILS

address public immutable CAMELOT_UTILS;

CAMELOT_NFPM_UTILS

address public immutable CAMELOT_NFPM_UTILS;

Functions

constructor

Constructor of the contract.

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

Parameters

NameTypeDescription

_farmRegistry

address

Address of the Demeter 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.

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

Parameters

NameTypeDescription

_data

FarmData

Data for deployment.

Returns

NameTypeDescription

<none>

address

Address of the deployed farm.

Structs

FarmData

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