KlerosLiquidToV2Governor

Git Source

Inherits: IArbitrable, ITokenController

State Variables

foreignGateway

IArbitrator 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, IArbitrator _foreignGateway);

Parameters

NameTypeDescription
_klerosLiquidIKlerosLiquidThe trusted arbitrator to resolve potential disputes.
_governoraddressThe trusted governor of the contract.
_foreignGatewayIArbitratorThe 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. Can only be called by the arbitrator. TRUSTED. Triggers rule() from KlerosLiquid to the arbitrable contract which created the dispute.

function rule(uint256 _disputeID, uint256 _ruling) public;

Parameters

NameTypeDescription
_disputeIDuint256ID of the dispute in the arbitrator contract.
_rulinguint256Ruling given by the arbitrator. Note that 0 is reserved for "Refused to arbitrate".

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 _owner) external payable returns (bool allowed);

Parameters

NameTypeDescription
_owneraddressThe address that sent the ether to create tokens.

Returns

NameTypeDescription
allowedboolWhether the operation should be allowed or not.

onTransfer

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

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

Parameters

NameTypeDescription
_fromaddressThe origin of the transfer.
_toaddressThe destination of the transfer.
_amountuint256The amount of the transfer.

Returns

NameTypeDescription
allowedboolWhether the operation should be allowed or not.

onApprove

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

function onApprove(address _owner, address _spender, uint256 _amount) external returns (bool allowed);

Parameters

NameTypeDescription
_owneraddressThe address that calls approve().
_spenderaddressThe spender in the approve() call.
_amountuint256The amount in the approve() call.

Returns

NameTypeDescription
allowedboolWhether the operation should be allowed or not.

receive

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

receive() external payable;

Structs

DisputeData

struct DisputeData {
    uint256 klerosLiquidDisputeID;
    bool ruled;
}