Skeleton Facets
In the context of platform configuration and deployment, the term skeleton
refers to a main facet that provides mandatory
functionality used on the platform. Skeleton facets must be included when deploying a new platform. The basic configuration for
both Sale and Sale with Buyback requires the following facets to be selected:
Sale requires 3 skeleton Facets:
CreateFractionsSkeleton
- Provides a set of functions to create fractions.PurchaseSkeleton
- Exposes functions that allow users to purchase fractions.ReceiveSkeleton
- Provides functionality to receive funds collected from the sale.
Sale with buyback requires 5 skeleton Facets:
CreateFractionsSkeleton
- Provides a set of functions to create fractions.PurchaseSkeleton
- Exposes functions that allow users to purchase fractions.ReceiveSkeleton
- Provides functionality to receive funds collected from the sale.BuybackSkeleton
- Enables the buyback functionality for users.ReceiveAfterBuybackSkeleton
- Allows users to retrieve principal and interest after the buyback.
If a use-case instance falls under the Sale category, then it is clear that there is no Buyback or ReceiveAfterBuyback facets involved.
Eligibility Verification
Each skeleton implements the eligibility interface, which verifies whether a particular user address can invoke a specific function.
For instance, the Purchase
skeleton interacts with the
IPurchaseEligibilityFacet
interface, which allows checking whether a user can execute the purchase
function.
Below is an example of the function call to check the account eligibility in the Purchase
skeleton:
The implementation of eligibility checks enables a robust mechanism where only accounts (users) matching specific criteria can participate in a sale.
Developers are free to customize the eligibility verification mechanism by modifying the corresponding eligibility facets.
Note
Each skeleton interacts with its corresponding eligibility interface, meaning that all functions provided by the skeletons have integrated gating mechanisms. As a result, when users interact with the main functionality of the platform, they are automatically verified.