Skip to main content

IBosonOrchestrationHandler

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

↗ Extends: IBosonAccountEvents, IBosonGroupEvents, IBosonOfferEvents, IBosonTwinEvents, IBosonBundleEvents ↘ Derived Contracts: OrchestrationHandlerFacet

IBosonOrchestrationHandler

Combines creation of multiple entities (accounts, offers, groups, twins, bundles) in a single transaction
The ERC-165 identifier for this interface is: 0xb698ded2

Functions

createSellerAndOffer

Creates a seller (with optional auth token) and an offer in a single transaction.
Limitation of the method:
If chosen dispute resolver has seller allow list, this method will not succeed, since seller that will be created
cannot be on that list. To avoid the failure you can
- Choose a dispute resolver without seller allow list
- Make an absolute zero offer without and dispute resolver specified
- First create a seller {AccountHandler.createSeller}, make sure that dispute resolver adds seller to its allow list
and then continue with the offer creation
Emits a SellerCreated and an OfferCreated event if successful.
Reverts if:
- The sellers region of protocol is paused
- The offers region of protocol is paused
- The orchestration region of protocol is paused
- Caller is not the supplied admin or does not own supplied auth token
- Caller is not the supplied operator and clerk
- Admin address is zero address and AuthTokenType == None
- AuthTokenType is not unique to this seller
- In seller struct:
- Address values are zero address
- Addresses are not unique to this seller
- Seller is not active (if active == false)
- In offer struct:
- Valid from date is greater than valid until date
- Valid until date is not in the future
- Both voucher expiration date and voucher expiration period are defined
- Neither voucher expiration date nor voucher expiration period are defined
- Voucher redeemable period is fixed, but it ends before it starts
- Voucher redeemable period is fixed, but it ends before offer expires
- Dispute period is less than minimum dispute period
- Resolution period is set to zero or above the maximum resolution period
- Voided is set to true
- Available quantity is set to zero
- Dispute resolver wallet is not registered, except for absolute zero offers with unspecified dispute resolver
- Dispute resolver is not active, except for absolute zero offers with unspecified dispute resolver
- Seller is not on dispute resolver's seller allow list
- Dispute resolver does not accept fees in the exchange token
- Buyer cancel penalty is greater than price
- When agent id is non zero:
- If Agent does not exist
- If the sum of agent fee amount and protocol fee amount is greater than the offer fee limit

function createSellerAndOffer(struct BosonTypes.Seller _seller,
struct BosonTypes.Offer _offer,
struct BosonTypes.OfferDates _offerDates,
struct BosonTypes.OfferDurations _offerDurations,
uint256 _disputeResolverId,
struct BosonTypes.AuthToken _authToken,
struct BosonTypes.VoucherInitValues _voucherInitValues,
uint256 _agentId)
external

Arguments

NameTypeDescription
_sellerBosonTypes.Sellerthe fully populated seller struct
_offerBosonTypes.Offerthe fully populated struct with offer id set to 0x0 and voided set to false
_offerDatesBosonTypes.OfferDatesthe fully populated offer dates struct
_offerDurationsBosonTypes.OfferDurationsthe fully populated offer durations struct
_disputeResolverIduint256the id of chosen dispute resolver (can be 0)
_authTokenBosonTypes.AuthTokenoptional AuthToken struct that specifies an AuthToken type and tokenId that the seller can use to do admin functions
_voucherInitValuesBosonTypes.VoucherInitValuesthe fully populated BosonTypes.VoucherInitValues struct
_agentIduint256the id of agent

createOfferWithCondition

