FarmRegistry
Inherits: IFarmRegistry, OwnableUpgradeable
Author: Sperax Foundation.
This contract tracks fee details, privileged users, deployed farms and farm deployers.
State Variables
farms
deployerList
feeReceiver
feeToken
feeAmount
extensionFeePerDay
farmRegistered
deployerRegistered
isPrivilegedUser
Functions
constructor
initialize
constructor
Parameters
Name | Type | Description |
---|---|---|
|
| Receiver of the fees. |
|
| The fee token for farm creation. |
|
| The fee amount to be paid by the creator. |
|
| Extension fee per day. |
registerFarm
Register a farm created by registered Deployer.
Only registered deployer can register a farm.
Parameters
Name | Type | Description |
---|---|---|
|
| Address of the created farm contract |
|
| Address of the farm creator. |
registerFarmDeployer
Register a new farm deployer.
Only owner can call this function.
Parameters
Name | Type | Description |
---|---|---|
|
| Address of deployer to be registered. |
removeDeployer
Remove an existing deployer from registry.
Only owner can call this function.
Parameters
Name | Type | Description |
---|---|---|
|
| ID of the deployer to be removed (0 index based). |
updatePrivilege
Function to add/remove privileged User.
Only callable by the owner.
Parameters
Name | Type | Description |
---|---|---|
|
| User Address for which privilege is to be updated. |
|
| Privilege(bool) whether true or false. |
getFarmDeployerList
Get list of registered deployer.
Returns
Name | Type | Description |
---|---|---|
|
| Returns array of registered deployer addresses. |
getFarmList
Get list of farms created via registered deployer.
Returns
Name | Type | Description |
---|---|---|
|
| Returns array of farm addresses. |
getFeeParams
Get all the fee parameters for creating farm.
It returns fee amount and extension fee as 0 if _user is privileged.
Parameters
Name | Type | Description |
---|---|---|
|
| The account creating the farm. |
Returns
Name | Type | Description |
---|---|---|
|
| Receiver of the fees. |
|
| Token in which fee is to be paid. |
|
| Amount of fees to be paid for creation of farm. |
|
| Extension fee per day in case of extending a farm. |
updateFeeParams
Update the fee params for registry.
Parameters
Name | Type | Description |
---|---|---|
|
| FeeReceiver address. |
|
| Token address for fee. |
|
| Amount of token to be collected. |
|
| Extension fee per day. |
_validateNonZeroAddr
Validate address.