ExpirableFarm
Inherits: Farm
Author: Sperax Foundation.
This contract helps in creating farms with expiry feature.
State Variables
MIN_EXTENSION
MAX_EXTENSION
farmEndTime
farmRegistry
Functions
extendFarmDuration
Update the farm end time.
Can be updated only before the farm expired or closed. Extension should be incremented in multiples of 1 USDs/day with minimum of 100 days at a time and a maximum of 300 days. Extension is possible only after farm started.
Parameters
Name | Type | Description |
---|---|---|
|
| The number of days to extend the farm. Example: 150 means 150 days. |
updateFarmStartTime
Update the farm start time.
Can be updated only before the farm start. New start time should be in future. Adjusts the farm end time accordingly.
Parameters
Name | Type | Description |
---|---|---|
|
| The new farm start time. |
isFarmOpen
Returns bool status if farm is open. Farm is open if it is not closed and not expired.
Returns
Name | Type | Description |
---|---|---|
|
| bool True if farm is open. |
_setupFarmExpiry
Setup the farm data for farm expiry.
Parameters
Name | Type | Description |
---|---|---|
|
| Start time of the farm. |
|
| Address of the farm registry. |
_collectExtensionFee
Collects farm extension fee and transfers it to feeReceiver.
Function fetches all the fee params from farmRegistry.
Parameters
Name | Type | Description |
---|---|---|
|
| The number of days to extend the farm. Example: 150 means 150 days. |