šŸŽ‰ Welcome to PartyFinance documentation!
Protocol
Contracts
facets
PartyFacet

OwnerNotKickable

error OwnerNotKickable()

"Party manager is not kickable"

UserNotKickable

error UserNotKickable()

"Non-member user is not kickable"

ManagerNotKickable

error ManagerNotKickable()

"Manager user is not kickable. Need to remove role first"

NeedsInvitation

error NeedsInvitation()

"User needs invitation to join private party"

PartyFacet

Facet that contains the main actions to interact with a Party

name

function name() external view returns (string)

Queries the Party ERC-20 token name

Return Values

NameTypeDescription
[0]stringToken name metadata

symbol

function symbol() external view returns (string)

Queries the Party ERC-20 token symbol

Return Values

NameTypeDescription
[0]stringToken symbol metadata

decimals

function decimals() external pure returns (uint8)

Queries the Party ERC-20 token decimals

Return Values

NameTypeDescription
[0]uint8Token decimals metadata

totalSupply

function totalSupply() external view returns (uint256)

Queries the Party ERC-20 total minted supply

Return Values

NameTypeDescription
[0]uint256Token total supply

balanceOf

function balanceOf(address account) external view returns (uint256)

Queries the Party ERC-20 balance of a given account

Parameters

NameTypeDescription
accountaddressAddress

Return Values

NameTypeDescription
[0]uint256Token balance of a given ccount

denominationAsset

function denominationAsset() external view returns (address)

Queries the Party denomination asset (ERC-20)

The denomination asset is used for depositing into the party, which is an ERC-20 stablecoin

Return Values

NameTypeDescription
[0]addressDenomination asset address

creator

function creator() external view returns (address)

Queries the Party's creator address

Return Values

NameTypeDescription
[0]addressThe address of the user who created the Party

members

function members(address account) external view returns (bool)

Queries the Party's member access of given address

Parameters

NameTypeDescription
accountaddressAddress

Return Values

NameTypeDescription
[0]boolWhether if the given address is a member

managers

function managers(address account) external view returns (bool)

Queries the Party's manager access of given address

Parameters

NameTypeDescription
accountaddressAddress

Return Values

NameTypeDescription
[0]boolWhether if the given address is a manager

getTokens

function getTokens() external view returns (address[])

Queries the ERC-20 tokens held in the Party

Will display the tokens that were acquired through a Swap/LimitOrder method

Return Values

NameTypeDescription
[0]address[]Array of ERC-20 addresses

getTokenGates

function getTokenGates() external view returns (struct TokenGate[])

Queries the token gates in the Party

Return Values

NameTypeDescription
[0]struct TokenGate[]Array of TokenGate structs

partyInfo

function partyInfo() external view returns (struct PartyInfo)

Queries the party information

Return Values

NameTypeDescription
[0]struct PartyInfoPartyInfo struct

closed

function closed() external view returns (bool)

Queries if the Party is closed

Return Values

NameTypeDescription
[0]boolWhether if the Party is already closed or not

handleManager

function handleManager(address manager, bool setManager) external

Handles the managers for the party

The user must be the creator of the party

Parameters

NameTypeDescription
manageraddressAddress of the user
setManagerboolWhether to set the user as manager or remove it

joinParty

function joinParty(address user, uint256 amount, struct LibSignatures.Allocation allocation, struct LibSignatures.Sig approval) external

Joins and deposits into the party

For private parties, the joiner must have an accepted join request by a manager. The user must not be a member and the party must be opened In case the party has set a token gating, it will perform the check to ensure the user holds sufficient funds

Parameters

NameTypeDescription
useraddressUser address that will be joining the party
amountuint256Deposit amount in denomination asset
allocationstruct LibSignatures.AllocationDesired allocation of the deposit
approvalstruct LibSignatures.SigVerified sentinel signature of the desired deposit

deposit

function deposit(address user, uint256 amount, struct LibSignatures.Allocation allocation, struct LibSignatures.Sig approval) external

Deposits into the party

The user must be a member and the party must be opened

Parameters

NameTypeDescription
useraddressUser address that will be making the deposit
amountuint256Deposit amount in denomination asset
allocationstruct LibSignatures.AllocationDesired allocation of the deposit
approvalstruct LibSignatures.SigVerified sentinel signature of the desired deposit

withdraw

function withdraw(uint256 amountPT, struct LibSignatures.Allocation allocation, struct LibSignatures.Sig approval, bool liquidate) external

Withdraw funds from the party

The user must be a member

Parameters

NameTypeDescription
amountPTuint256Amount of PartyTokens of the requester to withdraw
allocationstruct LibSignatures.AllocationDesired allocation of the withdraw
approvalstruct LibSignatures.SigVerified sentinel signature of the desired withdraw
liquidateboolWhether to liquidate assets (convert all owned assets into denomination asset) or to withdraw assets as it is

swapToken

function swapToken(struct LibSignatures.Allocation allocation, struct LibSignatures.Sig approval) external

Swap a token with the party's fund

The user must be a manager. Only swaps a single asset.

Parameters

NameTypeDescription
allocationstruct LibSignatures.AllocationDesired allocation of the swap
approvalstruct LibSignatures.SigVerified sentinel signature of the desired swap

kickMember

function kickMember(address kickingMember, struct LibSignatures.Allocation allocation, struct LibSignatures.Sig approval, bool liquidate) external

Kick a member from the party

The user must be a manager

Parameters

NameTypeDescription
kickingMemberaddressaddress of the member to be kicked
allocationstruct LibSignatures.Allocationdesired allocation of the withdraw
approvalstruct LibSignatures.Sigverified sentinel signature of the desired kick
liquidateboolwhether to liquidate assets (convert all owned assets into denomination asset) or to transfer assets as it is

leaveParty

function leaveParty(struct LibSignatures.Allocation allocation, struct LibSignatures.Sig approval, bool liquidate) external

Leave the party (withdraw all funds and remove membership)

The user must be a member

Parameters

NameTypeDescription
allocationstruct LibSignatures.AllocationDesired allocation of the withdraw
approvalstruct LibSignatures.SigVerified sentinel signature of the desired withdraw
liquidateboolWhether to liquidate assets (convert all owned assets into denomination asset) or to withdraw assets as it is

closeParty

function closeParty() external

Close the party

The user must be a creator and the party must be opened

editPartyInfo

function editPartyInfo(struct PartyInfo _partyInfo) external

Edits the party information

The user must be a creator

Parameters

NameTypeDescription
_partyInfostruct PartyInfoPartyInfo struct

editTokenGates

function editTokenGates(struct TokenGate[] _tokenGates) external

Edits the token gating of the party

The user must be a manager

Parameters

NameTypeDescription
_tokenGatesstruct TokenGate[]Array of TokenGate structs