Default and Custom
Default Extension
The default extension has been developed to be used by individual wallets or other hosts that do not require customized integrations, methods or features. It is deployed and cloned through the Factory contract.
If you want to use default extension, clone it with the cloneFarmDefaultExtension
function:
Its main functions are:
Init
function
This sets the three main data parameters: a boolean value representing if the reward token is generated by mint (true
) or by reserve (false
); the host address
; and the treasury address
.
setHost
This is used to update the extension host.
setTreasury
This is used to update the extension treasury.
setFarmingSetups
This is used to create / update / disable the farming setups of a contract directly via the extension.
backToYou
The backToYou
function is called in the Farming contract to retrieve reward tokens, in case the amount of reward tokens sent by the extension to the Farming contract is not sufficient to activate the setup(s). Look here for more infos.
transferTo
This allows the extension to transfer the required amount of reward token
to the contract. If the tokens are to be issued from a reserve, the _safeTransfer
function is called to transfer them there from the reserve; if they are to be minted, the _mintAndTransfer
function is called to first mint and then transfer them to the contract. This function is used to qualify a setup for activation (see here for more details).
_mintAndTransfer
This calls the classic IERC20 mint
method on the passed ERC20 token address
.
_burn
This calls the classic IERC20 burn
method on the passed ERC20 token address
.
Custom Extension
Ccustom extensions allows for external integration of Covenants farming with different projects, such as Organizations, DAO, dApps and custom smart contracts. The extension is the de facto integration mode.
For more details, see the Organization Based Farming Extension Contract section.
Last updated