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
Thrown when trying to initialize from non admin account.
FractionsRecovered
Emitted at recoverFractions()
.
initializeVestingSubSkeleton
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
Name | Type | Description |
---|---|---|
signer_ | address | The address of the designated off-chain service that generates the required signatures. |
recoverFractions
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
Name | Type | Description |
---|---|---|
campaignId | uint256 | The unique identifier of the targeted campaign. |
lostAccount | address | The account from which fractions will be recovered. |
recoveryAccount | address | The account to which the fractions will be transferred. |
id | uint256 | The ID of the fractions to be recovered (relevant only for semi-fungible fractions). |
amountOfFractions | uint256 | The number of fractions to recover (if applicable). |