šŸŽ‰ Welcome to PartyFinance documentation!
Protocol
Contracts
factories
PartyFactory

PartyFactory

Factory contract that deploys new Parties as EIP-2535 Diamond

partyBeacon

address partyBeacon

PartyBeacon address

Used for the old protocol. No longer used but must remain to avoid storage collision on upgrade

PLATFORM_ADDRESS

address PLATFORM_ADDRESS

Platform Fee Collector address

Address where the collected fees will be transferred

PLATFORM_FEE

uint256 PLATFORM_FEE

Platform Fee amount

Fee amount in bps

parties

mapping(address => bool) parties

Mapping of created parties

PFI

address PFI

PartyFinance (pFi) token address

PFI_FEE

uint256 PFI_FEE

PartyFinance (pFi) fee amount for party creations

PLATFORM_SENTINEL

address PLATFORM_SENTINEL

Platform Sentinel address

ready

bool ready

Factory status

Indicates whether the party creation is available or not

partyDefaultCut

struct IDiamondCut.FacetCut[] partyDefaultCut

Party default facet cut for Diamond implementation

PARTY_DIAMOND_CUT

address PARTY_DIAMOND_CUT

DiamondCutFacet address

PARTY_DIAMOND_INIT

address PARTY_DIAMOND_INIT

PartyInit address

initialize

function initialize(struct IDiamondCut.FacetCut[] _partyFacets, address _partyDiamondCut, address _partyDiamondInit, address _sentinel, address _collector, uint256 _fee, address _pfi, uint256 _pfi_fee, bool _ready) external

Initializes the PartyFactory

Parameters

NameTypeDescription
_partyFacetsstruct IDiamondCut.FacetCut[]Party facets data
_partyDiamondCutaddressDiamondCutFacet address
_partyDiamondInitaddressPartyInit address
_sentineladdressPlatform sentinel address
_collectoraddressPlatform collector address
_feeuint256Platform fee in bps
_pfiaddresspFi ERC20 Address
_pfi_feeuint256Party fee creation in pFi
_readyboolFactory status

setPlatformSentinel

function setPlatformSentinel(address _sentinel) public

Set platform sentinel address

Lets the PartyFactory owner to change the Platform sentinel address

Parameters

NameTypeDescription
_sentineladdressAddress of the new Platform Sentinel

setPlatformCollector

function setPlatformCollector(address _platform) public

Set platform fee collector address

Lets the PartyFactory owner to change the platform fee collector address

Parameters

NameTypeDescription
_platformaddressAddress of the new Platform Fee Collector

setPlatformFee

function setPlatformFee(uint256 _fee) public

Set platform fee

Lets the PartyFactory owner to change the Platform fee

Parameters

NameTypeDescription
_feeuint256New fee in bps (50 bps equals 0.5%)

setPfi

function setPfi(address _pfi) public

Set pFi token

Lets the PartyFactory owner to change the PFI token address

Parameters

NameTypeDescription
_pfiaddressAddress of the pFi Token address

setPfiFee

function setPfiFee(uint256 _pfi_fee) public

Set PFI token fee

Lets the PartyFactory owner to change the PFI token fee

Parameters

NameTypeDescription
_pfi_feeuint256New pFi party creation fee

setStatus

function setStatus(bool _ready) public

Set Factory status

Lets the PartyFactory owner change the status of the party creation

Parameters

NameTypeDescription
_readyboolNew status

setPartyFacets

function setPartyFacets(struct IDiamondCut.FacetCut[] _partyFacets) public

Set the Facets which all newly created Parties will share

Lets the PartyFactory owner change the initial diamond cut for new Parties

Parameters

NameTypeDescription
_partyFacetsstruct IDiamondCut.FacetCut[]Array of FacetCut structs

setDiamondCut

function setDiamondCut(address _partyDiamondCut) public

Set the EIP-2535 DiamondCutFacet address

Lets the PartyFactory owner change the DiamondCutFacet address

Parameters

NameTypeDescription
_partyDiamondCutaddressNew DiamondCut address

setPartyInit

function setPartyInit(address _partyDiamondInit) public

Set the Party init contract

Lets the PartyFactory owner change the PartyInit address

Parameters

NameTypeDescription
_partyDiamondInitaddressNew PartyInit contract address

createParty

function createParty(struct PartyInfo partyInfo, string tokenSymbol, uint256 initialDeposit, address denominationAsset) external payable returns (address party)

Create Party

Deploys a new Party Contract that follows the Diamond Standard (EIP-2535)

Parameters

NameTypeDescription
partyInfostruct PartyInfoPartyInfo struct containing basic information of the Party
tokenSymbolstringParty ERC-20 symbol
initialDeposituint256Initial deposit in denomination asset to be made by the party creator
denominationAssetaddressERC-20 denomination asset (stable coin)

getPlatformInfo

function getPlatformInfo() external view returns (address, uint256, address)

Returns the platform related info

Return Values

NameTypeDescription
[0]addressPlatform fee collector address
[1]uint256Platform fee amount
[2]addressPlatform sentinel address

getPartyDefaultFacetCut

function getPartyDefaultFacetCut() external view returns (struct IDiamondCut.FacetCut[] _defaultCut)

Returns the default party facet cut

It will always include the DiamondCutFacet

Return Values

NameTypeDescription
_defaultCutstruct IDiamondCut.FacetCut[]Default DiamondCut for fresh new Parties

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

Inherited from UUPSUpgradeable.

Function that should revert when msg.sender is not authorized to upgrade the contract. Called by upgradeTo and upgradeToAndCall.