Fraction ProtocolinternalFacetsreceivePhaseFacetsdoReceiveFacetsreceiveAllGatheredFunds

ReceiveAllGatheredFundsFacetStorage

ReceiveAllGatheredFundsFacetStorage

AlreadyInitialized

error AlreadyInitialized()

Thrown when attempting to re-initialize.

InvalidZeroPostReceiveState

error InvalidZeroPostReceiveState()

Thrown when attempting to set the postReceiveState to zero.

STORAGE_SLOT

bytes32 STORAGE_SLOT

================================================== STORAGE =================================================

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

Layout

struct Layout {
  uint256 postReceiveState;
}

layout

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

Retrieves a reference to the Layout struct stored at a specified storage slot

initDoReceiveFacet

function initDoReceiveFacet(struct ReceiveAllGatheredFundsFacetStorage.Layout l, bytes initDoReceiveData) internal returns (uint256)

doReceive

function doReceive(struct ReceiveAllGatheredFundsFacetStorage.Layout l, uint256 campaignId, address account) internal returns (uint256)

Progresses a campaign's state to the configured postReceiveState and interacts with the employed FundingPacket facet to transfer the campaign's total gathered funding packets from the platform to account.

The invocation of IFundingPacketFacet.transferFundingPackets() occurs only if totalPacketsGathered is nonzero. This is crucial because a campaign's totalPacketsGathered can be ultimately zero (e.g., 100% purchase discount mechanism). Some implementations of tokens used as funding currency may require nonzero amounts, potentially causing a revert in their transfer functions. This safeguard ensures the receive process remains stable.

Parameters

NameTypeDescription
lstruct ReceiveAllGatheredFundsFacetStorage.LayoutA reference to the Layout struct in storage.
campaignIduint256The ID of the targeted campaign.
accountaddressThe account (e.g., issuer/creator) eligibile to receive the total gathered funds.

On this page