Fraction ProtocolsubSkeletonFacetsNID

RecoverFractionsSubSkeletonNID

Implementation of the RecoverFractions sub-skeleton facet with Compilot gating 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 signatured-based gated (see TxAuthDataVerifierFacet) and is triggered when recoverFractions() is called, 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._

UnauthorizedInitialization

error UnauthorizedInitialization(address account)

Thrown when trying to initialize from non admin account.

FractionsRecovered

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

Emitted at recoverFractions().

initializeVestingSubSkeleton

function initializeVestingSubSkeleton(address signer_) external

Initializes the TxAuthDataVerifierFacetStorage by registering the attestor address.

_This function can only be called by the Admin (see AccessControlFacet.sol).

IMPORTANT:

  • If the platform uses multiple NID skeletons or subskeletons, only one of them can be initialized._

Parameters

NameTypeDescription
signer_addressThe address of the designated off-chain service that generates the required signatures.

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).

This function can only be executed if the transaction calldata contains the required signature and expiration block (see requireTxDataAuth modifier).

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