NonFundedSubSkeletonGenesisIdsNID
Implementation of the NonFunded 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 investors to claim and receive their principal from failed (non-funded) campaigns through fraction balance redemption.
IMPORTANT:
-
This implementation relies on
genesisIdsand must always be used in conjunction withPurchaseSkeletonGenesisIds.sol, as well as internal facets that rely on it. -
The
genesisIdidentification schema for semi-fungible (ERC1155) fractions enables precise tracking of purchased prices within campaigns. This is achieved by assigning fraction genesis IDs based on the price at which they were purchased. For example, if a campaign offers three different prices (full price, and two discounted prices) for its fractions, theupperGenesisIdwill be set to2. Thus, based on the above example, depending on the price at which an investor purchases fractions, they will receive:
The process of investors redeeming genesisIds semi-fungible fractions for their principal within non-funded campaigns is
signatured-based gated (see TxAuthDataVerifierFacet) and is triggered when receiveFundsAfterNonFunded() is invoked,
following a sequential pipeline of five phases:
-
State Check: The Platform interacts with its
NonFundedStatesub-internal facet to verify that the campaign is in theNON_FUNDEDstate. -
Eligibility Check: The Platform interacts with its
ReceiveAfterNonFundedEligibilitysub-internal facet to verify that the user (caller) meets the campaign's eligibility criteria to claim and receive their principal. -
Purchased Price Retrieval: The Platform interacts with its
PurchaseDiscountinternal facet to retrieve the applicable purchase price based on the providedgenesisID of the fractions to be redeemed. -
Redeem Action: The Platform interacts with its
Fractioninternal facet and burns the specifiedgenesisID amount of fractions from the user. -
Receive Action: The Platform interacts with its
DoReceiveAfterNonFundedsub-internal facet and transfers the principal funds back to the user. The transferred funds are determined by the quantity of burned fractions and their corresponding purchase price._
UnauthorizedInitialization
Thrown when trying to initialize from non admin account.
FundsReceivedAfterNonFunded
Emitted at receiveFundsAfterNonFunded().
initializeNonFundedSubSkeleton
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. |
receiveFundsAfterNonFunded
Burns amountOfFractions of genesisId from the user and transfers the corresponding principal amount(s) of the
campaign's underlying funding asset(s) to the user.
_Users must meet eligibility criteria (see nonFunded Eligibility sub-internal facets).
This function can only be executed if the transaction calldata contains the required signature and expiration block
(see requireTxDataAuth modifier).
This action should only be allowed when the campaign's state is NON_FUNDED.
Emits a {FundsReceivedAfterNonFunded} event._
Parameters
| Name | Type | Description |
|---|---|---|
| campaignId | uint256 | The unique identifier of the targeted campaign. |
| genesisId | uint256 | The genesis ID of the semi-fungible fractions to redeem. |
| amountOfFractions | uint256 | The number of fractions to redeem. |
| discountOperationData | bytes |

