ArbitrableExample

Git Source

Inherits: IArbitrable, IMetaEvidence

State Variables

governor

address public immutable governor;

arbitrator

IArbitrator public arbitrator;

weth

ERC20 public immutable weth;

externalIDtoLocalID

mapping(uint256 => uint256) public externalIDtoLocalID;

disputes

DisputeStruct[] public disputes;

Functions

constructor

Constructor

constructor(IArbitrator _arbitrator, uint256 _metaEvidenceID, string memory _metaEvidence, ERC20 _weth);

Parameters

NameTypeDescription
_arbitratorIArbitratorThe arbitrator to rule on created disputes.
_metaEvidenceIDuint256Unique identifier of meta-evidence.
_metaEvidencestringThe URI of the meta evidence object for evidence submissions requests.
_wethERC20

createDispute

TRUSTED. 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(
    uint256 _numberOfRulingOptions,
    bytes calldata _arbitratorExtraData,
    uint256 _metaEvidenceID,
    uint256 _evidenceGroupID,
    uint256 _feeInWeth
) external payable returns (uint256 disputeID);

Parameters

NameTypeDescription
_numberOfRulingOptionsuint256Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from.
_arbitratorExtraDatabytesExtra data for the arbitrator.
_metaEvidenceIDuint256Unique identifier of meta-evidence.
_evidenceGroupIDuint256Unique identifier of the evidence group that is linked to this dispute.
_feeInWethuint256Amount of fees in WETH for the arbitrator.

Returns

NameTypeDescription
disputeIDuint256Dispute 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

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

changeMetaEvidence

function changeMetaEvidence(uint256 _metaEvidenceID, string memory _metaEvidence) external;

changeArbitrator

function changeArbitrator(IArbitrator _arbitrator) external;

Structs

DisputeStruct

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