Skip to content

Commit

Permalink
Voting to vote corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
izqui committed Nov 13, 2017
1 parent 4743814 commit b916929
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions docs/dev/apps/voting.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Voting

The voting app is an entity that will execute a set of actions on other entities if token holders of a particular token decide to do so.
The Voting app is an entity that will execute a set of actions on other entities if token holders of a particular token decide to do so.

### App initialization

Expand All @@ -15,7 +15,7 @@ For percentages `10 ^ 18` is interpreted as `100` to allow fine tuning. This mea

The only parameter that can be changed if 'Minimum acceptance quorum' for protecting against the case in which there is not enough voter turnout.

### Voting lifecycle
### Vote lifecycle

#### Creation
```
Expand All @@ -27,32 +27,32 @@ A new vote is initialized with:
- Execution script: [EVM call script](../../AragonOS/#evm-call-script) to be executed on vote approval, contains a series of addresses and calldata payloads that will be executed.
- Metadata: An arbitrary string that can be used to describe the voting.

Voting conforms to the [AragonOS Forwarder interface](../../AragonOS/#forwarders). A generic forward action will create a vote with the provided execution script and empty metadata.
The voting app conforms to the [AragonOS Forwarder interface](../../AragonOS/#forwarders). A generic forward action will create a vote with the provided execution script and empty metadata.

When a vote is created a reference to the previous block number is saved as the snapshot block for the vote. The reason the previous block number is used is to avoid double voting in the same block the vote is created. Whenever a vote is casted, the MiniMeToken associated with the app is checked for the token balance of the voter at the snapshot block.

#### Casting votes
```
votingApp.vote(uint256 _votingId, bool _supports)
votingApp.vote(uint256 _voteId, bool _supports)
```

In order for casting a vote all these conditions must be met:

- Sender had a positive token balance in the token at the voting snapshot block.
- Voting hasn't expired.
- Voting hasn't been already executed.
- Sender had a positive token balance in the token at the vote snapshot block.
- Vote hasn't expired.
- Vote hasn't been already executed.

If the casted vote is in support of the voting, the number of tokens held by the sender at the snapshot block will be added to the voting `yea` counter. In case a vote is against, it will add it to the `nay` counter.
If the casted vote is in support of the vote, the number of tokens held by the sender at the snapshot block will be added to the vote `yea` counter. In case a vote is against, it will add it to the `nay` counter.

After any casted votes, the contract checks whether a voting already has the complete support to be executed (even if everyone else voted against, the vote would still be approved), in that case the vote is executed and closed.
After any casted votes, the contract checks whether a vote already has the complete support to be executed (even if everyone else voted against, the vote would still be approved), in that case the vote is executed and closed.


#### Executing voting
```
votingApp.executeVote(uint256 _votingId)
votingApp.executeVote(uint256 _voteId)
```

After a voting has expired time-wise (and no more votes are allowed), the result of the voting can be executed by anyone if it was approved. For a voting to be considered approved both conditions must be true:
After a vote has expired time-wise (and no more votes are allowed), the result of the vote can be executed by anyone if it was approved. For a vote to be considered approved both conditions must be true:

- The percentage of `yea` out of the total number of votes is greater than or equal the 'Support required' global parameter.
- `yea` support is greater than or equal the 'Minimum acceptance quorum' global parameter.
Expand Down

0 comments on commit b916929

Please sign in to comment.