KlerosLiquidToV2Governor

Git Source

Inherits: IArbitrableV2, ITokenController

State Variables

foreignGateway

IArbitratorV2 public immutable foreignGateway;

klerosLiquid

IKlerosLiquid public immutable klerosLiquid;

governor

address public governor;

klerosLiquidDisputeIDtoGatewayDisputeID

mapping(uint256 => uint256) public klerosLiquidDisputeIDtoGatewayDisputeID;

disputes

mapping(uint256 => DisputeData) public disputes;

frozenTokens

mapping(address => uint256) public frozenTokens;

isDisputeNotified

mapping(uint256 => mapping(uint256 => bool)) public isDisputeNotified;

Functions

onlyByGovernor

modifier onlyByGovernor();

constructor

Constructor. Before this contract is made the new governor of KlerosLiquid, the evidence period of all subcourts has to be set to uint(-1).

constructor(IKlerosLiquid _klerosLiquid, address _governor, IArbitratorV2 _foreignGateway);

Parameters

NameTypeDescription
_klerosLiquidIKlerosLiquidThe trusted arbitrator to resolve potential disputes.
_governoraddressThe trusted governor of the contract.
_foreignGatewayIArbitratorV2The trusted gateway that acts as an arbitrator, relaying disputes to v2.

executeGovernorProposal

Lets the governor call anything on behalf of the contract.

function executeGovernorProposal(address _destination, uint256 _amount, bytes calldata _data) external onlyByGovernor;

Parameters

NameTypeDescription
_destinationaddressThe destination of the call.
_amountuint256The value sent with the call.
_databytesThe data sent with the call.

changeGovernor

Changes the governor storage variable.

function changeGovernor(address _governor) external onlyByGovernor;

Parameters

NameTypeDescription
_governoraddressThe new value for the governor storage variable.

relayDispute

Relays disputes from KlerosLiquid to Kleros v2. Only disputes in the evidence period of the initial round can be realyed.

function relayDispute(uint256 _disputeID) external;

Parameters

NameTypeDescription
_disputeIDuint256The ID of the dispute as defined in KlerosLiquid.

rule

Give a ruling for a dispute. Must be called by the arbitrator. The purpose of this function is to ensure that the address calling it has the right to rule on the contract.

function rule(uint256 _disputeID, uint256 _ruling) public override;

Parameters

NameTypeDescription
_disputeIDuint256The identifier of the dispute in the Arbitrator contract.
_rulinguint256Ruling given by the arbitrator. Note that 0 is reserved for "Not able/wanting to make a decision".

notifyFrozenTokens

Registers jurors' tokens which where locked due to relaying a given dispute. These tokens don't count as locked.

function notifyFrozenTokens(uint256 _disputeID) external;

Parameters

NameTypeDescription
_disputeIDuint256The ID of the dispute as defined in KlerosLiquid.

proxyPayment

Called when _owner sends ether to the MiniMe Token contract

function proxyPayment(address) external payable override returns (bool allowed);

Parameters

NameTypeDescription
<none>address

Returns

NameTypeDescription
allowedboolTrue if the ether is accepted, false if it throws

onTransfer

Notifies the controller about a token transfer allowing the controller to react if desired

function onTransfer(address _from, address, uint256 _amount) external view override returns (bool allowed);

Parameters

NameTypeDescription
_fromaddressThe origin of the transfer
<none>address
_amountuint256The amount of the transfer

Returns

NameTypeDescription
allowedboolFalse if the controller does not authorize the transfer

onApprove

Notifies the controller about an approval allowing the controller to react if desired

function onApprove(address, address, uint256) external pure override returns (bool allowed);

Parameters

NameTypeDescription
<none>address
<none>address
<none>uint256

Returns

NameTypeDescription
allowedboolFalse if the controller does not authorize the approval

receive

This contract should be able to receive arbitration fees from KlerosLiquid.

receive() external payable;

Structs

DisputeData

struct DisputeData {
    uint256 klerosLiquidDisputeID;
    bool ruled;
}