Skip to main content

DisputeResolverHandlerFacet

View Source: contracts/protocol/facets/DisputeResolverHandlerFacet.sol

↗ Extends: IBosonAccountEvents, ProtocolBase

DisputeResolverHandlerFacet

Handles dispute resolver account management requests and queries

Functions

initialize

Initializes facet.

function initialize() 
public

createDisputeResolver

Creates a dispute resolver. Dispute resolver must be activated before it can participate in the protocol.
Emits a DisputeResolverCreated event if successful.
Reverts if:
- Caller is not the supplied admin, operator and clerk
- The dispute resolvers region of protocol is paused
- Any address is zero address
- Any address is not unique to this dispute resolver
- Number of DisputeResolverFee structs in array exceeds max
- DisputeResolverFee array contains duplicates
- EscalationResponsePeriod is invalid
- Number of seller ids in _sellerAllowList array exceeds max
- Some seller does not exist
- Some seller id is duplicated

function createDisputeResolver(struct BosonTypes.DisputeResolver _disputeResolver,
struct BosonTypes.DisputeResolverFee[] _disputeResolverFees,
uint256[] _sellerAllowList)
external
disputeResolversNotPaused nonReentrant

Arguments

NameTypeDescription
_disputeResolverBosonTypes.DisputeResolverthe fully populated struct with dispute resolver id set to 0x0
_disputeResolverFeesBosonTypes.DisputeResolverFee[]array of fees dispute resolver charges per token type. Zero address is native currency. Can be empty.
_sellerAllowListuint256[]list of ids of sellers that can choose this dispute resolver. If empty, there are no restrictions on which seller can chose it.

updateDisputeResolver

Updates a dispute resolver, not including DisputeResolverFees, allowed seller list or active flag.
All DisputeResolver fields should be filled, even those staying the same.
Use removeFeesFromDisputeResolver and addFeesToDisputeResolver to add and remove fees.
Use addSellersToAllowList and removeSellersFromAllowList to add and remove allowed sellers.Active flag passed in by caller will be ignored. The value from storage will be used.
Emits a DisputeResolverUpdated event if successful.
Reverts if:
- The dispute resolvers region of protocol is paused
- Caller is not the admin address associated with the dispute resolver account
- Any address is zero address
- Any address is not unique to this dispute resolver
- Dispute resolver does not exist

function updateDisputeResolver(struct BosonTypes.DisputeResolver _disputeResolver) 
external
disputeResolversNotPaused nonReentrant

Arguments

NameTypeDescription
_disputeResolverBosonTypes.DisputeResolverthe fully populated dispute resolver struct

addFeesToDisputeResolver

Adds DisputeResolverFees to an existing dispute resolver.
Emits a DisputeResolverFeesAdded event if successful.
Reverts if:
- The dispute resolvers region of protocol is paused
- Caller is not the admin address associated with the dispute resolver account
- Dispute resolver does not exist
- Number of DisputeResolverFee structs in array exceeds max
- Number of DisputeResolverFee structs in array is zero
- DisputeResolverFee array contains duplicates

function addFeesToDisputeResolver(uint256 _disputeResolverId,
struct BosonTypes.DisputeResolverFee[] _disputeResolverFees)
external
disputeResolversNotPaused nonReentrant

Arguments

NameTypeDescription
_disputeResolverIduint256id of the dispute resolver
_disputeResolverFeesBosonTypes.DisputeResolverFee[]list of fees dispute resolver charges per token type. Zero address is native currency. See {BosonTypes.DisputeResolverFee}

removeFeesFromDisputeResolver

Removes DisputeResolverFees from an existing dispute resolver.
Emits a DisputeResolverFeesRemoved event if successful.
Reverts if:
- The dispute resolvers region of protocol is paused
- Caller is not the admin address associated with the dispute resolver account
- Dispute resolver does not exist
- Number of DisputeResolverFee structs in array exceeds max
- Number of DisputeResolverFee structs in array is zero
- DisputeResolverFee does not exist for the dispute resolver

function removeFeesFromDisputeResolver(uint256 _disputeResolverId,
address[] _feeTokenAddresses)
external
disputeResolversNotPaused nonReentrant

Arguments

NameTypeDescription
_disputeResolverIduint256id of the dispute resolver
_feeTokenAddressesaddress[]list of addresses of dispute resolver fee tokens to remove

addSellersToAllowList

Adds seller ids to set of ids allowed to choose the given dispute resolver for an offer.
Emits an AllowedSellersAdded event if successful.
Reverts if:
- The dispute resolvers region of protocol is paused
- Caller is not the admin address associated with the dispute resolver account
- Dispute resolver does not exist
- Number of seller ids in array exceeds max
- Number of seller ids in array is zero
- Some seller does not exist
- Seller id is already approved

