An open API service indexing awesome lists of open source software.

https://github.com/nthe/lisk-dapp-polls

Decentralized polling application on Lisk.
https://github.com/nthe/lisk-dapp-polls

application blockchain distributed javascript lisk polling

Last synced: 13 days ago
JSON representation

Decentralized polling application on Lisk.

Awesome Lists containing this project

README

          



# Decentralized voting app on Lisk

## Installation

Check out [Lisk SDK examples](https://github.com/LiskHQ/lisk-sdk-examples) and official [lisk.io documentation](https://lisk.io/documentation/lisk-sdk/index.html) for setup instructions.

## Description

Below is the short description of states and transactions.

### Poll states

Each poll is set to created when created. Closed poll cannot be re-opened. Polls and their results cannot be deleted.

1.**Created** state

- everyone can view the poll
- noone can vote
- the owner can open the poll

2.**Opened** state

- everyone can view the poll
- everyone can vote and change their vote
- noone can see the results
- the owner can close the poll

3.**Closed** state

- everyone can view the poll
- everyone can display results
- noone can change the vote

### Transactions

In order to achieve all mentioned states, three transactions were created.

- create poll
- update poll
- vote

Polls and votes are stored on the senders account in following form.

```js
// PollState = [ "created", "opened", "closed" ]

{
...
"address": string,
"balance": BigNum,
"asset": {
"polls" [
{
"id": uuid, // pollId
"title": string,
"options": [
{
"text": string,
"id": int // optionId
}
],
"state": PollState
}
],
"votes": {
[pollId]: [optionId]
}
},
...
}

```