IDisputeKit
Functions
createDispute
Creates a local dispute and maps it to the dispute ID in the Core contract. Note: Access restricted to Kleros Core only.
function createDispute(uint256 _coreDisputeID, uint256 _numberOfChoices, bytes calldata _extraData, uint256 _nbVotes)
external;
Parameters
Name | Type | Description |
---|---|---|
_coreDisputeID | uint256 | The ID of the dispute in Kleros Core, not in the Dispute Kit. |
_numberOfChoices | uint256 | Number of choices of the dispute |
_extraData | bytes | Additional info about the dispute, for possible use in future dispute kits. |
_nbVotes | uint256 |
draw
Draws the juror from the sortition tree. The drawn address is picked up by Kleros Core. Note: Access restricted to Kleros Core only.
function draw(uint256 _coreDisputeID) external returns (address drawnAddress);
Parameters
Name | Type | Description |
---|---|---|
_coreDisputeID | uint256 | The ID of the dispute in Kleros Core, not in the Dispute Kit. |
Returns
Name | Type | Description |
---|---|---|
drawnAddress | address | The drawn address. |
currentRuling
Gets the current ruling of a specified dispute.
function currentRuling(uint256 _coreDisputeID) external view returns (uint256 ruling, bool tied, bool overridden);
Parameters
Name | Type | Description |
---|---|---|
_coreDisputeID | uint256 | The ID of the dispute in Kleros Core, not in the Dispute Kit. |
Returns
Name | Type | Description |
---|---|---|
ruling | uint256 | The current ruling. |
tied | bool | Whether it's a tie or not. |
overridden | bool | Whether the ruling was overridden by appeal funding or not. |
getDegreeOfCoherence
Gets the degree of coherence of a particular voter. This function is called by Kleros Core in order to determine the amount of the reward.
function getDegreeOfCoherence(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID)
external
view
returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_coreDisputeID | uint256 | The ID of the dispute in Kleros Core, not in the Dispute Kit. |
_coreRoundID | uint256 | The ID of the round in Kleros Core, not in the Dispute Kit. |
_voteID | uint256 | The ID of the vote. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The degree of coherence in basis points. |
getCoherentCount
Gets the number of jurors who are eligible to a reward in this round.
function getCoherentCount(uint256 _coreDisputeID, uint256 _coreRoundID) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_coreDisputeID | uint256 | The ID of the dispute in Kleros Core, not in the Dispute Kit. |
_coreRoundID | uint256 | The ID of the round in Kleros Core, not in the Dispute Kit. |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The number of coherent jurors. |
areCommitsAllCast
Returns true if all of the jurors have cast their commits for the last round.
function areCommitsAllCast(uint256 _coreDisputeID) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
_coreDisputeID | uint256 | The ID of the dispute in Kleros Core, not in the Dispute Kit. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Whether all of the jurors have cast their commits for the last round. |
areVotesAllCast
Returns true if all of the jurors have cast their votes for the last round.
function areVotesAllCast(uint256 _coreDisputeID) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
_coreDisputeID | uint256 | The ID of the dispute in Kleros Core, not in the Dispute Kit. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Whether all of the jurors have cast their votes for the last round. |
isVoteActive
Returns true if the specified voter was active in this round.
function isVoteActive(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID) external view returns (bool);
Parameters
Name | Type | Description |
---|---|---|
_coreDisputeID | uint256 | The ID of the dispute in Kleros Core, not in the Dispute Kit. |
_coreRoundID | uint256 | The ID of the round in Kleros Core, not in the Dispute Kit. |
_voteID | uint256 | The ID of the voter. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | Whether the voter was active or not. |
getRoundInfo
function getRoundInfo(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _choice)
external
view
returns (
uint256 winningChoice,
bool tied,
uint256 totalVoted,
uint256 totalCommited,
uint256 nbVoters,
uint256 choiceCount
);
getVoteInfo
function getVoteInfo(uint256 _coreDisputeID, uint256 _coreRoundID, uint256 _voteID)
external
view
returns (address account, bytes32 commit, uint256 choice, bool voted);
Events
Justification
Emitted when casting a vote to provide the justification of juror's choice.
event Justification(
uint256 indexed _coreDisputeID, address indexed _juror, uint256 indexed _choice, string _justification
);