ArbitrableExample
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
Name | Type | Description |
---|---|---|
_arbitrator | IArbitrator | The arbitrator to rule on created disputes. |
_metaEvidenceID | uint256 | Unique identifier of meta-evidence. |
_metaEvidence | string | The URI of the meta evidence object for evidence submissions requests. |
_weth | ERC20 |
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
Name | Type | Description |
---|---|---|
_numberOfRulingOptions | uint256 | Number of ruling options. Must be greater than 1, otherwise there is nothing to choose from. |
_arbitratorExtraData | bytes | Extra data for the arbitrator. |
_metaEvidenceID | uint256 | Unique identifier of meta-evidence. |
_evidenceGroupID | uint256 | Unique identifier of the evidence group that is linked to this dispute. |
_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. |
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;
}