ArbitrableExample
Inherits: IArbitrableV2
State Variables
governor
address public immutable governor;
arbitrator
IArbitratorV2 public arbitrator;
templateRegistry
IDisputeTemplateRegistry public templateRegistry;
templateId
uint256 public templateId;
arbitratorExtraData
bytes public arbitratorExtraData;
weth
IERC20 public immutable weth;
externalIDtoLocalID
mapping(uint256 => uint256) public externalIDtoLocalID;
disputes
DisputeStruct[] public disputes;
Functions
onlyByGovernor
modifier onlyByGovernor();
constructor
Constructor
constructor(
    IArbitratorV2 _arbitrator,
    string memory _templateData,
    string memory _templateDataMappings,
    bytes memory _arbitratorExtraData,
    IDisputeTemplateRegistry _templateRegistry,
    IERC20 _weth
);
Parameters
| Name | Type | Description | 
|---|---|---|
_arbitrator | IArbitratorV2 | The arbitrator to rule on created disputes. | 
_templateData | string | The dispute template data. | 
_templateDataMappings | string | The dispute template data mappings. | 
_arbitratorExtraData | bytes | The extra data for the arbitrator. | 
_templateRegistry | IDisputeTemplateRegistry | The dispute template registry. | 
_weth | IERC20 | The WETH token. | 
changeArbitrator
function changeArbitrator(IArbitratorV2 _arbitrator) external onlyByGovernor;
changeArbitratorExtraData
function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external onlyByGovernor;
changeTemplateRegistry
function changeTemplateRegistry(IDisputeTemplateRegistry _templateRegistry) external onlyByGovernor;
changeDisputeTemplate
function changeDisputeTemplate(string memory _templateData, string memory _templateDataMappings)
    external
    onlyByGovernor;
createDispute
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 createDispute(string calldata _action) external payable returns (uint256 disputeID);
Parameters
| Name | Type | Description | 
|---|---|---|
_action | string | The action that requires arbitration. | 
Returns
| Name | Type | Description | 
|---|---|---|
disputeID | uint256 | Dispute id (on arbitrator side) of the dispute created. | 
createDispute
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 createDispute(string calldata _action, uint256 _feeInWeth) external returns (uint256 disputeID);
Parameters
| Name | Type | Description | 
|---|---|---|
_action | string | The action that requires arbitration. | 
_feeInWeth | uint256 | Amount of fees in WETH for the arbitrator. | 
Returns
| Name | Type | Description | 
|---|---|---|
disputeID | uint256 | Dispute id (on arbitrator side) of the dispute created. | 
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. | 
Events
Action
event Action(string indexed _action);
Structs
DisputeStruct
struct DisputeStruct {
    bool isRuled;
    uint256 ruling;
    uint256 numberOfRulingOptions;
}