.. literalinclude:: ../contracts/IArbitrator.sol :language: javascript
There are three statuses that the function disputeStatus
can return; Waiting
, Appealable
and Solved
:
- A dispute is in
Waiting
state when it arises (gets created, bycreateDispute
function). - Is in
Appealable
state when it got a ruling and theArbitrator
allows to appeal it. When theArbitrator
allows to appeal, it often gives a time period to do so. If a dispute is not appealed within that time,disputeStatus
should returnSolved
. - Is in
Solved
state when it got a ruling and the ruling is final. Note that this doesn't implyrule
function on theArbitrable
has been called to enforce (execute) the ruling. It means that the decision on the dispute is final and to be executed.
There are three events to be emitted:
DisputeCreation
when a dispute gets created bycreateDispute
function.AppealPossible
when appealing a dispute becomes possible.AppealDecision
when current ruling is appealed.
And seven functions:
createDispute
should create a dispute with given number of possible_choices
for decisions._extraData
is for passing any extra information for any kind of custom handling. While callingcreateDispute
, caller has to pass required arbitration fee, otherwisecreateDispute
should revert.createDispute
should be called by anArbitrable
. Lastly, it should emitDisputeCreation
event.arbitrationCost
should return the arbitration cost that is required to create a dispute, in weis.appeal
should appeal a dispute and should require the caller to pass the required appeal fee.appeal
should be called by anArbitrable
and should emit theAppealDecision
event.appealCost
should return the appeal fee that is required to appeal, in weis.appealPeriod
should return the time window, in(start, end)
format, for appealing a ruling, if known in advance. If not known or appeal is impossible: should return(0, 0)
.disputeStatus
should return the status of dispute;Waiting
,Appealable
orSolved
.currentRuling
should return the current ruling of a dispute.