Skip to main content

IBosonDisputeHandler

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

↗ Extends: IBosonDisputeEvents, IBosonFundsLibEvents

IBosonDisputeHandler

Handles disputes associated with exchanges within the protocol.
The ERC-165 identifier for this interface is: 0xd9ea8317

Functions

raiseDispute

Raises a dispute.
Reverts if:
- The disputes region of protocol is paused
- Caller does not hold a voucher for the given exchange id
- Exchange does not exist
- Exchange is not in a Redeemed state
- Dispute period has elapsed already

function raiseDispute(uint256 _exchangeId) 
external

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange

retractDispute

Retracts the dispute and release the funds.
Emits a DisputeRetracted event if successful.
Reverts if:
- The disputes region of protocol is paused
- Exchange does not exist
- Exchange is not in a Disputed state
- Caller is not the buyer for the given exchange id
- Dispute is in some state other than Resolving or Escalated
- Dispute was escalated and escalation period has elapsed

function retractDispute(uint256 _exchangeId) 
external

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange

extendDisputeTimeout

Extends the dispute timeout, allowing more time for mutual resolution.
As a consequence, buyer also gets more time to escalate the dispute.
Emits a DisputeTimeoutExtened event if successful.
Reverts if:
- The disputes region of protocol is paused
- Exchange does not exist
- Exchange is not in a Disputed state
- Caller is not the seller
- Dispute has expired already
- New dispute timeout is before the current dispute timeout
- Dispute is in some state other than Resolving

function extendDisputeTimeout(uint256 _exchangeId,
uint256 _newDisputeTimeout)
external

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange
_newDisputeTimeoutuint256new date when resolution period ends

expireDispute

Expires the dispute and releases the funds.
Emits a DisputeExpired event if successful.
Reverts if:
- The disputes region of protocol is paused
- Exchange does not exist
- Exchange is not in a Disputed state
- Dispute is still valid
- Dispute is in some state other than Resolving

function expireDispute(uint256 _exchangeId) 
external

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange

expireDisputeBatch

Expires a batch of disputes and releases the funds.
Emits a DisputeExpired event for every dispute if successful.
Reverts if:
- The disputes region of protocol is paused
- For any dispute:
- Exchange does not exist
- Exchange is not in a Disputed state
- Dispute is still valid
- Dispute is in some state other than Resolving

function expireDisputeBatch(uint256[] _exchangeIds) 
external

Arguments

NameTypeDescription
_exchangeIdsuint256[]the array of ids of the associated exchanges

resolveDispute

Resolves a dispute by providing the information about the funds split.
Callable by the buyer or seller, but the caller must provide the resolution signed by the other party.
Emits a DisputeResolved event if successful.
Reverts if:
- The disputes region of protocol is paused
- Specified buyer percent exceeds 100%
- Dispute has expired (resolution period has ended and dispute was not escalated)
- Exchange does not exist
- Exchange is not in the Disputed state
- Caller is neither the seller nor the buyer
- Signature does not belong to the address of the other party
- Dispute state is neither Resolving nor escalated
- Dispute was escalated and escalation period has elapsed

function resolveDispute(uint256 _exchangeId,
uint256 _buyerPercent,
bytes32 _sigR,
bytes32 _sigS,
uint8 _sigV)
external

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange
_buyerPercentuint256percentage of the pot that goes to the buyer
_sigRbytes32r part of the signer's signature
_sigSbytes32s part of the signer's signature
_sigVuint8v part of the signer's signature

escalateDispute

Puts the dispute into the Escalated state.
Caller must send (or for ERC20, approve the transfer of) the
buyer escalation deposit percentage of the offer price, which
will be added to the pot for resolution.
Emits a DisputeEscalated event if successful.
Reverts if:
- The disputes region of protocol is paused
- Exchange does not exist
- Exchange is not in a Disputed state
- Caller is not the buyer
- Dispute is already expired
- Dispute is not in a Resolving state
- Dispute resolver is not specified (absolute zero offer)
- Offer price is in native token and caller does not send enough
- Offer price is in some ERC20 token and caller also sends native currency
- If contract at token address does not support ERC20 function transferFrom
- If calling transferFrom on token fails for some reason (e.g. protocol is not approved to transfer)
- Received ERC20 token amount differs from the expected value

function escalateDispute(uint256 _exchangeId) 
external
payable

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange

decideDispute

Decides a dispute by providing the information about the funds split. Callable by the dispute resolver specified in the offer.
Emits a DisputeDecided event if successful.
Reverts if:
- The disputes region of protocol is paused
- Specified buyer percent exceeds 100%
- Exchange does not exist
- Exchange is not in the Disputed state
- Caller is not the dispute resolver for this dispute
- Dispute state is not Escalated
- Dispute escalation response period has elapsed

function decideDispute(uint256 _exchangeId,
uint256 _buyerPercent)
external

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange
_buyerPercentuint256percentage of the pot that goes to the buyer

refuseEscalatedDispute

Enables dispute resolver to explicitly refuse to resolve a dispute in Escalated state and releases the funds.
Emits an EscalatedDisputeRefused event if successful.
Reverts if:
- The disputes region of protocol is paused
- Exchange does not exist
- Exchange is not in a Disputed state
- Dispute is in some state other than Escalated
- Dispute escalation response period has elapsed
- Caller is not the dispute resolver for this dispute

function refuseEscalatedDispute(uint256 _exchangeId) 
external

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange

expireEscalatedDispute

Expires the dispute in escalated state and release the funds.
Emits an EscalatedDisputeExpired event if successful.
Reverts if:
- The disputes region of protocol is paused
- Exchange does not exist
- Exchange is not in a Disputed state
- Dispute is in some state other than Escalated
- Dispute escalation period has not passed yet

function expireEscalatedDispute(uint256 _exchangeId) 
external

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange

getDispute

Gets the details about a given dispute.

function getDispute(uint256 _exchangeId) 
external
view
returns(bool exists,
BosonTypes.Dispute memory dispute,
BosonTypes.DisputeDates memory disputeDates)

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange

Returns

NameTypeDescription
existsbooltrue if the dispute exists
disputeBosonTypes.Disputethe dispute details. See {BosonTypes.Dispute}
disputeDatesBosonTypes.DisputeDatesthe dispute dates details {BosonTypes.DisputeDates}

getDisputeState

Gets the state of a given dispute.

function getDisputeState(uint256 _exchangeId) 
external
view
returns(bool exists, enum BosonTypes.DisputeState state)

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange

Returns

BosonTypes.DisputeState

getDisputeTimeout

Gets the timeout of a given dispute.

function getDisputeTimeout(uint256 _exchangeId) 
external
view
returns(bool exists, uint256 timeout)

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange

Returns

NameTypeDescription
existsbooltrue if the dispute exists
timeoutuint256the end of resolution period

isDisputeFinalized

Checks if the given dispute is in a Finalized state.
Returns true if
- Dispute state is Retracted, Resolved, Decided or Refused

function isDisputeFinalized(uint256 _exchangeId) 
external
view
returns(bool exists, bool isFinalized)

Arguments

NameTypeDescription
_exchangeIduint256the id of the associated exchange

Returns

NameTypeDescription
existsbooltrue if the dispute exists
isFinalizedbooltrue if the dispute is finalized