Fraction ProtocolsubSkeletonFacets

RecoverFractionsSubSkeleton

Implementation of the RecoverFractions sub-skeleton facet for the TMI-Fraction Protocol.

_This facet serves as a sub-core component (sub-skeleton) of a TMI-Fraction Platform, enabling eligible users (e.g., campaign issuers) to recover fractions (purchased from campaigns) on behalf of other eligible users whose accounts have been compromised or lost, and transfer them to designated new accounts.


IMPORTANT:

  • This implementation is intended only for Platforms that issue recoverable fungible or semi-fungible fractions (see fraction internal facets).

  • Recoverable fractions do not require approval to be transferred by addresses (e.g., the Platform) with the recoverer role.


The process of recovering fractions is triggered when recoverFractions() is executed, following a sequential pipeline of four phases:

  • State Check: The Platform interacts with its RecoverFractionsState sub-internal facet to verify that the current state of the targeted campaign allows the recovery process to occur.

  • Subject Eligibility Check: The Platform interacts with its LostAccountEligibility sub-internal facet to verify the eligibility of the specified lost account address to recover its fractions (e.g., the lost account must have previously specified that such a process is permitted).

  • Recoverer Eligibility Check: The Platform interacts with its RecoverFractionsEligibility sub-internal facet to verify the eligibility of the user (caller) attempting the recovery (e.g., only the creator of the campaign is allowed).

  • Recovery Action: The Platform interacts with its DoRecoverFractions sub-internal facet to transfer the specified amount of fractions from the lost account to the specified new account._

FractionsRecovered

event FractionsRecovered(uint256 campaignId, address lostAccount, address recoveryAccount, uint256 amountOfFractions)

Emitted at recoverFractions().

recoverFractions

function recoverFractions(uint256 campaignId, address lostAccount, address recoveryAccount, uint256 id, uint256 amountOfFractions) external

Recovers the specified amount of fractions (purchased from the campaign identified by campaignId) from lostAccount and transfers them to recoveryAccount.

_Both the caller (recoverer) and lostAccount must meet eligibility criteria (see recoverFractions & lostAccount Eligibility sub-internal facets).

Emits a {FractionsRecovered} event._

Parameters

NameTypeDescription
campaignIduint256The unique identifier of the targeted campaign.
lostAccountaddressThe account from which fractions will be recovered.
recoveryAccountaddressThe account to which the fractions will be transferred.
iduint256The ID of the fractions to be recovered (relevant only for semi-fungible fractions).
amountOfFractionsuint256The number of fractions to recover (if applicable).

On this page