Fraction ProtocolskeletonFacets

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 BuybackState Internal 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 BuybackTime Internal 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 BuybackEligibility Internal 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 BuybackAmount Internal facet to verify that the specified amount of funds is adequate (e.g., accounting for configured interest).

  • Buyback Action: The Platform interacts with its DoBuyback Internal 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

event BuybackExecuted(uint256 campaignId, address buyer, uint256 buybackAmount)

Emitted at buyback().

buyback

function buyback(uint256 campaignId, uint256 packetsBuybackAmount) external

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

NameTypeDescription
campaignIduint256The unique identifier of the targeted campaign.
packetsBuybackAmountuint256The amount of funding packets to provide for the buyback.

On this page