Skip to main content

IBosonGroupHandler

View Source: contracts/interfaces/handlers/IBosonGroupHandler.sol

↗ Extends: IBosonGroupEvents

IBosonGroupHandler

Handles creation, voiding, and querying of groups within the protocol.
The ERC-165 identifier for this interface is: 0x08ccdf47

Functions

createGroup

Creates a group.
Emits a GroupCreated event if successful.
Reverts if:
- Caller is not an assistant
- Any of offers belongs to different seller
- Any of offers does not exist
- Offer exists in a different group
- Condition fields are invalid

function createGroup(struct BosonTypes.Group _group,
struct BosonTypes.Condition _condition)
external

Arguments

NameTypeDescription
_groupBosonTypes.Groupthe fully populated struct with group id set to 0x0
_conditionBosonTypes.Conditionthe fully populated condition struct

addOffersToGroup

Adds offers to an existing group.
Emits a GroupUpdated event if successful.
Reverts if:
- Caller is not the seller
- Offer ids param is an empty list
- Group does not exist
- Any of offers belongs to different seller
- Any of offers does not exist
- Offer exists in a different group
- Offer ids param contains duplicated offers

function addOffersToGroup(uint256 _groupId,
uint256[] _offerIds)
external

Arguments

NameTypeDescription
_groupIduint256the id of the group to be updated
_offerIdsuint256[]array of offer ids to be added to the group

removeOffersFromGroup

Removes offers from an existing group.
Emits a GroupUpdated event if successful.
Reverts if:
- The groups region of protocol is paused
- Caller is not the seller
- Offer ids param is an empty list
- Group does not exist
- Any offer is not part of the group

function removeOffersFromGroup(uint256 _groupId,
uint256[] _offerIds)
external

Arguments

NameTypeDescription
_groupIduint256the id of the group to be updated
_offerIdsuint256[]array of offer ids to be removed from the group

setGroupCondition

Sets the condition of an existing group.
Emits a GroupUpdated event if successful.
Reverts if:
- The groups region of protocol is paused
- Condition includes invalid combination of fields
- Seller does not match caller
- Group does not exist

function setGroupCondition(uint256 _groupId,
struct BosonTypes.Condition _condition)
external

Arguments

NameTypeDescription
_groupIduint256the id of the group whose condition will be set
_conditionBosonTypes.Conditionfully populated condition struct

getGroup

Gets the details about a given group.

function getGroup(uint256 _groupId) 
external
view
returns(bool exists,
BosonTypes.Group memory group,
BosonTypes.Condition memory condition)

Arguments

NameTypeDescription
_groupIduint256the id of the group to check

Returns

NameTypeDescription
existsboolthe group was found
groupBosonTypes.Groupthe group details. See {BosonTypes.Group}
conditionBosonTypes.Conditionthe group's condition details. See {BosonTypes.Condition}

getNextGroupId

Gets the next group id.Does not increment the counter.

function getNextGroupId() 
external
view
returns(uint256 nextGroupId)

Returns

NameTypeDescription
nextGroupIduint256the next group id