Fraction ProtocolinterfacesskeletonInterfacespurchasePhaseInterfaces
IDoPurchaseFacet
IDoPurchaseFacet
DoPurchaseExecuted
initDoPurchaseFacet
setAndCheckDoPurchase
doPurchase
Updates a campaign's totalPacketsGathered
in general storage and interacts with the employed FundingPacket facet
to transfer the required funding packets from account
to the platform.
The general storage update and invocation of IFundingPacketFacet.transferFundingPackets()
occurs only if
pricePerFraction
is nonzero. This is crucial because pricePerFraction
can be set to zero by the platform's campaigns
(e.g., for a 100% 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 purchase process remains stable.
Parameters
Name | Type | Description |
---|---|---|
campaignId | uint256 | The ID of the targeted campaign. |
account | address | The account purchasing fractions. |
amountOfFractions | uint256 | The number of fractions being purchased. |
pricePerFraction | uint256 | The cost of a single fraction (in terms of input/funding packets). |