Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Court Pallet #200

Closed
Tracked by #282
lsaether opened this issue Jun 25, 2021 · 0 comments · Fixed by #276
Closed
Tracked by #282

Court Pallet #200

lsaether opened this issue Jun 25, 2021 · 0 comments · Fixed by #276
Assignees
Labels
p:medium Medium priority, this issue can wait but should be done fairly soon t:enhancement The issue described an enhancement

Comments

@lsaether
Copy link
Member

To live alongside SimpleDisputes, there is the Court pallet.

Core Logic

  • join_court - Allows any ZTG holder to stake funds to join the court. The amount of funds to stake is a factor of the number of court participants that have already joined.
  • exit_court - Allows a ZTG holder who has staked to join the court to leave and get their funds back.
  • on_dispute - When a dispute occurs a subset of all court participants is chosen at random and assigned to a "court case". They then have CourtCaseDuration amount of time to cast a vote for which Outcome is correct. The majority of votes becomes the new reported outcome. The dispute process can occur multiple times, each requiring a larger bond, and taking a larger subset of court participants at random.
  • on_resolution - Similar to SimpleDisputes resolution, however with a different payout structure. All of the parties who are sided on the winning side get their bonds back, and the parties on the losing side are slashed 50% of their bonds, which get split among all parties on the winning side. For Court participants who voted on the losing side in a winning majority or failed to vote within the CourtCaseDuration will not receive any rewards, however neither will they be slashed, they will however be placed as Tardy. If a Tardy court participant fails to participate in a court case for a second time, they are removed from the court and 20% of their staked funds are sent to the on-chain treasury.

Storage

Similar storage to what's already in simple disputes, with the addition of...

Jurors - a vec of all staked jurors.

Data Structures

Juror

struct Juror {
  bonded: u128,
  status: JurorStatus,
};

enum JurorStatus {
  Ok,
  Tardy,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:medium Medium priority, this issue can wait but should be done fairly soon t:enhancement The issue described an enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants