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
Thrown when attempting to re-initialize.
InvalidZeroStates
Thrown when attempting to set either the interferenceState
or the destinationState
to zero during initialization.
NonFinishedPurchaseDuration
Thrown when attempting to transition the campaign's state before the purchase phase has finished.
InvalidAmountsForNonFunded
Thrown when attempting to transition the campaign to its non-funded state while the funding target has been met.
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.
layout
Retrieves a reference to the Layout struct stored at the slot specified by STORAGE_SLOT
unique identifier.
initPurchaseToNonFundedConnector
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
Name | Type | Description |
---|---|---|
l | struct CheckAndJumpToNonFundedFacetStorage.Layout | A reference to the Layout struct in storage. |
initPurchaseToNonFundedData | bytes | The 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
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
Name | Type | Description |
---|---|---|
l | struct CheckAndJumpToNonFundedFacetStorage.Layout | A reference to the Layout struct in storage. |
campaignId | uint256 | The unique identifier of the targeted campaign. |