Takes an offer and a condition, creates an offer, then creates a group with that offer and the given condition.
Emits an OfferCreated and a GroupCreated event if successful.
Reverts if:
- The offers region of protocol is paused
- The groups region of protocol is paused
- The orchestration region of protocol is paused
- In offer struct:
- Caller is not an operator
- Valid from date is greater than valid until date
- Valid until date is not in the future
- Both voucher expiration date and voucher expiration period are defined
- Neither voucher expiration date nor voucher expiration period are defined
- Voucher redeemable period is fixed, but it ends before it starts
- Voucher redeemable period is fixed, but it ends before offer expires
- Dispute period is less than minimum dispute period
- Resolution period is set to zero or above the maximum resolution period
- Voided is set to true
- Available quantity is set to zero
- Dispute resolver wallet is not registered, except for absolute zero offers with unspecified dispute resolver
- Dispute resolver is not active, except for absolute zero offers with unspecified dispute resolver
- Seller is not on dispute resolver's seller allow list
- Dispute resolver does not accept fees in the exchange token
- Buyer cancel penalty is greater than price
- Condition includes invalid combination of parameters
- When agent id is non zero:
- If Agent does not exist
- If the sum of agent fee amount and protocol fee amount is greater than the offer fee limit

function createOfferWithCondition(struct BosonTypes.Offer _offer,
struct BosonTypes.OfferDates _offerDates,
struct BosonTypes.OfferDurations _offerDurations,
uint256 _disputeResolverId,
struct BosonTypes.Condition _condition,
uint256 _agentId)
external

Arguments

NameTypeDescription
_offerBosonTypes.Offerthe fully populated struct with offer id set to 0x0 and voided set to false
_offerDatesBosonTypes.OfferDatesthe fully populated offer dates struct
_offerDurationsBosonTypes.OfferDurationsthe fully populated offer durations struct
_disputeResolverIduint256the id of chosen dispute resolver (can be 0)
_conditionBosonTypes.Conditionthe fully populated condition struct
_agentIduint256the id of agent

createOfferAddToGroup

Takes an offer and group ID, creates an offer and adds it to the existing group with given id.
Emits an OfferCreated and a GroupUpdated event if successful.
Reverts if:
- The offers region of protocol is paused
- The groups region of protocol is paused
- The orchestration region of protocol is paused
- In offer struct:
- Caller is not an operator
- Valid from date is greater than valid until date
- Valid until date is not in the future
- Both voucher expiration date and voucher expiration period are defined
- Neither voucher expiration date nor voucher expiration period are defined
- Voucher redeemable period is fixed, but it ends before it starts
- Voucher redeemable period is fixed, but it ends before offer expires
- Dispute period is less than minimum dispute period
- Resolution period is set to zero or above the maximum resolution period
- Voided is set to true
- Available quantity is set to zero
- Dispute resolver wallet is not registered, except for absolute zero offers with unspecified dispute resolver
- Dispute resolver is not active, except for absolute zero offers with unspecified dispute resolver
- Seller is not on dispute resolver's seller allow list
- Dispute resolver does not accept fees in the exchange token
- Buyer cancel penalty is greater than price
- When adding to the group if:
- Group does not exists
- Caller is not the operator of the group
- Current number of offers plus number of offers added exceeds maximum allowed number per group
- When agent id is non zero:
- If Agent does not exist
- If the sum of agent fee amount and protocol fee amount is greater than the offer fee limit

function createOfferAddToGroup(struct BosonTypes.Offer _offer,
struct BosonTypes.OfferDates _offerDates,
struct BosonTypes.OfferDurations _offerDurations,
uint256 _disputeResolverId,
uint256 _groupId,
uint256 _agentId)
external

Arguments

NameTypeDescription
_offerBosonTypes.Offerthe fully populated struct with offer id set to 0x0 and voided set to false
_offerDatesBosonTypes.OfferDatesthe fully populated offer dates struct
_offerDurationsBosonTypes.OfferDurationsthe fully populated offer durations struct
_disputeResolverIduint256the id of chosen dispute resolver (can be 0)
_groupIduint256id of the group, to which offer will be added
_agentIduint256the id of agent

createOfferAndTwinWithBundle

