DisputeResolver
Inherits: IArbitrableV2
State Variables
governor
address public governor;
arbitrator
IArbitratorV2 public arbitrator;
templateRegistry
IDisputeTemplateRegistry public templateRegistry;
disputes
DisputeStruct[] public disputes;
arbitratorDisputeIDToLocalID
mapping(uint256 => uint256) public arbitratorDisputeIDToLocalID;
Functions
constructor
Constructor
constructor(IArbitratorV2 _arbitrator, IDisputeTemplateRegistry _templateRegistry);
Parameters
| Name | Type | Description | 
|---|---|---|
| _arbitrator | IArbitratorV2 | Target global arbitrator for any disputes. | 
| _templateRegistry | IDisputeTemplateRegistry | 
changeGovernor
Changes the governor.
function changeGovernor(address _governor) external;
Parameters
| Name | Type | Description | 
|---|---|---|
| _governor | address | The address of the new governor. | 
changeArbitrator
function changeArbitrator(IArbitratorV2 _arbitrator) external;
changeTemplateRegistry
function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) 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,
    string memory _disputeTemplateDataMappings,
    uint256 _numberOfRulingOptions
) external payable returns (uint256 disputeID);
Parameters
| Name | Type | Description | 
|---|---|---|
| _arbitratorExtraData | bytes | Extra data for the arbitrator of the dispute. | 
| _disputeTemplate | string | Dispute template. | 
| _disputeTemplateDataMappings | string | The data mappings. | 
| _numberOfRulingOptions | uint256 | Number of ruling options. | 
Returns
| Name | Type | Description | 
|---|---|---|
| disputeID | uint256 | Dispute 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
| Name | Type | Description | 
|---|---|---|
| _arbitratorExtraData | bytes | Extra data for the arbitrator of the dispute. | 
| _disputeTemplateUri | string | The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. | 
| _numberOfRulingOptions | uint256 | Number of ruling options. | 
Returns
| Name | Type | Description | 
|---|---|---|
| disputeID | uint256 | Dispute 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
| Name | Type | Description | 
|---|---|---|
| _externalDisputeID | uint256 | ID of the dispute in arbitrator contract. | 
| _ruling | uint256 | The ruling choice of the arbitration. | 
_createDispute
function _createDispute(
    bytes calldata _arbitratorExtraData,
    string memory _disputeTemplate,
    string memory _disputeTemplateDataMappings,
    string memory _disputeTemplateUri,
    uint256 _numberOfRulingOptions
) internal returns (uint256 disputeID);
Structs
DisputeStruct
struct DisputeStruct {
    bytes arbitratorExtraData;
    bool isRuled;
    uint256 ruling;
    uint256 numberOfRulingOptions;
}