Standard Farming Manager
Farming Manager Initialization
The FarmingManager
must be initialized by the farming contract itself; specifically, via the init
function of the farming contract:
address
extension
-> The address of the Farming Manager contract must be passed asaddress extension.
bytes
extensionInitData
-> The initialization data of the Farming Manager must be passed asbytes extensionInitData
.FarmingManager
is aLazyInitCapableElement
, and so the initialization data must follow this pattern. In particular, the host of the FarmingManager must be the address of the Organization to which it will be linked as an active component. The host parameter is the only one to initialize.address
rewardTokenAddress
-> address of the Farming contract reward token. There can be only one reward token per Farming contract.bytes
farmingSetupInfosBytes
-> ABI-encoded data of the contract'sfarmingSetupInfos
structs used to create Farming setups. Look here for more info.
Following the creation of the farming contract and initialization of the Farming Manager, the organization must, through a proposal, link the Farming Manager to itself as an active component (to learn more, see here).
Farming Contract Interaction
The Farming Manager provides the following interaction functions with the farming contract.
transferTo
This function, which can be called only by the farming contract itself, is used to send the required amount of reward tokens from the Organization's Treasury Manager to the farming contract; this must be done before the contract's setups can be or at the moment they are activated (see here to learn more).
backToYou
This function, which can be called only by the farming contract itself, is used to send back any unissued reward tokens from a farming contract after all its setups have ended back to the Organization's main Treasury Manager (see here to learn more).
setFarmingSetups
This function, which can be called by all authorized subjects and Components linked to the Organization, is used to add new Farming setups to, and modify existing setups of, a farming contract. See here to learn more.
setTreasury
The Farming Manager address is automatically set as the Farming contract treasury, and cannot be changed. See here to learn more.
Last updated