ReceiveNonPurchasedWrappedAssetsSubSkeletonNID
Implementation of the ReceiveNonPurchasedWrappedAssets 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 claim and receive any unpurchased wrapped assets from campaigns after their purchase period has successfully ended (e.g., the campaign reached or surpassed its softcap but did not reach its hardcap).
IMPORTANT:
- This implementation is intended only for Platforms that issue campaigns with either fungible (e.g., ERC20) or semi-fungible (e.g., ERC1155) wrapped (underlying) assets.
The process of receiving unpurchased wrapped assets from a campaign is is signatured-based gated (see TxAuthDataVerifierFacet
) and
is triggered when receiveNonPurchasedWrappedAssets()
is called, following a sequential pipeline with three phases:
-
State Check: The Platform interacts with its
ReceiveNonPurchasedWrappedAssetsState
sub-internal facet to verify that the current state of the targeted campaign allows the action (e.g., only permissible inpost-FUNDED
states indicating that the purchase period has ended successfully). -
Eligibility Check: The Platform interacts with its
ReceiveNonPurchasedWrappedAssetsEligibility
sub-internal facet to verify that the user (caller) meets the campaign's eligibility criteria (e.g., campaign issuer only). -
Receive Action: The Platform interacts with its
DoReceiveNonPurchasedWrappedAssets
sub-internal facet to burn any remaining fractions of the campaign from the Platform (not owned by investors), unwrap the corresponding amount(s) of asset(s) held in the campaign's Vault, and transfer them to the user._
UnauthorizedInitialization
Thrown when trying to initialize from non admin account.
NonPurchasedWrappedAssetsReceived
Emitted at receiveNonPurchasedWrappedAssets()
.
initializeReceiveNonPurchasedWrappedAssetsSubSkeleton
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. |
receiveNonPurchasedWrappedAssets
Burns all unpurchased fractions (those not owned by investors) from the specified campaign, unwraps the corresponding amount(s) of underlying asset(s) held in the campaign's Vault, and transfers them to the caller (user).
_Users must meet eligibility criteria (see receiveNonPurchasedWrappedAssets
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 after the campaign's purchase period has successfully ended.
Emits a {NonPurchasedWrappedAssetsReceived} event._
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The unique identifier of the targeted campaign. |