Fraction ProtocolskeletonFacetsNID

ReceiveSkeletonNID

Implementation of the ReceiveSkeleton skeleton facet with Compilot gating for the TMI-Fraction Protocol.

_This facet serves as a core component (skeleton) of a TMI-Fraction Platform, enabling the receipt of gathered funds (from purchased fractions) allocated to campaigns.

The process of receiving a campaign's gathered funds is signatured-based gated (see TxAuthDataVerifierFacet) and is triggered when receiveFunds() is called, following a sequential pipeline of three phases:

  • State Check: The Platform interacts with its ReceiveState Internal facet to verify that the current state of the targeted campaign is the correct state for funds receipt to occur.

  • Eligibility Check: The Platform interacts with its ReceiveEligibility Internal facet to verify the eligibility of the user (caller) attempting to receive the funds (e.g., only the creator of the campaign is allowed).

  • Receive Action: The Platform interacts with its DoReceive Internal facet to transfer the funds gathered from the Platform to the user (caller)._

UnauthorizedInitialization

error UnauthorizedInitialization(address account)

Thrown when trying to initialize from non admin account.

FundsReceived

event FundsReceived(uint256 campaignId, address receiver)

Emitted at receiveFunds().

initializeReceiveSkeleton

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

receiveFunds

function receiveFunds(uint256 campaignId) external

Transfers the specified campaign's gathered funds (from purchased fractions) from the Platform to the user.

_User must meet eligibility criteria to receive the campaign's funds (see receive Eligibility internal facets).

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

Emits a {FundsReceived} event._

Parameters

NameTypeDescription
campaignIduint256The unique identifier of the targeted campaign.

On this page