RealitioForeignArbitrationProxyWithAppeals

This contract is meant to be deployed to the Ethereum chains where Kleros is deployed.

Variables

NUMBER_OF_CHOICES_FOR_ARBITRATOR

uint256 NUMBER_OF_CHOICES_FOR_ARBITRATOR

MULTIPLIER_DIVISOR

uint256 MULTIPLIER_DIVISOR

META_EVIDENCE_ID

uint256 META_EVIDENCE_ID

Status

enum Status {
  None,
  Requested,
  Created,
  Ruled,
  Failed
}

ArbitrationRequest

struct ArbitrationRequest {
  enum RealitioForeignArbitrationProxyWithAppeals.Status status;
  uint248 deposit;
  uint256 disputeID;
  uint256 answer;
  struct RealitioForeignArbitrationProxyWithAppeals.Round[] rounds;
}

DisputeDetails

struct DisputeDetails {
  uint256 arbitrationID;
  address requester;
}

Round

struct Round {
  mapping(uint256 => uint256) paidFees;
  mapping(uint256 => bool) hasPaid;
  mapping(address => mapping(uint256 => uint256)) contributions;
  uint256 feeRewards;
  uint256[] fundedAnswers;
}

arbitrator

contract IArbitrator arbitrator

arbitratorExtraData

bytes arbitratorExtraData

amb

contract IAMB amb

homeProxy

address homeProxy

homeChainId

bytes32 homeChainId

termsOfService

string termsOfService

winnerMultiplier

uint256 winnerMultiplier

loserMultiplier

uint256 loserMultiplier

loserAppealPeriodMultiplier

uint256 loserAppealPeriodMultiplier

arbitrationRequests

mapping(uint256 => mapping(address => struct RealitioForeignArbitrationProxyWithAppeals.ArbitrationRequest)) arbitrationRequests

disputeIDToDisputeDetails

mapping(uint256 => struct RealitioForeignArbitrationProxyWithAppeals.DisputeDetails) disputeIDToDisputeDetails

arbitrationIDToDisputeExists

mapping(uint256 => bool) arbitrationIDToDisputeExists

arbitrationIDToRequester

mapping(uint256 => address) arbitrationIDToRequester

Modifiers

onlyHomeProxy

modifier onlyHomeProxy()

Functions

constructor

constructor(contract IAMB _amb, address _homeProxy, bytes32 _homeChainId, contract IArbitrator _arbitrator, bytes _arbitratorExtraData, string _metaEvidence, string _termsOfService, uint256 _winnerMultiplier, uint256 _loserMultiplier, uint256 _loserAppealPeriodMultiplier) public

Creates an arbitration proxy on the foreign chain.

Parameters

requestArbitration

function requestArbitration(bytes32 _questionID, uint256 _maxPrevious) external payable

Requests arbitration for the given question and contested answer.

Parameters

receiveArbitrationAcknowledgement

function receiveArbitrationAcknowledgement(bytes32 _questionID, address _requester) external

Receives the acknowledgement of the arbitration request for the given question and requester. TRUSTED.

Parameters

receiveArbitrationCancelation

function receiveArbitrationCancelation(bytes32 _questionID, address _requester) external

Receives the cancelation of the arbitration request for the given question and requester. TRUSTED.

Parameters

handleFailedDisputeCreation

function handleFailedDisputeCreation(bytes32 _questionID, address _requester) external

Cancels the arbitration in case the dispute could not be created.

Parameters

fundAppeal

function fundAppeal(uint256 _arbitrationID, uint256 _answer) external payable returns (bool)

Takes up to the total amount required to fund an answer. Reimburses the rest. Creates an appeal if at least two answers are funded.

Parameters

Return Values

withdrawFeesAndRewards

function withdrawFeesAndRewards(uint256 _arbitrationID, address payable _beneficiary, uint256 _round, uint256 _answer) public returns (uint256 reward)

Sends the fee stake rewards and reimbursements proportional to the contributions made to the winner of a dispute. Reimburses contributions if there is no winner.

Parameters

Return Values

withdrawFeesAndRewardsForAllRounds

function withdrawFeesAndRewardsForAllRounds(uint256 _arbitrationID, address payable _beneficiary, uint256 _contributedTo) external

Allows to withdraw any rewards or reimbursable fees for all rounds at once.

This function is O(n) where n is the total number of rounds. Arbitration cost of subsequent rounds is A(n) = 2A(n-1) + 1. So because of this exponential growth of costs, you can assume n is less than 10 at all times.

Parameters

submitEvidence

function submitEvidence(uint256 _arbitrationID, string _evidenceURI) external

Allows to submit evidence for a particular question.

Parameters

rule

function rule(uint256 _disputeID, uint256 _ruling) external

Rules a specified dispute. Can only be called by the arbitrator.

Accounts for the situation where the winner loses a case due to paying less appeal fees than expected.

Parameters

getMultipliers

function getMultipliers() external view returns (uint256 winner, uint256 loser, uint256 loserAppealPeriod, uint256 divisor)

Returns stake multipliers.

Return Values

numberOfRulingOptions

function numberOfRulingOptions(uint256) external pure returns (uint256)

Returns number of possible ruling options. Valid rulings are [0, return value].

Return Values

getDisputeFee

function getDisputeFee(bytes32) external view returns (uint256)

Gets the fee to create a dispute.

Return Values

getNumberOfRounds

function getNumberOfRounds(uint256 _arbitrationID) external view returns (uint256)

Gets the number of rounds of the specific question.

Parameters

Return Values

getRoundInfo

function getRoundInfo(uint256 _arbitrationID, uint256 _round) external view returns (uint256[] paidFees, uint256 feeRewards, uint256[] fundedAnswers)

Gets the information of a round of a question.

Parameters

Return Values

getFundingStatus

function getFundingStatus(uint256 _arbitrationID, uint256 _round, uint256 _answer) external view returns (uint256 raised, bool fullyFunded)

Gets the information of a round of a question for a specific answer choice.

Parameters

Return Values

getContributionsToSuccessfulFundings

function getContributionsToSuccessfulFundings(uint256 _arbitrationID, uint256 _round, address _contributor) external view returns (uint256[] fundedAnswers, uint256[] contributions)

Gets contributions to the answers that are fully funded.

Parameters

Return Values

getTotalWithdrawableAmount

function getTotalWithdrawableAmount(uint256 _arbitrationID, address payable _beneficiary, uint256 _contributedTo) external view returns (uint256 sum)

Returns the sum of withdrawable amount.

This function is O(n) where n is the total number of rounds. This could exceed the gas limit, therefore this function should be used only as a utility and not be relied upon by other contracts.

Parameters

Return Values

questionIDToArbitrationID

function questionIDToArbitrationID(bytes32 _questionID) external pure returns (uint256)

Casts question ID into uint256 thus returning the related arbitration ID.

Parameters

Return Values

externalIDtoLocalID

function externalIDtoLocalID(uint256 _externalDisputeID) external view returns (uint256)

Maps external (arbitrator side) dispute id to local (arbitrable) dispute id.

Parameters

Return Values

Last updated