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
Name | Type | Description |
---|---|---|
_partyFacets | struct IDiamondCut.FacetCut[] | Party facets data |
_partyDiamondCut | address | DiamondCutFacet address |
_partyDiamondInit | address | PartyInit address |
_sentinel | address | Platform sentinel address |
_collector | address | Platform collector address |
_fee | uint256 | Platform fee in bps |
_pfi | address | pFi ERC20 Address |
_pfi_fee | uint256 | Party fee creation in pFi |
_ready | bool | Factory status |
setPlatformSentinel
function setPlatformSentinel(address _sentinel) public
Set platform sentinel address
Lets the PartyFactory owner to change the Platform sentinel address
Parameters
Name | Type | Description |
---|---|---|
_sentinel | address | Address 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
Name | Type | Description |
---|---|---|
_platform | address | Address 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
Name | Type | Description |
---|---|---|
_fee | uint256 | New 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
Name | Type | Description |
---|---|---|
_pfi | address | Address 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
Name | Type | Description |
---|---|---|
_pfi_fee | uint256 | New 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
Name | Type | Description |
---|---|---|
_ready | bool | New 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
Name | Type | Description |
---|---|---|
_partyFacets | struct 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
Name | Type | Description |
---|---|---|
_partyDiamondCut | address | New DiamondCut address |
setPartyInit
function setPartyInit(address _partyDiamondInit) public
Set the Party init contract
Lets the PartyFactory owner change the PartyInit address
Parameters
Name | Type | Description |
---|---|---|
_partyDiamondInit | address | New 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
Name | Type | Description |
---|---|---|
partyInfo | struct PartyInfo | PartyInfo struct containing basic information of the Party |
tokenSymbol | string | Party ERC-20 symbol |
initialDeposit | uint256 | Initial deposit in denomination asset to be made by the party creator |
denominationAsset | address | ERC-20 denomination asset (stable coin) |
getPlatformInfo
function getPlatformInfo() external view returns (address, uint256, address)
Returns the platform related info
Return Values
Name | Type | Description |
---|---|---|
[0] | address | Platform fee collector address |
[1] | uint256 | Platform fee amount |
[2] | address | Platform 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
Name | Type | Description |
---|---|---|
_defaultCut | struct 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
.