Giter Site home page Giter Site logo

kleros-interaction's Introduction

Kleros Interaction Smart Contracts

JavaScript Style Guide Build Status Tested with Truffle Conventional Commits Commitizen Friendly Styled with Prettier Chat on Gitter

Smart contracts able to interact with Kleros and standard proposals.

Get Started

  1. Clone this repo.
  2. Run yarn to install dependencies and then yarn run build to compile the contracts.

Scripts

  • yarn run prettify - Apply prettier to the entire project.
  • yarn run lint:sol - Lint the entire project's .sol files.
  • yarn run lint:js - Lint the entire project's .js files.
  • yarn run lint:sol --fix - Fix fixable linting errors in .sol files.
  • yarn run lint:js --fix - Fix fixable linting errors in .js files.
  • yarn run lint - Lint the entire project's .sol and .js files.
  • yarn test - Run the truffle tests.
  • yarn run cz - Run commitizen.
  • yarn run build - Compile contracts.

Test

Testrpc default gas limit is lower than the mainnet which prevents deploying some contracts. Before running truffle tests use: testrpc -l 8000000.

Contributing

See contributing.

Learn how to develop arbitrable and arbitrator contracts here.

kleros-interaction's People

Contributors

0xferit avatar clesaege avatar dannybabbev avatar eburgos avatar eccentricexit avatar epiqueras avatar gabrielmendanha avatar gratestas avatar hbarcelos avatar hellwolf avatar jaybuidl avatar kdembler avatar luhart avatar merlinegalite avatar mrclegal avatar n1c01a5 avatar remedcu avatar satello avatar shalzz avatar tobyweed avatar unknownunknown1 avatar yushih avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kleros-interaction's Issues

Implement BackupedArbitrator.sol

This is an arbitrator who, if not responsive, can be appealed.
So its rulings are final. But if he does not rule, another one will replace it.
We may inherit from CentralizedArbitrator.

Generalized blockhashRNGFallback

Look at
Softcore comments:

allows reroll every 256 blocks instead of every block.

what I meant is to use something like: blockhash((block.number - 1) - (block.number - 1 - _block)%256), which has the added benefit of returning the correct block number when the block is in range

and implement them if they make sense or explain why the current version is better.

Disable Evidence Submission After Draw Period

Evidence should only be submittable before the creation of the dispute, and during the "Activation" and "Draw" periods.

Otherwise jurors can have incomplete or different information when voting and this would mess up the Schelling Point.

Make a general arbitrable deposit contract

Make

a contract where:

  • The owner can add a deposit on the contract.
  • Any party may make a claim of value X against the contract creator by also putting a deposit D=X*r, where r is the proportion of the claim that the claimant has to deposit.
  • In case of a claim, the owner can propose to accept the claim up to a certain amount A (note that we may have A==0), if it is the full amount (A==D), he claim is settled, and ETH from the owner deposit are given to the claimant.
  • Otherwise, a dispute resolution process ensues.
  • If the Arbitrator rules for the claimant ETH from the owner deposit are given to the claimant.
  • If the Arbitrator rules for the owner, the deposit D of the claimant is added to the deposit of the owner, then, A is taken from the deposit of the owner to be given to the claimant.

Make a contract for the cryptokitty dispute

https://medium.com/kleros/announcing-who-gets-the-cryptokitty-infographic-contest-a52493a8d7dc

Party A and B create a “marriage smart contract”

They put the Cryptokitty in the Marriage Contract

