ICampaignCreationSkeleton
It defines the interface of the CampaignCreationSkeleton facet.
initCampaignCreation
Initializes the CampaignCreationStorage
by registering the required and optional setter functions.
The selectors of the targeted setter functions must belong to the facets added to the diamond.
Setter functions corresponding to required selectors are executed mandatorily when a campaign is created.
In contrast, setter functions corresponding to optional selectors are executed only if the creator of the
campaign chooses to do so (see createCampaign()
).
This function can only be called by the Admin (see AccessControlStakingFacet.sol
).
Parameters
Name | Type | Description |
---|---|---|
initCampaignCreationData | bytes | The ABI-encoded data containing the following: - requiredSelectors An array of mandatory setter function selectors (bytes4). - optionalSelectors An array of optional setter function selectors (bytes4). |
createCampaign
Creates a staking campaign by deploying a dedicated CampaignInputAssetKeeper
and consequently
executing the required setter functions, as well as optionally executing the optional setter functions corresponding
to the specified optional selectors. The ID assigned to the newly created campaign is calculated by incrementing
the totalCampaigns
counter defined in the general storage.
_The required and optional setter functions are registered in the storage via the initCampaignCreation()
and are identified by their function selectors.
The dataToExecute
array is divided into two parts:
-
First Part: Contains the ABI-encoded input data for the required setter functions that are executed mandatorily.
The order of this data must exactly match the order of the required selectors specified during the execution of
initCampaignCreation()
. For example, if the required selectors are registered as [selectorA, selectorB, selectorC], then the first part ofdataToExecute
must be [dataForFunctionA, dataForFunctionB, dataForFunctionC, ..secondPart
..]. Any mismatch in order will lead to misconfigurations or likely cause a revert. -
Second Part: Contains the ABI-encoded input data for the specified optional setter functions (if any) to be executed.
Users must meet eligibility criteria to create campaigns (see creatorEligibility facets)._
Parameters
Name | Type | Description |
---|---|---|
campaignCreationData | bytes | The ABI-encoded data containing the following: - optionalSelectorsToExecute An array of optional setter function selectors (bytes4) to be executed. - dataToExecute An array with the ABI-encoded input data for the respective required and optional setter functions. |