Takes an offer and a twin, creates an offer, creates a twin, then creates a bundle with that offer and the given twin.
Emits an OfferCreated, a TwinCreated and a BundleCreated event if successful.
Reverts if:
- The offers region of protocol is paused
- The twins region of protocol is paused
- The bundles region of protocol is paused
- The orchestration region of protocol is paused
- In offer struct:
- Caller is not an operator
- Valid from date is greater than valid until date
- Valid until date is not in the future
- Both voucher expiration date and voucher expiration period are defined
- Neither voucher expiration date nor voucher expiration period are defined
- Voucher redeemable period is fixed, but it ends before it starts
- Voucher redeemable period is fixed, but it ends before offer expires
- Dispute period is less than minimum dispute period
- Resolution period is set to zero or above the maximum resolution period
- Voided is set to true
- Available quantity is set to zero
- Dispute resolver wallet is not registered, except for absolute zero offers with unspecified dispute resolver
- Dispute resolver is not active, except for absolute zero offers with unspecified dispute resolver
- Seller is not on dispute resolver's seller allow list
- Dispute resolver does not accept fees in the exchange token
- Buyer cancel penalty is greater than price
- When creating twin if
- Not approved to transfer the seller's token
- SupplyAvailable is zero
- Twin is NonFungibleToken and amount was set
- Twin is NonFungibleToken and end of range would overflow
- Twin is NonFungibleToken with unlimited supply and starting token id is too high
- Twin is NonFungibleToken and range is already being used in another twin of the seller
- Twin is FungibleToken or MultiToken and amount was not set
- When agent id is non zero:
- If Agent does not exist
- If the sum of agent fee amount and protocol fee amount is greater than the offer fee limit

function createOfferAndTwinWithBundle(struct BosonTypes.Offer _offer,
struct BosonTypes.OfferDates _offerDates,
struct BosonTypes.OfferDurations _offerDurations,
uint256 _disputeResolverId,
struct BosonTypes.Twin _twin,
uint256 _agentId)
external

Arguments

NameTypeDescription
_offerBosonTypes.Offerthe fully populated struct with offer id set to 0x0 and voided set to false
_offerDatesBosonTypes.OfferDatesthe fully populated offer dates struct
_offerDurationsBosonTypes.OfferDurationsthe fully populated offer durations struct
_disputeResolverIduint256the id of chosen dispute resolver (can be 0)
_twinBosonTypes.Twinthe fully populated twin struct
_agentIduint256the id of agent

createOfferWithConditionAndTwinAndBundle

Takes an offer, a condition and a twin, creates an offer, then creates a group with that offer and the given condition.
It then creates a twin, then creates a bundle with that offer and the given twin.
Emits an OfferCreated, a GroupCreated, a TwinCreated and a BundleCreated event if successful.
Reverts if:
- The offers region of protocol is paused
- The groups region of protocol is paused
- The twins region of protocol is paused
- The bundles region of protocol is paused
- The orchestration region of protocol is paused
- In offer struct:
- Caller is not an operator
- Valid from date is greater than valid until date
- Valid until date is not in the future
- Both voucher expiration date and voucher expiration period are defined
- Neither voucher expiration date nor voucher expiration period are defined
- Voucher redeemable period is fixed, but it ends before it starts
- Voucher redeemable period is fixed, but it ends before offer expires
- Dispute period is less than minimum dispute period
- Resolution period is set to zero or above the maximum resolution period
- Voided is set to true
- Available quantity is set to zero
- Dispute resolver wallet is not registered, except for absolute zero offers with unspecified dispute resolver
- Dispute resolver is not active, except for absolute zero offers with unspecified dispute resolver
- Seller is not on dispute resolver's seller allow list
- Dispute resolver does not accept fees in the exchange token
- Buyer cancel penalty is greater than price
- Condition includes invalid combination of parameters
- When creating twin if
- Not approved to transfer the seller's token
- SupplyAvailable is zero
- Twin is NonFungibleToken and amount was set
- Twin is NonFungibleToken and end of range would overflow
- Twin is NonFungibleToken with unlimited supply and starting token id is too high
- Twin is NonFungibleToken and range is already being used in another twin of the seller
- Twin is FungibleToken or MultiToken and amount was not set
- When agent id is non zero:
- If Agent does not exist
- If the sum of agent fee amount and protocol fee amount is greater than the offer fee limit

