Fraction ProtocolsubSkeletonFacetsNIDnonFundedSubSkeletons

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 genesisIds and must always be used in conjunction with PurchaseSkeletonGenesisIds.sol, as well as internal facets that rely on it.

  • The genesisId identification 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, the upperGenesisId will be set to 2. Thus, based on the above example, depending on the price at which an investor purchases fractions, they will receive:

      - Fractions purchased at full price → ID = `0`
      - Fractions purchased at 20% discount → ID = `1`
      - Fractions purchased at 50% discount → ID = `2`

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 NonFundedState sub-internal facet to verify that the campaign is in the NON_FUNDED state.

  • Eligibility Check: The Platform interacts with its ReceiveAfterNonFundedEligibility sub-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 PurchaseDiscount internal facet to retrieve the applicable purchase price based on the provided genesis ID of the fractions to be redeemed.

  • Redeem Action: The Platform interacts with its Fraction internal facet and burns the specified genesis ID amount of fractions from the user.

  • Receive Action: The Platform interacts with its DoReceiveAfterNonFunded sub-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

error UnauthorizedInitialization(address account)

Thrown when trying to initialize from non admin account.

FundsReceivedAfterNonFunded

event FundsReceivedAfterNonFunded(uint256 campaignId, address receiver, uint256 amountOfFractions)

Emitted at receiveFundsAfterNonFunded().

initializeNonFundedSubSkeleton

function initializeNonFundedSubSkeleton(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.

receiveFundsAfterNonFunded

function receiveFundsAfterNonFunded(uint256 campaignId, uint256 genesisId, uint256 amountOfFractions, bytes discountOperationData) external

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

NameTypeDescription
campaignIduint256The unique identifier of the targeted campaign.
genesisIduint256The genesis ID of the semi-fungible fractions to redeem.
amountOfFractionsuint256The number of fractions to redeem.
discountOperationDatabytes

On this page