democracyearth / old_dapp Goto Github PK
View Code? Open in Web Editor NEWLiquid democracy smart contract implementation
Liquid democracy smart contract implementation
Current implementation doesn't handle cycles. If there is a delegation cycle it would get stuck in an infinite loop spending the maximum gas allowed to spend.
How does the token plugin to liquid democracy smart contracts? Look into minime token as well as current zeppelin-solidity vote token implementation
Implement a simple UI for developers, to test every action possible of the contract and to have something to show
When user clicks on revoke
button it should trigger a metamask transaction.
Implementation must come with its respective tests in the corresponding test file
When user clicks on the button Sign up & Login
it triggers a metamask transaction
registerNewVoter()
with API call with web3.js and construct transaction.registerNewVoter()
transaction and show user name in nav bar.The UI should show the state of the transaction.
Exploring the idea of letting a voter change or update her vote once she's already voted
In this article
https://medium.com/blockchannel/how-to-save-your-ethereum-dapp-users-from-paying-gas-for-transactions-cfc665891ab4
they mention ways of shifting the gas consumption from the user that is interacting with the contract to the contract itself, which could be beneficial for us as we don't want voters to have to spend tons of gas just for a single delegation change.
Ballot information that we need to query:
The transaction status is only needed when the user creates the ballot. I'm thinking to construct the page we don't really have to get title, author name, date of creation if we just cache them and construct the page with the info. That way the only getter we'd need would be the transaction status. What do you think @LucasIsasmendi @aecc ?
For now the revoke()
function in LiquiDemocracy.sol
only works for delegations. It would be nice to implement one for votes as well. See #55
Create a getter that sums all the votes available for each option and retrieves the results
When user selects chooses an option ( yes
or no
) and then clicks on the vote
button it triggers a metamask transaction. Vote function parameters are vote(aremsg.sender, ballotId, voteOption)
Discuss with team and set up actionable issues we can work on to move forward with basic quadratic voting implementation
@aecc just logging this here so we can keep everyone in the loop, feel free to provide more context if needed.
Idea is to take the initial work below into a separate branch for this repo and continue testing from there.
https://gist.github.com/anonymous/7e55d694d3b1a118a8bc3a1d3dcb608c
Cores features are for a user to be able to 1) cast a vote directly on a issue, 2) revoke a vote previously cast, and 3) delegate a vote to a peer.
Need to break down what workload these features translate to, the idea is to give structure to milestone Contracts v0.1.0
I'm getting the following when doing testrpc
.
/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:30305
function VM (opts = {}) {
^
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:139:18)
at node.js:999:3
Shall we have an ethereum daemon or something else running?
When user creates ballot it triggers a metamask transaction to create a ballot calling createNewBallot(). createNewBallot parameters are createNewBallot(address from, bytes32 ipfsTitle)
The UI should show the state of the transaction.
Parent #69
THE BALLOT
YOUR ACTION
LIQUID DEMOCRACY REPRESENTATION
See #57 for delegate tab.
Currently, the implementation is limited to a single vote per person, according to the paper and Sovereign, we should make possible to vote more than a single owned vote
Currently, delegate and remove delegation are not modifying the ballot[ballotOption].voteCount according to the weight and votersData[voter].voted attribute. It should update it and keep an up-to-date view of voteCount(s).
Needed to add metamask to the UI so we can be able to create transactions on the blockchain
Change scope of functions to private in order to have them as internal APIs, and create as public/external the required ones that need the prove the identity of the voter (by account/signature).
How does Lightning⚡️fit into liquid democracy?
Deploy contract to the testnet
should LiquidDemocracy.sol have a function to de-activate the contract and refund any outstanding ETH to owner i.e. like this?
// constructor
function LiquidDemocracy()public {
contract_owner = msg.sender;
}
//deactivate the contract
function kill () public {
//only allow contract owner
require (msg.sender == contract_owner);
selfdestruct(contract_owner);
}
When user has chosen a delegate by clicking on the radio button and then click on the delegate
button it should trigger a metamask transaction. delegate function parameters are: delegate(address from, address representative)
For ballot X:
Params for delegate() function are : delegate(address from, address representative)
Params for vote() function are : vote(address voter, uint ballotId, uint voteOption)
Currently, a single ballot is supported. In reality, there should be space for more
Read up on ERC20 dynamics, implement Truffle/Zeppelin tutorial, debug and learn
Only 2 options are currently available, hardcoded as "yes" and "no". They should be flexible, and their name/description should live outside the blockchain (IPFS, etc)
Santi has good relationships with the RSK team. They have reached out to us to begin integrating DEF with RSK and exploring possible collaboration.
Para comenzar, pueden acceder al nodo / code de RSK en el repositorio de GitHub. En el link de Getting started van a tener toda la info para conectarse a la TestNet y hacer todas las pruebas necesarias. Después de la instalación, me pasan la BTC address de TestNet y los agregamos al whitelisting para que puedan usar el RSK Bridge. Cualquier consulta o dificultad, no dudes en escribirnos y los ayudamos.
https://github.com/rsksmart/rskj/wiki
Need to dive into that getting-started, connect to the TestNet, there should a BTC address we pass to them, they can add us to the RSK Bridge whitelist after that, Henry said they can help us if we have any questions.
This feature can take from PR #7. Implementation must come with its respective tests in the corresponding test file
Implementation must come with its respective tests in the corresponding test file
Luke (Aragon) shared with us the initial Liquid Democracy specification. Currently the doc is being discussed and reviewed, we waiting on Luke to specify next steps.
@virgile-dev @herbstephens @raulk feel free to leave comments about the doc in this this thread or within the doc itself.
Delegate tab:
See #9 for context. Idea is to start from a more abstract perspective and only modularize later as needed. This entails consolidating some functionality currently spread between Ballot.sol
, Delegation.sol
, Organization.sol
, Member.sol
into a single smart contract. This responds to initial architecture questions, intention is to keep things simple and allow us to stay more agile
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
Add IPFS hash to ballot title and voter name/email
When user clicks on revoke
button it should trigger a metamask transaction.
Update README to represent new repo status
From IPFS:
From Ethereum:
yes
votes on ballot (option1)no
votes on ballot (option2)Contextual information that we need to retrieve based on the users' eth address:
at the moment we are sending a file to ipfs per transaction. might be more efficient to put everything in a single file that gets updated (hash would change everytime).
Might not be that accountable as it won't be as easy to retrieve info as we would break the rule 1 transaction = 1 input data ipfs hash
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.