function createOfferWithConditionAndTwinAndBundle(struct BosonTypes.Offer _offer,
struct BosonTypes.OfferDates _offerDates,
struct BosonTypes.OfferDurations _offerDurations,
uint256 _disputeResolverId,
struct BosonTypes.Condition _condition,
struct BosonTypes.Twin _twin,
uint256 _agentId)
external

Arguments

NameTypeDescription
_offerBosonTypes.Offerthe fully populated struct with offer id set to 0x0 and voided set to false
_offerDatesBosonTypes.OfferDatesthe fully populated offer dates struct
_offerDurationsBosonTypes.OfferDurationsthe fully populated offer durations struct
_disputeResolverIduint256the id of chosen dispute resolver (can be 0)
_conditionBosonTypes.Conditionthe fully populated condition struct
_twinBosonTypes.Twinthe fully populated twin struct
_agentIduint256the id of agent

createSellerAndOfferWithCondition

Takes a seller, an offer, a condition and an optional auth token. Creates a seller, creates an offer,
then creates a group with that offer and the given condition.
Limitation of the method:
If chosen dispute resolver has seller allow list, this method will not succeed, since seller that will be created
cannot be on that list. To avoid the failure you can
- Choose a dispute resolver without seller allow list
- Make an absolute zero offer without and dispute resolver specified
- First create a seller {AccountHandler.createSeller}, make sure that dispute resolver adds seller to its allow list
and then continue with the offer creation
Emits a SellerCreated, an OfferCreated and a GroupCreated event if successful.
Reverts if:
- The sellers region of protocol is paused
- The offers region of protocol is paused
- The groups region of protocol is paused
- The orchestration region of protocol is paused
- Caller is not the supplied admin or does not own supplied auth token
- Caller is not the supplied operator and clerk
- Admin address is zero address and AuthTokenType == None
- AuthTokenType is not unique to this seller
- In seller struct:
- Address values are zero address
- Addresses are not unique to this seller
- Seller is not active (if active == false)
- In offer struct:
- Caller is not an operator
- Valid from date is greater than valid until date
- Valid until date is not in the future
- Both voucher expiration date and voucher expiration period are defined
- Neither voucher expiration date nor voucher expiration period are defined
- Voucher redeemable period is fixed, but it ends before it starts
- Voucher redeemable period is fixed, but it ends before offer expires
- Dispute period is less than minimum dispute period
- Resolution period is set to zero or above the maximum resolution period
- Voided is set to true
- Available quantity is set to zero
- Dispute resolver wallet is not registered, except for absolute zero offers with unspecified dispute resolver
- Dispute resolver is not active, except for absolute zero offers with unspecified dispute resolver
- Seller is not on dispute resolver's seller allow list
- Dispute resolver does not accept fees in the exchange token
- Buyer cancel penalty is greater than price
- Condition includes invalid combination of parameters
- When agent id is non zero:
- If Agent does not exist
- If the sum of agent fee amount and protocol fee amount is greater than the offer fee limit

function createSellerAndOfferWithCondition(struct BosonTypes.Seller _seller,
struct BosonTypes.Offer _offer,
struct BosonTypes.OfferDates _offerDates,
struct BosonTypes.OfferDurations _offerDurations,
uint256 _disputeResolverId,
struct BosonTypes.Condition _condition,
struct BosonTypes.AuthToken _authToken,
struct BosonTypes.VoucherInitValues _voucherInitValues,
uint256 _agentId)
external

Arguments

NameTypeDescription
_sellerBosonTypes.Sellerthe fully populated seller struct
_offerBosonTypes.Offerthe fully populated struct with offer id set to 0x0 and voided set to false
_offerDatesBosonTypes.OfferDatesthe fully populated offer dates struct
_offerDurationsBosonTypes.OfferDurationsthe fully populated offer durations struct
_disputeResolverIduint256the id of chosen dispute resolver (can be 0)
_conditionBosonTypes.Conditionthe fully populated condition struct
_authTokenBosonTypes.AuthTokenoptional AuthToken struct that specifies an AuthToken type and tokenId that the seller can use to do admin functions
_voucherInitValuesBosonTypes.VoucherInitValuesthe fully populated BosonTypes.VoucherInitValues struct
_agentIduint256the id of agent

