Fraction ProtocolsubSkeletonFacetssubConnectorspurchaseToNonFundedConnectorscheckAndJumpToNonFunded

CheckAndJumpToNonFundedFacetStorage

This library handles the storage and logic for the CheckAndJumpToNonFunded connector facet.

_Connectors intervene at predetermined intermediate state(s) and progress campaigns to predetermined destination state(s). when applicable.

NOTE:

  • We do not use the custom:storage-location annotation because the Layout struct is defined in a library, which, as of now, does not support automated storage layout validation. However, the implementation adheres to the ERC-7201 structure in spirit by ensuring unique and collision-free storage slots using the ERC-7201 formula._

AlreadyInitialized

error AlreadyInitialized()

Thrown when attempting to re-initialize.

InvalidZeroStates

error InvalidZeroStates()

Thrown when attempting to set either the interferenceState or the destinationState to zero during initialization.

NonFinishedPurchaseDuration

error NonFinishedPurchaseDuration(uint256 campaignId)

Thrown when attempting to transition the campaign's state before the purchase phase has finished.

InvalidAmountsForNonFunded

error InvalidAmountsForNonFunded(uint256 campaignId)

Thrown when attempting to transition the campaign to its non-funded state while the funding target has been met.

STORAGE_SLOT

bytes32 STORAGE_SLOT

Unique identifier for the storage slot where the Layout struct is stored. Derived from the ERC7201 formula. STORAGE_SLOT: 0x5fdce075d8085842ef441542171bc72a7de04d60799d7598393667ab5e236b00

Layout

Struct containing the configuration information of the connector.

struct Layout {
  bool isInitialized;
  uint256 interferenceState;
  uint256 destinationState;
}

layout

function layout() internal pure returns (struct CheckAndJumpToNonFundedFacetStorage.Layout l)

Retrieves a reference to the Layout struct stored at the slot specified by STORAGE_SLOT unique identifier.

initPurchaseToNonFundedConnector

function initPurchaseToNonFundedConnector(struct CheckAndJumpToNonFundedFacetStorage.Layout l, bytes initPurchaseToNonFundedData) internal

Initializes the CheckAndJumpToNonFundedFacetStorage by registering the intermediate state (PURCHASE) and the destination state (STATE) for the connector.

Campaign states in a TMI-Fraction Platform are represented as uint256 values and are configured during the initialization of the generic StateFacet (see StateFacet.sol). Extra care should be taken to ensure consistency with the value schema used for the states, as defined in the StateFacet configuration (e.g., using enums).

Parameters

NameTypeDescription
lstruct CheckAndJumpToNonFundedFacetStorage.LayoutA reference to the Layout struct in storage.
initPurchaseToNonFundedDatabytesThe ABI-encoded data containing: - intermediateState: A uint256 representing the PURCHASE state for any campaign. - destinationState: A uint256 representing the NON_FUNDED state for any campaign.

checkAndJumpToNonFunded

function checkAndJumpToNonFunded(struct CheckAndJumpToNonFundedFacetStorage.Layout l, uint256 campaignId) internal

Transitions the specified campaign from its PURCHASE state to its NON_FUNDED state if the required conditions are met (i.e., the campaign failed to raise adequate funds within the designated time).

The campaignId must be in the PURCHASE state, and the purchase phase time window must have elapsed without the campaign reaching its funding target.

Parameters

NameTypeDescription
lstruct CheckAndJumpToNonFundedFacetStorage.LayoutA reference to the Layout struct in storage.
campaignIduint256The unique identifier of the targeted campaign.

On this page