# Encointer Democracy Specification III
TL;DR
- We allow an infinite amount of proposals.
- A proposal will be enacted if it is in confirmed state for long enough.
- On enactment of a proposal, all proposals of the same type get cancelled.
## Overview
### Proposal Submission
- Everyone can submit a proposal
- There can be an infinite amount of proposals
```
enum ProposalAction {
AddLocations(CommunityIdentifier, Vec<Location>),
UpdateNominalIncome(CommunityIdentifier, NominalIncomeType),
...
}
enum ProposalAccessPolicy {
Global,
Community(cid)
}
enum ProposalState {
ongoing,
confirming(since),
approved(since),
cancelled
}
struct Proposal {
start: BlockNumber,
type: ProposalAction,
state: ProposalState
accessPolicy: ProposalAccessPolicy
}
```
### Voting
- On every vote, we update the proposal state (Algorithm 1):
- check if proposal is ongoing(since) < cancel date
- if yes: cancel, return
- if no: do nothing
- check if proposal is older than lifetime
- if yes: cancel, return
- else: do nothing
- check if passing
- if yes: check if already confirming
- if yes: check if it is confirming for > confirmation period
- if yes: change state to approved
- if no: no nothing
- if no: change state to confirming with the current block number
- if no: check if already confirming:
- if yes: change to not confirming
- if no: do nothing
### Adaptive Quorum Biasing
- We dont use curves on turnout and approval like Substrate.
- In order to determine if a proposal is passing, we use AQB.
- The exact parameters are TBD and could even vary for different proposal types.
### Proposal Cancelling
- If one proposal is approved, we cancel all ongoing proposals of the same type
- We cannot loop over all proposals for performance reasons so:
- keep datastructure ProposalAction -> cancelDate
- when trying to accept check if
- ongoing(since) < cancelDate
- if true: cancel
- else enact
- on approval update cancel date to current block
### Enactment
- There is an enactment extrinsic which will enact a approved proposal if approved(since) >= cancelDate
```
fn enact_proposal(proposal: Proposal) {
match proposal.type {
ProposalAction::AddLocations(cid, locations) =>
encointer_communities::Pallet::add_locations(CommunityMasterOrigin, cid, locations),
ProposalAction::UpdateNominalIncome(cid, balance) =>
encointer_communities::Pallet::update_nominal_income(
CommunityMasterOrigin,
cid,
balance,
),
};
}
```
### Additional Extrinsics
- `update_proposal_state(proposalId)` extrinsic in order to run Algorithm 1 in case if there is no more incoming vote but the proposal state should be updated.
- `cleanup(proposalId)` deletes a proposal if it is ongoing since < cancelDate
### Naming issues
- cancelDate should be cancelBlockNumber or cancelledAt?
### Open Questions
- Can we enact in the voting call?
- Fee fairness?
- Some proposals caan only be encated at certain times?