|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | + |
| 3 | +pragma solidity ^0.8; |
| 4 | + |
| 5 | +import "./IArbitrator.sol"; |
| 6 | +import "../rng/RNG.sol"; |
| 7 | +import "../data-structures/SortitionSumTreeFactory.sol"; |
| 8 | + |
| 9 | +contract DisputeKitPlurality { |
| 10 | + // Core --> IN |
| 11 | + // createDispute |
| 12 | + |
| 13 | + // OUT -> Core |
| 14 | + // report drawn jurors |
| 15 | + // report ruling |
| 16 | + |
| 17 | + // Jurors -> IN |
| 18 | + // vote |
| 19 | + |
| 20 | + // Anyone -> IN |
| 21 | + // requestAppeal |
| 22 | + |
| 23 | + // INTERNAL |
| 24 | + // draw jurors <-> RNG |
| 25 | + // receive evidence |
| 26 | + // aggregate votes |
| 27 | + // incentive (who earns how much PNK and ETH) |
| 28 | + // appeal crowdfunding |
| 29 | + // redistribution when ruling is final |
| 30 | + |
| 31 | + IArbitrator public immutable core; |
| 32 | + RNG public immutable rng; |
| 33 | + |
| 34 | + using SortitionSumTreeFactory for SortitionSumTreeFactory.SortitionSumTrees; // Use library functions for sortition sum trees. |
| 35 | + |
| 36 | + // SortitionSumTreeFactory.SortitionSumTrees internal sortitionSumTrees; // The sortition sum trees. |
| 37 | + |
| 38 | + constructor(IArbitrator _core, RNG _rng) { |
| 39 | + core = _core; |
| 40 | + rng = _rng; |
| 41 | + } |
| 42 | + |
| 43 | + /** |
| 44 | + * Note: disputeID is maintained by Kleros Core, not the dispute kit |
| 45 | + * Note: the dispute kit does not receive any payment, Kleros Core does |
| 46 | + * Note: Permissioned |
| 47 | + */ |
| 48 | + function createDispute( |
| 49 | + uint256 _disputeID, |
| 50 | + uint256 _minJuror, |
| 51 | + uint256 _choices, |
| 52 | + bytes calldata _extraData |
| 53 | + ) external { |
| 54 | + require(msg.sender == address(core), "Not allowed: sender is not core"); |
| 55 | + |
| 56 | + // -- dispute specific -- |
| 57 | + // |
| 58 | + |
| 59 | + // -- subcourt specific -- |
| 60 | + // uint minStake: min tokens required to stake on this subcourt |
| 61 | + // bool hiddenVotes: |
| 62 | + // uint alpha: bps of tokens lost when incoherent |
| 63 | + // uint feeForJuror: paid per juror |
| 64 | + // uint jurorsForCourtJump: evaluated by the appeal logic |
| 65 | + |
| 66 | + // PROBLEM: have an interface that works for and "1 human 1 vote" |
| 67 | + |
| 68 | + // votes = msg.value / subcourt.feeForJuror |
| 69 | + // tokenAtStakePerJuror = (subcourt.minStake * subcourt.alpha) / ALPHA_DIVISOR |
| 70 | + // ALPHA_DIVISOR = 10000 |
| 71 | + } |
| 72 | + |
| 73 | + function drawJurors(SortitionSumTreeFactory.SortitionSumTrees calldata tree) public {} |
| 74 | +} |
0 commit comments