Code Monkey home page Code Monkey logo

bc-plcr-voting's Introduction

First-voter advantage - PLCRVoting based on bonding curve

Partial Lock Commit Reveal Votingをベースとして、より早く投票することにインセンティブを与える機能を加えたコントラクトです。 PLCRVotingでは、CommitステージとRevealステージに分けた投票プロセスが行われます。  

requestVotingRightsによってデポジットしたERC20トークンの量に応じてPLCRVotingコントラクト内での投票権が与えられ、Commitステージでその投票権以下のトークン量相当をコミットすることができます。 また、一度コミットした投票はReveal時までロックされるので動かすことはできません。

このコミット量に対し、Bancorの価格決定方式を使ったBonding Curveによって投票先行者が有利になる設計となっています。 つまり、同量のコミット量に対しより早く投票するほどより多くの議決権が得られます。 (例えば、x軸をtotalSupply、y軸をpriceにとったy=x^2においてより早くmintされたトークンの方が1トークン当たりのpriceが低くなります。)先行者をどのくらい有利にするか決めるパラメーターは、投票開始者が設定することができます。

そして、Revealステージで投票者はコミット時に設定したsecret saltを使うことで自身の調整後のコミット量を投票結果に反映させ、コミットトークンを解放することができます。
また、コミット中のアクティブなトークン量はアドレスごとにDLL(Doubly-linked list)によってソートされるのでユーザーは同時期に複数の投票にコミットしていても、 「デポジット量から特定の投票における最大コミットトークン数を引いた値」をコントラクトから引き出すことが可能です。


PLCRVoting: https://github.com/ConsenSys/PLCRVoting

Bancor Protocol: https://github.com/bancorprotocol/contracts

Bonding Curve: https://github.com/relevant-community/contracts

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.