Coder Social home page Coder Social logo

poanetwork / poa-dapps-voting Goto Github PK

View Code? Open in Web Editor NEW
26.0 10.0 54.0 12.3 MB

POA Network Governance Dapp

Home Page: https://voting.poa.network

License: GNU General Public License v3.0

JavaScript 78.98% HTML 0.27% SCSS 20.75%
dapp ethereum ethereum-dapp governance

poa-dapps-voting's Introduction

POA Network Governance Dapp

Base supported networks

  • Core POA network (RPC endpoint: https://core.poa.network)
  • Sokol testnet (RPC endpoint: https://sokol.poa.network)
  • Kovan testnet (RPC endpoint: https://kovan.infura.io/)

Supported browsers

  • Google Chrome v 59.0.3071.115+

MetaMask/Nifty Wallet extensions setup

Governance Dapp overview

Please check related posts in wiki Governance Overview and Ballots life cycle

Configuration

Governance DApp is configured with POA Network governance contracts

There are contracts' addresses for Sokol, Core, and Kovan.

Building from source

  1. npm i

  2. npm start

poa-dapps-voting's People

Contributors

gabitoesmiapodo avatar idobrovolskyi avatar igorbarinov avatar maxaleks avatar maxgrapps avatar phahulin avatar rstormsf avatar varasev avatar vbaranov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

poa-dapps-voting's Issues

When click "Yes" button to vote it doesn't vote

According to the console log,
it looks like it doesn't properly translate "Yes" to correct number:
https://github.com/poanetwork/poa-dapps-voting/blob/core/src/contracts/VotingToChangeKeys.contract.js#L20
When I investigated the above method here are params that were passed:

vote 0 0 0x4471974679e4c956f379bd6761b62e65c169a83a

while Yes should be translated to 1, not 0

https://github.com/poanetwork/poa-network-consensus-contracts/blob/master/contracts/VotingToChangeKeys.sol#L13
According to our smart contract,
0 means Invalid
1 means accepted
2 means Rejected

UI - Ballot Contract Design

I was thinking - in order to help drill through the intended logic -

Add Key, Remove Key, Sway Key radio buttons are removed and replaced with a drop down. This would save space.

Then below this, remove the 'col' with the: mining key, payout key, voting key - and instead have another drop down.

poa19012018_2

This would have the effect of forcing a logical progression: Management Function -> Key Type

Support for new BallotType: AddValidator or OnBoard Validator Ballot which takes (3) keys

Currently, to add/onboard a Validator using Governance. (3) Ballots are required, 1 for each key ( mining, voting, payout ). There is some questions whether these ballots can be done concurrently or if the mining key needs to be added first.

There is now a 48 hour minimum for a Ballot so would take a minimum of 4 days to fully onboard a Validator.

I propose a single Ballot that support specifying the (3) keys in a single Ballot ( i.e. Add Validator or OnBoard Validator Ballot ).

There has been some discussion of decoupling the process these keys are added some, but my feeling is that to be a fully-qualified Validator you need all (3) keys so think best to keep them together. This would reduce the onboarding of a Validator to 48 hours and mitigate risk of decoupling the process.

Doesn't work

  1. Don't navigate to the next screen as if I were proposing a new" miner creation if I selected a ballot to REMOVE key
    Please also have some explanations for each field, what they mean and how to use it. (mining key, affected key, etc.)

  2. When I created a ballot, I should be automatically voted (doesn't work now)

  3. For some reason I had 20 rows of proposals when I created a ballot

  4. I was able to vote NO for proposal.

  5. I was able to vote YES for proposal

  6. UI - please change Button's fields from VOTE TO Yes/No (or better names)

  7. Please change YES to the right and No to the left. ( I believe that's how it's being used in most UI popups)

  8. Let the creator choose EXPIRATION DATE for ballot

screen shot 2017-10-01 at 11 13 03 am

(Fix) prepare 2 branches: core and sokol

Problem: repository should have 2 branches: for core network and sokol test network. dApp should be deployed to github pages from core network branch
Solution: create 2 branches: core and sokol and deploy dApp from core branch to github pages.

(Fix) Lorem Ipsum should be replaced

Problem:
Lorem ipsum descriptions are made for design purposes not to use in production
Solution:
Replace lorem ipusm with meaningful text. Please check grammar on grammarly.com before committing

UX - Error Trapping - Max Time

Perhaps limit the max time that a ballot contract may be open to X (whatever X is deemed ok). This would limit the potential for ballots that never resolve or resolve over long periods of time.

I would suggest 14 calendar days as the upper boundary for this.

Warning in JS console

Something is not being rendered properly:

index.js:2177 Warning: Cannot update during an existing state transition (such as within `render` or another component's constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to `componentWillMount`.

Needs further investigation

web3.js is loaded twice

According to the logs, it looks like it is loaded twice:

Injected web3 detected.
getWeb3.js:17 netId 99
getWeb3.js:21 This is Core 99
getWeb3.js:17 netId 99
getWeb3.js:21 This is Core 99

Ballots UI -- Need BALLOT MEMO or DESCRIPTION other observations/suggestions

Need MEMO or BALLOT DESCRIPTION so know what we are voting on.

-NAME suggest PROPOSER
-PROXY BALLOT ID suggest BALLOT ID
-Unnecessary text ("Finalization is available after ballot time is finished ") when Ballot is already Finalized
-TIME suggest BALLOT TIME
-Add STATUS column
-Does search work? and/or add filtering
-Sort order by BALLOT ID descending, i.e. most recent ballots first.

In general, inefficient use of space ... perhaps move towards summary -> detail ( drill down ) model.
I will try to provide mock up to describe what I mean.
sokol - poa network governance dapp - google chrome_001

(Feature) Notifications on new ballots

Problem:

validators don't get notifications on new ballots. It may problems in governance where a malicious group of three or more validators will create series of proposals to remove other validators from consensus.

Possible solutions:

Server side or client/cloud side. I propose to implement the feature on client side first, with a combination of UI changes and hooks on deployment side.

Risks:

  • A malicious validator can deploy dapp code locally and prevent from
    Mitigation: server-side ethereum event listener, subscribed to governance dapps

  • A malicious validator can prevent form submission. This risk we will mitigate in future server side version of notification service which will subscribe to events
    Mitigation: server-side ethereum event listener, subscribed to governance dapps

With server-side deployment, we have new types of risks:

  • a compromised server
  • malicious devops

Affected key together with mining key for ballots

As voting dapp should be only single instrument to add/change/remove production keys, there is suggestion to add an affected key (it could be mining, voting or payout key) together with a mining key (to store this pair in the Oracles contract) of affected notary to a ballot.

(Feature) Finalize ballots

Problem: Finalize ballots functionality is missing
Solution: Add finalization button functionality to new version of dApp

Move personal data to 2nd screen

Personal data is needed, if Add action is chosen and affected key = mining key. The suggestion is to move personal data to second screen and open it only for adding of new mining key.

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.