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
Name | Type | Description |
---|---|---|
[0] | string | Token name metadata |
symbol
function symbol() external view returns (string)
Queries the Party ERC-20 token symbol
Return Values
Name | Type | Description |
---|---|---|
[0] | string | Token symbol metadata |
decimals
function decimals() external pure returns (uint8)
Queries the Party ERC-20 token decimals
Return Values
Name | Type | Description |
---|---|---|
[0] | uint8 | Token decimals metadata |
totalSupply
function totalSupply() external view returns (uint256)
Queries the Party ERC-20 total minted supply
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | Token total supply |
balanceOf
function balanceOf(address account) external view returns (uint256)
Queries the Party ERC-20 balance of a given account
Parameters
Name | Type | Description |
---|---|---|
account | address | Address |
Return Values
Name | Type | Description |
---|---|---|
[0] | uint256 | Token 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
Name | Type | Description |
---|---|---|
[0] | address | Denomination asset address |
creator
function creator() external view returns (address)
Queries the Party's creator address
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The 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
Name | Type | Description |
---|---|---|
account | address | Address |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | Whether 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
Name | Type | Description |
---|---|---|
account | address | Address |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | Whether 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
Name | Type | Description |
---|---|---|
[0] | address[] | Array of ERC-20 addresses |
getTokenGates
function getTokenGates() external view returns (struct TokenGate[])
Queries the token gates in the Party
Return Values
Name | Type | Description |
---|---|---|
[0] | struct TokenGate[] | Array of TokenGate structs |
partyInfo
function partyInfo() external view returns (struct PartyInfo)
Queries the party information
Return Values
Name | Type | Description |
---|---|---|
[0] | struct PartyInfo | PartyInfo struct |
closed
function closed() external view returns (bool)
Queries if the Party is closed
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | Whether 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
Name | Type | Description |
---|---|---|
manager | address | Address of the user |
setManager | bool | Whether 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
Name | Type | Description |
---|---|---|
user | address | User address that will be joining the party |
amount | uint256 | Deposit amount in denomination asset |
allocation | struct LibSignatures.Allocation | Desired allocation of the deposit |
approval | struct LibSignatures.Sig | Verified 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
Name | Type | Description |
---|---|---|
user | address | User address that will be making the deposit |
amount | uint256 | Deposit amount in denomination asset |
allocation | struct LibSignatures.Allocation | Desired allocation of the deposit |
approval | struct LibSignatures.Sig | Verified 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
Name | Type | Description |
---|---|---|
amountPT | uint256 | Amount of PartyTokens of the requester to withdraw |
allocation | struct LibSignatures.Allocation | Desired allocation of the withdraw |
approval | struct LibSignatures.Sig | Verified sentinel signature of the desired withdraw |
liquidate | bool | Whether 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
Name | Type | Description |
---|---|---|
allocation | struct LibSignatures.Allocation | Desired allocation of the swap |
approval | struct LibSignatures.Sig | Verified 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
Name | Type | Description |
---|---|---|
kickingMember | address | address of the member to be kicked |
allocation | struct LibSignatures.Allocation | desired allocation of the withdraw |
approval | struct LibSignatures.Sig | verified sentinel signature of the desired kick |
liquidate | bool | whether 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
Name | Type | Description |
---|---|---|
allocation | struct LibSignatures.Allocation | Desired allocation of the withdraw |
approval | struct LibSignatures.Sig | Verified sentinel signature of the desired withdraw |
liquidate | bool | Whether 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
Name | Type | Description |
---|---|---|
_partyInfo | struct PartyInfo | PartyInfo struct |
editTokenGates
function editTokenGates(struct TokenGate[] _tokenGates) external
Edits the token gating of the party
The user must be a manager
Parameters
Name | Type | Description |
---|---|---|
_tokenGates | struct TokenGate[] | Array of TokenGate structs |