BuybackSkeleton
Implementation of the BuybackSkeleton skeleton facet for the TMI-Fraction Protocol.
_This facet serves as a core component (skeleton) of a TMI-Fraction Platform, enabling the buyback of a campaign's wrapped asset(s). This skeleton should only be utilized by Platforms that support SALE BBO (BuyBackOption) campaigns.
The process of buying back a campaign's wrapped asset(s) is triggered when buyback() is executed, following a sequential
pipeline of five phases:
-
State Check: The Platform interacts with its
BuybackStateInternal facet to verify that the current state of the targeted campaign is the correct state for buyback to occur. -
Time Check: The Platform interacts with its
BuybackTimeInternal facet to verify that the current timestamp is within the configured time-window during which the buyback is expected to happen. -
Eligibility Check: The Platform interacts with its
BuybackEligibilityInternal facet to verify the eligibility of the user (caller) attempting the buyback (e.g., only the creator of the campaign is allowed). -
Amount Check: The Platform interacts with its
BuybackAmountInternal facet to verify that the specified amount of funds is adequate (e.g., accounting for configured interest). -
Buyback Action: The Platform interacts with its
DoBuybackInternal facet to transfer the funds from the user (caller) to the Platform and subsequently unlock and transfer (unwrap) the wrapped asset(s) to the user, thereby finalizing the buyback process._
BuybackExecuted
Emitted at buyback().
buyback
Transfers the specified amount of funds (in terms of the campaign's configured packet) from the user (caller) to the Platform in exchange for the campaign's wrapped asset(s), which are then unwrapped and received by the user.
_User must meet eligibility criteria (see buyback Eligibility internal facets) as well as configured time-constraints
(see buyback Time internal facets) to perform a buyback.
Emits a {BuybackExecuted} event._
Parameters
| Name | Type | Description |
|---|---|---|
| campaignId | uint256 | The unique identifier of the targeted campaign. |
| packetsBuybackAmount | uint256 | The amount of funding packets to provide for the buyback. |