createSellerAndOfferAndTwinWithBundle

Takes a seller, an offer, a twin, and an optional auth token. Creates a seller, creates an offer, creates a twin,
then creates a bundle with that offer and the given twin.
Limitation of the method:
If chosen dispute resolver has seller allow list, this method will not succeed, since seller that will be created
cannot be on that list. To avoid the failure you can
- Choose a dispute resolver without seller allow list
- Make an absolute zero offer without and dispute resolver specified
- First create a seller {AccountHandler.createSeller}, make sure that dispute resolver adds seller to its allow list
and then continue with the offer creation
Emits a SellerCreated, an OfferCreated, a TwinCreated and a BundleCreated event if successful.
Reverts if:
- The sellers region of protocol is paused
- The offers region of protocol is paused
- The twins region of protocol is paused
- The bundles region of protocol is paused
- The orchestration region of protocol is paused
- Caller is not the supplied admin or does not own supplied auth token
- Caller is not the supplied operator and clerk
- Admin address is zero address and AuthTokenType == None
- AuthTokenType is not unique to this seller
- In seller struct:
- Address values are zero address
- Addresses are not unique to this seller
- Seller is not active (if active == false)
- In offer struct:
- Caller is not an operator
- Valid from date is greater than valid until date
- Valid until date is not in the future
- Both voucher expiration date and voucher expiration period are defined
- Neither voucher expiration date nor voucher expiration period are defined
- Voucher redeemable period is fixed, but it ends before it starts
- Voucher redeemable period is fixed, but it ends before offer expires
- Dispute period is less than minimum dispute period
- Resolution period is set to zero or above the maximum resolution period
- Voided is set to true
- Available quantity is set to zero
- Dispute resolver wallet is not registered, except for absolute zero offers with unspecified dispute resolver
- Dispute resolver is not active, except for absolute zero offers with unspecified dispute resolver
- Seller is not on dispute resolver's seller allow list
- Dispute resolver does not accept fees in the exchange token
- Buyer cancel penalty is greater than price
- When creating twin if
- Not approved to transfer the seller's token
- SupplyAvailable is zero
- Twin is NonFungibleToken and amount was set
- Twin is NonFungibleToken and end of range would overflow
- Twin is NonFungibleToken with unlimited supply and starting token id is too high
- Twin is NonFungibleToken and range is already being used in another twin of the seller
- Twin is FungibleToken or MultiToken and amount was not set
- When agent id is non zero:
- If Agent does not exist
- If the sum of agent fee amount and protocol fee amount is greater than the offer fee limit

function createSellerAndOfferAndTwinWithBundle(struct BosonTypes.Seller _seller,
struct BosonTypes.Offer _offer,
struct BosonTypes.OfferDates _offerDates,
struct BosonTypes.OfferDurations _offerDurations,
uint256 _disputeResolverId,
struct BosonTypes.Twin _twin,
struct BosonTypes.AuthToken _authToken,
struct BosonTypes.VoucherInitValues _voucherInitValues,
uint256 _agentId)
external

Arguments

NameTypeDescription
_sellerBosonTypes.Sellerthe fully populated seller struct
_offerBosonTypes.Offerthe fully populated struct with offer id set to 0x0 and voided set to false
_offerDatesBosonTypes.OfferDatesthe fully populated offer dates struct
_offerDurationsBosonTypes.OfferDurationsthe fully populated offer durations struct
_disputeResolverIduint256the id of chosen dispute resolver (can be 0)
_twinBosonTypes.Twinthe fully populated twin struct
_authTokenBosonTypes.AuthTokenoptional AuthToken struct that specifies an AuthToken type and tokenId that the seller can use to do admin functions
_voucherInitValuesBosonTypes.VoucherInitValuesthe fully populated BosonTypes.VoucherInitValues struct
_agentIduint256the id of agent

createSellerAndOfferWithConditionAndTwinAndBundle

