Modify 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:

struct FarmingSetupConfiguration {
    bool add; 
    bool disable;
    uint256 index; 
    FarmingSetupInfo info; 
}
  • add -> false

  • disable -> false

  • index -> the index of the chosen setup to modify

  • FarmingSetupInfo -> struct containing the new chosen setup data

The following parameters can be modified (at any time):

  • RewardPerBlock -> the host can set a higher or lower RewardPerBlock than the current one

  • RenewTimes -> the host can set a higher or lower RenewTimes than the current one

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