DisputeResolver

Git Source

Inherits: IArbitrableV2

State Variables

governor

address public governor;

arbitrator

IArbitratorV2 public arbitrator;

disputes

DisputeStruct[] public disputes;

arbitratorDisputeIDToLocalID

mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID;

Functions

constructor

Constructor

constructor(IArbitratorV2 _arbitrator);

Parameters

NameTypeDescription
_arbitratorIArbitratorV2Target global arbitrator for any disputes.

changeGovernor

Changes the governor.

function changeGovernor(address _governor) external;

Parameters

NameTypeDescription
_governoraddressThe address of the new governor.

changeArbitrator

function changeArbitrator(IArbitratorV2 _arbitrator) external;

createDisputeForTemplate

Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.

function createDisputeForTemplate(
    bytes calldata _arbitratorExtraData,
    string calldata _disputeTemplate,
    uint256 _numberOfRulingOptions
) external payable returns (uint256 disputeID);

Parameters

NameTypeDescription
_arbitratorExtraDatabytesExtra data for the arbitrator of the dispute.
_disputeTemplatestringDispute template.
_numberOfRulingOptionsuint256Number of ruling options.

Returns

NameTypeDescription
disputeIDuint256Dispute id (on arbitrator side) of the created dispute.

createDisputeForTemplateUri

Calls createDispute function of the specified arbitrator to create a dispute. Note that we don’t need to check that msg.value is enough to pay arbitration fees as it’s the responsibility of the arbitrator contract.

function createDisputeForTemplateUri(
    bytes calldata _arbitratorExtraData,
    string calldata _disputeTemplateUri,
    uint256 _numberOfRulingOptions
) external payable returns (uint256 disputeID);

Parameters

NameTypeDescription
_arbitratorExtraDatabytesExtra data for the arbitrator of the dispute.
_disputeTemplateUristringThe URI to the dispute template. For example on IPFS: starting with '/ipfs/'.
_numberOfRulingOptionsuint256Number of ruling options.

Returns

NameTypeDescription
disputeIDuint256Dispute id (on arbitrator side) of the created dispute.

rule

To be called by the arbitrator of the dispute, to declare the winning ruling.

function rule(uint256 _externalDisputeID, uint256 _ruling) external override;

Parameters

NameTypeDescription
_externalDisputeIDuint256ID of the dispute in arbitrator contract.
_rulinguint256The ruling choice of the arbitration.

_createDispute

function _createDispute(
    bytes calldata _arbitratorExtraData,
    string memory _disputeTemplate,
    string memory _disputeTemplateUri,
    uint256 _numberOfRulingOptions
) internal returns (uint256 disputeID);

Structs

DisputeStruct

struct DisputeStruct {
    bytes arbitratorExtraData;
    bool isRuled;
    uint256 ruling;
    uint256 numberOfRulingOptions;
}