function addSellersToAllowList(uint256 _disputeResolverId,
uint256[] _sellerAllowList)
external
disputeResolversNotPaused nonReentrant

Arguments

NameTypeDescription
_disputeResolverIduint256id of the dispute resolver
_sellerAllowListuint256[]list of seller ids to add to allowed list

removeSellersFromAllowList

Removes seller ids from set of ids allowed to choose the given dispute resolver for an offer.
Emits an AllowedSellersRemoved event if successful.
Reverts if:
- The dispute resolvers region of protocol is paused
- Caller is not the admin address associated with the dispute resolver account
- Dispute resolver does not exist
- Number of seller ids in array exceeds max
- Number of seller ids structs in array is zero
- Seller id is not approved

function removeSellersFromAllowList(uint256 _disputeResolverId,
uint256[] _sellerAllowList)
external
disputeResolversNotPaused nonReentrant

Arguments

NameTypeDescription
_disputeResolverIduint256id of the dispute resolver
_sellerAllowListuint256[]list of seller ids to remove from allowed list

activateDisputeResolver

Sets the active flag for this dispute resolver to true.Only callable by the protocol ADMIN role.
Emits a DisputeResolverActivated event if successful.
Reverts if:
- The dispute resolvers region of protocol is paused
- Caller does not have the ADMIN role
- Dispute resolver does not exist

function activateDisputeResolver(uint256 _disputeResolverId) 
external
disputeResolversNotPaused onlyRole nonReentrant

Arguments

NameTypeDescription
_disputeResolverIduint256id of the dispute resolver

getDisputeResolver

Gets the details about a dispute resolver.

function getDisputeResolver(uint256 _disputeResolverId) 
public
view
returns(bool exists,
DisputeResolver memory disputeResolver,
BosonTypes.DisputeResolverFee[] memory disputeResolverFees,
uint256[] sellerAllowList)

Arguments

NameTypeDescription
_disputeResolverIduint256the id of the dispute resolver to check

Returns

NameTypeDescription
existsboolthe dispute resolver was found
disputeResolverBosonTypes.DisputeResolverthe dispute resolver details. See {BosonTypes.DisputeResolver}
disputeResolverFeesBosonTypes.DisputeResolverFee[]list of fees dispute resolver charges per token type. Zero address is native currency. See {BosonTypes.DisputeResolverFee[]}
sellerAllowListuint256[]list of sellers that are allowed to choose this dispute resolver

getDisputeResolverByAddress

Gets the details about a dispute resolver by an address associated with that dispute resolver: operator, admin, or clerk address.

function getDisputeResolverByAddress(address _associatedAddress) 
external
view
returns(bool exists,
DisputeResolver memory disputeResolver,
BosonTypes.DisputeResolverFee[] memory disputeResolverFees,
uint256[] sellerAllowList)

Arguments

NameTypeDescription
_associatedAddressaddressthe address associated with the dispute resolver. Must be an operator, admin, or clerk address.

Returns

NameTypeDescription
existsboolthe dispute resolver was found
disputeResolverBosonTypes.DisputeResolverthe dispute resolver details. See {BosonTypes.DisputeResolver}
disputeResolverFeesBosonTypes.DisputeResolverFee[]list of fees dispute resolver charges per token type. Zero address is native currency. See {BosonTypes.DisputeResolverFee[]}
sellerAllowListuint256[]list of sellers that are allowed to chose this dispute resolver

areSellersAllowed

Checks whether given sellers are allowed to choose the given dispute resolver.

function areSellersAllowed(uint256 _disputeResolverId,
uint256[] _sellerIds)
external
view
returns(bool[] sellerAllowed)

Arguments

NameTypeDescription
_disputeResolverIduint256id of dispute resolver to check
_sellerIdsuint256[]list of seller ids to check

Returns

NameTypeDescription
sellerAllowedbool[]array with indicator (true/false) if seller is allowed to choose the dispute resolver. Index in this array corresponds to indices of the incoming _sellerIds

storeDisputeResolver

Stores DisputeResolver struct in storage.
Reverts if:
- Escalation period is greater than the max escalation period

function storeDisputeResolver(struct BosonTypes.DisputeResolver _disputeResolver) 
internal

Arguments

NameTypeDescription
_disputeResolverBosonTypes.DisputeResolverthe fully populated struct with dispute resolver id set

storeSellerAllowList

Stores seller id to allowed list mapping in storage.
Reverts if:
- Some seller does not exist
- Some seller id is already approved

function storeSellerAllowList(uint256 _disputeResolverId,
uint256[] _sellerAllowList)
internal

Arguments

NameTypeDescription
_disputeResolverIduint256id of dispute resolver that is giving the permission
_sellerAllowListuint256[]list of seller ids added to allow list