IDisputeKit

Git Source

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

NameTypeDescription
_coreDisputeIDuint256The ID of the dispute in Kleros Core, not in the Dispute Kit.
_numberOfChoicesuint256Number of choices of the dispute
_extraDatabytesAdditional info about the dispute, for possible use in future dispute kits.
_nbVotesuint256

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

NameTypeDescription
_coreDisputeIDuint256The ID of the dispute in Kleros Core, not in the Dispute Kit.

Returns

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

NameTypeDescription
_coreDisputeIDuint256The ID of the dispute in Kleros Core, not in the Dispute Kit.

Returns

NameTypeDescription
rulinguint256The current ruling.
tiedboolWhether it's a tie or not.
overriddenboolWhether 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

NameTypeDescription
_coreDisputeIDuint256The ID of the dispute in Kleros Core, not in the Dispute Kit.
_coreRoundIDuint256The ID of the round in Kleros Core, not in the Dispute Kit.
_voteIDuint256The ID of the vote.

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
_coreDisputeIDuint256The ID of the dispute in Kleros Core, not in the Dispute Kit.
_coreRoundIDuint256The ID of the round in Kleros Core, not in the Dispute Kit.

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
_coreDisputeIDuint256The ID of the dispute in Kleros Core, not in the Dispute Kit.

Returns

NameTypeDescription
<none>boolWhether 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

NameTypeDescription
_coreDisputeIDuint256The ID of the dispute in Kleros Core, not in the Dispute Kit.

Returns

NameTypeDescription
<none>boolWhether 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

NameTypeDescription
_coreDisputeIDuint256The ID of the dispute in Kleros Core, not in the Dispute Kit.
_coreRoundIDuint256The ID of the round in Kleros Core, not in the Dispute Kit.
_voteIDuint256The ID of the voter.

Returns

NameTypeDescription
<none>boolWhether 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
);