Add new Farming Setups to a Contract
A host can add new setups to a contract in addition to those created during contract initialization.
To do this, they can use the setFarmingSetups
function:
The function uses as input the FarmingSetupConfiguration
struct:
Passing the following parameters:
add
->true
.disable
->false
.index
-> the index of the new Farming setup. This parameter is empty in case of adding a new setup.FarmingSetupInfo
-> struct containing the new setupdata
(look below).
The FarmingSetupInfo
struct is composed as follows:
free
-> must be passed astrue
blockDuration
-> duration of the setup in blocks.startBlock
-> start block of the setup*originalRewardPerBlock
->reward per block
chosen; it will remain the same unless the host modifies thereward per block
later.minStakeable
-> minimum amount of themain token
that can be staked by a position in the setup.renewtimes
-> if the setup is renewable or if it's one time.ammPlugin
-> AMM plugin address used for this setup (eg. the Uniswap AMM pluginaddress
).liquidityPoolTokenAddress
->address
of the liquidity pool used for the setup.mainTokenAddress
->address
of the chosen main token; used to perform some checks such as theminStakeable or maxStakeable
.ethereumAddress
-> for internal use only.involvingETH
-> a boolean value representing if ETH is involved as token in the setup (true
) or not (false
). Please refer to the AMM Aggregator section for more details.setupsCount
-> populated automatically by the contract and it's used for internal use only.lastSetupIndex -> populated automatically by the contract and it's used for internal use only.
*Optional. Represents the block from which activation of the setup can be attempted; activatesetup
cannot be called before that block
is reached. If startBlock
is set as zero, then the setup can be activated any time after it is created.
Last updated