ArbitrableExample
Inherits: IArbitrableV2
State Variables
governor
address public immutable governor;
arbitrator
IArbitratorV2 public arbitrator;
disputeTemplates
uint256 public disputeTemplates;
arbitratorExtraData
bytes public arbitratorExtraData;
weth
IERC20 public immutable weth;
externalIDtoLocalID
mapping(uint256 => uint256) public externalIDtoLocalID;
disputes
DisputeStruct[] public disputes;
Functions
constructor
Constructor
constructor(IArbitratorV2 _arbitrator, string memory _templateData, bytes memory _arbitratorExtraData, IERC20 _weth);
Parameters
Name | Type | Description |
---|---|---|
_arbitrator | IArbitratorV2 | The arbitrator to rule on created disputes. |
_templateData | string | The dispute template data. |
_arbitratorExtraData | bytes | |
_weth | IERC20 | The WETH token. |
changeDisputeTemplate
function changeDisputeTemplate(string memory _templateData) external;
changeArbitrator
function changeArbitrator(IArbitratorV2 _arbitrator) external;
changeArbitratorExtraData
function changeArbitratorExtraData(bytes calldata _arbitratorExtraData) external;
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 payable 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;
}