Skip to content

GeneralGuildPreset

GeneralGuildPreset

ForbiddenGroupName

error ForbiddenGroupName(string name)

CannotRemoveGroupWithMembers

error CannotRemoveGroupWithMembers(string name)

InvalidZeroAddress

error InvalidZeroAddress()

EmptyGroupName

error EmptyGroupName()

GroupRemoved

event GroupRemoved(string groupName)

MembersAdded

event MembersAdded(string groupName, address[] members)

MembersRemoved

event MembersRemoved(string groupName, address[] members)

ListingTermsUpdated

event ListingTermsUpdated(uint256 universeId, string groupName, struct Assets.AssetId[] assetIds, struct IListingTermsRegistry.ListingTerms config)

_GUILD_MEMBER

string _GUILD_MEMBER

Group fallback name for Guild members

_NON_GUILD_MEMBER

string _NON_GUILD_MEMBER

Group fallback name for non-guild members

_AUTHORIZED_LC_PRESET_MANAGER

string _AUTHORIZED_LC_PRESET_MANAGER

_GUILD_MEMBER_HASH

bytes32 _GUILD_MEMBER_HASH

_NON_GUILD_MEMBER_HASH

bytes32 _NON_GUILD_MEMBER_HASH

ListingTermsStore

struct ListingTermsStore {
  bool exists;
  struct IListingTermsRegistry.ListingTerms config;
}

_members

mapping(string => struct EnumerableSet.AddressSet) _members

Group to members mapping

_memberOf

mapping(address => struct EnumerableSet.Bytes32Set) _memberOf

Member => Hashed Group Set

_groupNames

mapping(bytes32 => string) _groupNames

Group Hash to Group Name mapping

_groups

struct EnumerableSet.Bytes32Set _groups

Registered group set

_configs

mapping(bytes32 => mapping(uint256 => mapping(bytes32 => struct GeneralGuildPreset.ListingTermsStore))) _configs

Hashed Group Name => Universe ID => Asset IDs hash => Listing Terms

_metahubContract

contract IMetahub _metahubContract

_dacContract

contract IDelegatedAccessControl _dacContract

Contract which holds access control (e.g. ListingConfiguratorRegistry)

whenValidName

modifier whenValidName(string name)

onlyAuthorized

modifier onlyAuthorized()

constructor

constructor() public

Constructor that gets called for the implementation contract.

initialize

function initialize(address dac, address metahub) external

addMembers

function addMembers(string group, address[] members) external

Creates a group (if needed) and adds members to given group

Name Type Description
group string Group name
members address[] Group member addresses

removeMembers

function removeMembers(string group, address[] members) external

Removes members from given group

Name Type Description
group string Group name
members address[] Members to remove

removeGroup

function removeGroup(string group) external

Removes group completly. Note: all members must be removed from group using {removeMembers} prior calling this function

Name Type Description
group string Group name

setListingTerms

function setListingTerms(uint256 universeId, string group, struct Assets.AssetId[] assetIds, struct IListingTermsRegistry.ListingTerms config) external

Sets listing terms for given group and universe

Name Type Description
universeId uint256 - Universe ID
group string - Group name
assetIds struct Assets.AssetId[]
config struct IListingTermsRegistry.ListingTerms - Listing terms

setGuildMemberListingTerms

function setGuildMemberListingTerms(uint256 universeId, struct Assets.AssetId[] assetIds, struct IListingTermsRegistry.ListingTerms config) external

Sets listing terms for guild member when listing terms are not specified for groups in which member is participated

setNonGuildMemberListingTerms

function setNonGuildMemberListingTerms(uint256 universeId, struct Assets.AssetId[] assetIds, struct IListingTermsRegistry.ListingTerms config) external

Sets listing terms for non-guild members

getListingTerms

function getListingTerms(uint256 universeId, string group, struct Assets.AssetId[] assetIds) external view returns (struct IListingTermsRegistry.ListingTerms config)

Gets listing terms for universe and group

Name Type Description
universeId uint256 Universe ID
group string Group Name
assetIds struct Assets.AssetId[] Asset IDs

getGuildMemberListingTerms

function getGuildMemberListingTerms(uint256 universeId, struct Assets.AssetId[] assetIds) external view returns (struct IListingTermsRegistry.ListingTerms config)

Gets listing terms for guild members

Name Type Description
universeId uint256 Universe ID
assetIds struct Assets.AssetId[]

getNonGuildMemberListingTerms

function getNonGuildMemberListingTerms(uint256 universeId, struct Assets.AssetId[] assetIds) external view returns (struct IListingTermsRegistry.ListingTerms config)

Gets listing terms for non-guild members

Name Type Description
universeId uint256 Universe ID
assetIds struct Assets.AssetId[]

getGroups

function getGroups(uint256 offset, uint256 limit) external view returns (string[] groups, uint256 total)

Gets pagable list of registered groups

Name Type Description
offset uint256 List offset
limit uint256 List limit

getGroupMembers

function getGroupMembers(string name, uint256 offset, uint256 limit) external view returns (address[] members, uint256 total)

Gets pagable list of group members

Name Type Description
name string
offset uint256 List offset
limit uint256 List limit

getMemberOf

function getMemberOf(address account, uint256 offset, uint256 limit) external view returns (string[] groups, uint256 total)

Gets pagable list of groups for given account

Name Type Description
account address Member account
offset uint256 List offset
limit uint256 List limit

__getListingTerms

function __getListingTerms(struct Rentings.Params params, struct Listings.Listing listing, uint256 universeId) external view returns (struct IListingTermsRegistry.ListingTerms[] listingTerms)

Returns list of listing terms for given listing and renting parameters

__canListAssets

function __canListAssets(struct Assets.Asset[], struct Listings.Params params, uint32, bool) external view returns (bool canList, string errorMessage)

getDAC

function getDAC() external view returns (address)

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

_getListingTermsForGroups

function _getListingTermsForGroups(struct EnumerableSet.Bytes32Set groups, uint256 universeId, bytes32 assetsHash, uint256 groupCount) internal view returns (struct IListingTermsRegistry.ListingTerms[])

_getPagedGroups

function _getPagedGroups(struct EnumerableSet.Bytes32Set groupSet, uint256 offset, uint256 limit) internal view returns (string[] result, uint256 total)

_getSingleListingTerms

function _getSingleListingTerms(struct GeneralGuildPreset.ListingTermsStore store) internal view returns (struct IListingTermsRegistry.ListingTerms[] result)

_dac

function _dac() internal view returns (contract IDelegatedAccessControl)

_metahub

function _metahub() internal view returns (contract IMetahub)

_hash

function _hash(string data) internal pure returns (bytes32)

returns hash of given string