Staking Protocolinterfacesskeletons

ICampaignCreationSkeleton

It defines the interface of the CampaignCreationSkeleton facet.

initCampaignCreation

function initCampaignCreation(bytes initCampaignCreationData) external

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

NameTypeDescription
initCampaignCreationDatabytesThe 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

function createCampaign(bytes campaignCreationData) external

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:

Users must meet eligibility criteria to create campaigns (see creatorEligibility facets)._

Parameters

NameTypeDescription
campaignCreationDatabytesThe 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.