DemocracyEarth / old_dapp

Liquid democracy smart contract implementation
32 stars 13 forks source link

Explore liquid pledging #4

Open medied opened 6 years ago

medied commented 6 years ago

From the Liquid Democracy Specification doc:

Giveth’s liquid pledging contracts combined with a token snapshot (either by locking token balances during the vote or using something like the minime token) can be used to allow votes to flow through delegates to a final tally. If a user chooses to re-delegate or override their delegates choice the current tally is updated. When the poll ends the values are locked in and result can be returned.

Let's look into this and learn about it.

Resources

https://github.com/Giveth/liquidpledging https://medium.com/giveth/the-minime-token-open-sourced-by-giveth-2710c0210787

medied commented 6 years ago

The MiniMeToken contract is a standard ERC20 token with extra functionality:

(...)

The token is easy to clone! Anybody can create a new clone token from any token using this contract with an initial distribution identical to the original token at a specified block

Balance history is registered and available to be queried. All MiniMe Tokens maintain a history of the balance changes that occur during each block

The controller of the contract can generate/destroy/transfer tokens at its own discretion. The controller can be a regular account, but the intention is for the controller to be another contract that imposes transparent rules on the token's issuance and functionality.

The Token's Controller can freeze transfers.

(source)

medied commented 6 years ago

Slack for questions

medied commented 6 years ago

There's useful info in the /liquidpledging repo README but the code seems to be well documented with comments. Main idea:

/// @ dev LiquidPleding allows for liquid pledging through the use of /// internal id structures and delegate chaining. All basic operations for /// handling liquid pledging are supplied as well as plugin features /// to allow for expanded functionality.

(source)

medied commented 6 years ago

Overview explanation video of MiniToken contract via Remix