Party A and B eventually split up. :(

A Dispute for the Cryptokitty is submitted by B, in which Kleros’ jurors can decide to :

- Give the kitty to A
- Give the kitty to B
- Grant shared custody. The kitty will not be transferable without the agreement of both parties. Each party can use the kitty every other week.

Implement AppealableArbitrator.sol

This is a centralized arbitrator who can be appealed to another arbitrator.
The other arbitrator can be any kind of arbitrator.
This contract can inherit from CentralizedArbitrator.

Two parties pay appeal fees and simple insurance mechanism

Denote by x the total amount that must be paid to jurors in an upcoming appeal. In case of appeal, the party that won the previous round should pay x+s_A in appeal fees while the party that lost the previous round should pay x+2s_A in appeal fees. If one party pays appeal fees and the other does not, the party that pays appeal fees wins the dispute. If neither party pays appeal fees, the previous decision stands. The party that ultimately wins (after all appeal rounds are concluded) receives all the remaining value left over after the jurors are paid. The period for the party that won the previous round to pay her fees should be after that of the party that lost the previous round.

s_A should be a parameter that can be tuned by governance: default recommendation s_A=x.

Additionally, create system for appeal fees to be "crowdsourced" by third parties. Namely, individuals can pay a portion of the fee. If enough is raised, the appeal is financed and any stake s_A or 2s_A that that party receives if she wins due to that round is split proportionally between the crowdsourcers based on contribution size.

See:

https://drive.google.com/file/d/1y67t-NJUjRPNkp1UB8lDJWas9Sb9KFU7/view?usp=sharing

for more details and analysis. (Crowdsourcing proposal on pages 1-2.)

Make a Weighted Arbitrator

Make an arbitrator asking multiple other arbitrators (so this arbitrator contract is also arbitrable) rulings and fusing all those rulings into one ruling taking into account the weight of each one.

Implement a centralized arbitrator court

Make an Arbitrator contract where the decisions are made by the majority of court members.
The arbitration fees are to be split among all court members proportionally.
Appeals are not possible.

Test ArbitrablePermissionList

ArbitrableBlacklist is replaced by ArbitrablePermissionList. So I'm going to adapt ArbitrableBlacklists tests to ArbitrablePermissionList.

Decrease Cognitive Load on MultiPartyInsurableFees.sol

The code should be refactored to be more readable.
Example:
The method fundDispute() calculates _paidFees.totalContributedPerSide.length - 1 several times, to get the last index of the list, which makes it harder to digest the code.

Make an Discrete Arbitrable Oracle Contract

Make an arbitrable Oracle contract which allow anyone (including other dapps), to ask questions with a finite number of possible answers.
Anyone can report by putting a deposit (which should cover at least arbitration fees), if deposits are placed on multiple answers, a dispute resolution process is started and the honest reporter split the remaining deposits (what is left after arbitration fees) of the dishonest ones.
Since it's multi-party, anyone can appeal.
Other contracts must be able to query the Oracle deposit.
(See slides 14-17 of this presentation: https://docs.google.com/presentation/d/1peHMkbHDy7nZp6uenmFcnkWCslf8SVOxoAyW-Shya_I/edit#slide=id.g30a681bc36_0_81 )

Tests failing for ArbitrablePermissionList

The contract is not initialized correctly in the tests. Five test are failing with Error: ArbitrablePermissionList contract constructor expected 7 arguments, received 6

the buyer hasn't any incentive to pay the seller

for the arbitrable payment https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/ArbitrableTransaction.sol the buyer hasen't any incentive to pay the seller (except maybe to keep good relationship with him) in contrary because it costs gas. So the seller must do always raise a dispute and do a timeout request, 2 txs.
I propose to solve it the buyer makes a deposit and if he doesn't pay the seller in this case, he looses it.
An another one would be to make payment automatic if no challenge within a defined period of time with action callback (alarm clock).

Make a Standard About Action Callbacks

See the example of should-refill in http://1corp.io/snow/docs

-Function with the prefix should_ and the same parameters.
-Return True if need to call.

Ideally the standard should allow to do:
When function1 with args1 of contract1 returns true, call function2 with args2 of contract.

A deamon could watch the blockchain, calling function1 with args1 of contract1 at repeated interval. When it returns true. It should call function2 with args2 of contract2. Incentives could be made with a protocol like snow, the ethereum alarm clock (https://github.com/ethereum-alarm-clock/ethereum-alarm-clock) or another incentive system.

The goal is to be able to have deamon executing some functions of a smart contract which can be called by anyone (like passPeriod, executeRuling and oneShotTokenRepartition in https://github.com/kleros/kleros/blob/master/contracts/KlerosPOC.sol).
This would greatly increase the user experience while using dapps.

Make a mechanism to change the team

In this contract: https://github.com/kleros/kleros-interaction/blob/master/contracts/standard/arbitration/ArbitrableTokens/FundingVault.sol
We need a mechanism to allow token holders to propose a team change in case the team is not delivering. This would also go to arbitration. This will work in a manner similar to opposing a milestone claim (same threshold for votes). The result will be a changed team variable.

We need to deal with the fact that there is now two types of possible disputes in the same contract:
-Dispute about a milestone claim.
-Dispute about changing a team.

This will be a nice example of contract with multi-disputes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.