Takes a seller, an offer, a condition and a twin, and an optional auth token. Creates a seller an offer,
then creates a group with that offer and the given condition. It then creates a twin and a bundle with that offer and the given twin.
Limitation of the method:
If chosen dispute resolver has seller allow list, this method will not succeed, since seller that will be created
cannot be on that list. To avoid the failure you can
- Choose a dispute resolver without seller allow list
- Make an absolute zero offer without and dispute resolver specified
- First create a seller {AccountHandler.createSeller}, make sure that dispute resolver adds seller to its allow list
and then continue with the offer creation
Emits an SellerCreated, OfferCreated, a GroupCreated, a TwinCreated and a BundleCreated event if successful.
Reverts if:
- The sellers region of protocol is paused
- The offers region of protocol is paused
- The groups region of protocol is paused
- The twins region of protocol is paused
- The bundles region of protocol is paused
- The orchestration region of protocol is paused
- Caller is not the supplied admin or does not own supplied auth token
- Caller is not the supplied operator and clerk
- Admin address is zero address and AuthTokenType == None
- AuthTokenType is not unique to this seller
- In seller struct:
- Address values are zero address
- Addresses are not unique to this seller
- Seller is not active (if active == false)
- In offer struct:
- Caller is not an operator
- Valid from date is greater than valid until date
- Valid until date is not in the future
- Both voucher expiration date and voucher expiration period are defined
- Neither voucher expiration date nor voucher expiration period are defined
- Voucher redeemable period is fixed, but it ends before it starts
- Voucher redeemable period is fixed, but it ends before offer expires
- Dispute period is less than minimum dispute period
- Resolution period is set to zero or above the maximum resolution period
- Voided is set to true
- Available quantity is set to zero
- Dispute resolver wallet is not registered, except for absolute zero offers with unspecified dispute resolver
- Dispute resolver is not active, except for absolute zero offers with unspecified dispute resolver
- Seller is not on dispute resolver's seller allow list
- Dispute resolver does not accept fees in the exchange token
- Buyer cancel penalty is greater than price
- Condition includes invalid combination of parameters
- When creating twin if
- Not approved to transfer the seller's token
- SupplyAvailable is zero
- Twin is NonFungibleToken and amount was set
- Twin is NonFungibleToken and end of range would overflow
- Twin is NonFungibleToken with unlimited supply and starting token id is too high
- Twin is NonFungibleToken and range is already being used in another twin of the seller
- Twin is FungibleToken or MultiToken and amount was not set
- When agent id is non zero:
- If Agent does not exist
- If the sum of agent fee amount and protocol fee amount is greater than the offer fee limit

function createSellerAndOfferWithConditionAndTwinAndBundle(struct BosonTypes.Seller _seller,
struct BosonTypes.Offer _offer,
struct BosonTypes.OfferDates _offerDates,
struct BosonTypes.OfferDurations _offerDurations,
uint256 _disputeResolverId,
struct BosonTypes.Condition _condition,
struct BosonTypes.Twin _twin,
struct BosonTypes.AuthToken _authToken,
struct BosonTypes.VoucherInitValues _voucherInitValues,
uint256 _agentId)
external

Arguments

NameTypeDescription
_sellerBosonTypes.Sellerthe fully populated seller struct
_offerBosonTypes.Offerthe fully populated struct with offer id set to 0x0 and voided set to false
_offerDatesBosonTypes.OfferDatesthe fully populated offer dates struct
_offerDurationsBosonTypes.OfferDurationsthe fully populated offer durations struct
_disputeResolverIduint256the id of chosen dispute resolver (can be 0)
_conditionBosonTypes.Conditionthe fully populated condition struct
_twinBosonTypes.Twinthe fully populated twin struct
_authTokenBosonTypes.AuthTokenoptional AuthToken struct that specifies an AuthToken type and tokenId that the seller can use to do admin functions
_voucherInitValuesBosonTypes.VoucherInitValuesthe fully populated BosonTypes.VoucherInitValues struct
_agentIduint256the id of agent