Change Setup Features
The host of a contract can modify some parameters of their setups, active or not. Changes are made by calling the setFarmingSetups
function (used not only to modify existing setups but also to deactivate them or create new ones).
To modify the features of a setup, pass the SetFarmingSetup
function input as follows:
add
->false
disable
->false
index
-> the index of the chosen setup to modifyFarmingSetupInfo
-> struct containing the new chosen setup data
For free setups, the following can also be modified (at any time):
RewardPerBlock
-> the host can set a higher or lowerRewardPerBlock
than the current oneRenewTimes
-> the host can set a higher or lowerRenewTimes
than the current one
In a locked setup, all that can be modified is RenewTimes
.
If the new RewardPerBlock
of the setup is greater than that the previous one, the contract requests from the extension the amount of reward tokens calculated as difference*duration
; difference equals new RewardPerBlock- old RewardPerBlock
, duration equals setup endBlock-current Block
.
Hosts should ensure the extension holds enough tokens before they modify a setup in this way.
If the new RewardPerBlock
of the setup is less than that of the previous one, the difference will be sent back to the treasury with all other unissued tokens later (in the manner defined in the Treasury section).
Changes are implemented with the following block.
Last updated