Blocking
Users and groups have the ability to block other users from tagging them, liking their posts, and being shown each others data when queried. Blacklists and Whitelist options are available.
Table of Contents
Events
toggleWhiteListLog
Emits when the using of a whitelist is toggled on/off.
logWhitelistUpdate
Emits when a whitelist is updated.
logBlacklistUpdate
Emits when a blacklist is updated.
logNFTReqUpdate
Emits when the requirements for a poster to own a minimum amount of NFTs to be able to post in a group are updated.
Black & White Lists
Whitelist = NO ONE can message owner EXCEPT for addresses explicitly allowed here by the owner.
Blacklist = EVERYONE can message owner EXCEPT for addresses explicitly blocked here by the owner.
isAllowedByNFT
Checks to see if the group is using NFT whitelisting and if so, do they have the minimum required amount of tokens from the ERC20 / ERC721 / ERC1155 contract to be allowed to post into the group.
Parameters
requesterAddress
address
User or group address requesting to post into the group
groupAddress
address
The group that the requester wants to post into
Returns
output
bool
True if the requester is allowed to perform action, False otherwise
Example
isAllowed
Checks to see if the requesterAddress is allowed to perform actions against targetAddress.
Parameters
requesterAddress
address
User or group address requesting to perform an action to a user or group
targetAddress
address
User or group address that the requester wants to perform an action against
Returns
output
bool
True if the requester is allowed to perform action, False otherwise
Example
getList
Get a list of user addresses that are either blocked (when using a blacklist) or allowed (when using a whitelist).
Parameters
usrAddress
address
The address of the user to get the black or whitelist of users from
blackList
bool
True for black list, False for white list
startFrom
uint256
Used or paginating through the results
Returns
output
address[]
An array of addresses in the list queried
Example
toggleWhiteList
Toggle the using of a whitelist on / off. Can be used for groups as well if a groupID is passed, only the group owner can perform this function.
Parameters
groupID
uint256
Can pass in if this is a group being managed, otherwise pass in 0 for a user
Example
updateNFTReq
Require a poster to own a minimum amount of NFTs (ERC 20 / 721 / 1155) to be able to post in your group. Can only be called by Group owners.
Parameters
contractAddress
address
Address of the NFT contract (0x0 disables requirement)
minimumReq
uint256
Minimum amount of NFTs owned by wallet from contractAddress to be allowed to post in group
groupID
uint256
Group ID to Apply to
Example
updateWhitelist
Toggle an address to be on / off the whitelist. If a groupID is passed, only the group owner can perform this function.
Parameters
toToggle
address
Address of user or group
groupID
uint256
Can pass in if this is a group being managed, otherwise pass in 0 for a user
Example
updateBlacklist
This function is used to manage an address or group in the blacklist. The blacklist includes addresses or groups which are denied to message the owner. This function could be performed only by the group owner. An address or group can be added to or removed from the blacklist. If it's already added, it would be removed, and if it's not added, it would be added to the list.
Expected Inputs
toToggle
address
The address of the user or group to be managed.
groupID
uint256
The ID of the group being managed. Pass 0 if it's a user being managed.
Returns
No return value.
Code Sample
Last updated