Comments (2)
Here's the result of the votings structure brainstorm:
1. vote() O(1)
vote: (voting_id, address) -> stake_in_favor, stake_against
voting_result: voting_id -> stake_in_favor, stake_against
voters: voting_id -> OrderedCollection(Address)
votings: voting_id -> Voting(konfiguracja...)
2. finish_voting() O(n)
stake = stake_in_favor + stake_against
if (quorum < voters.len())
for addresses in voters:
if (address = creator):
token.burn(self.address, address.stake_in_favor)
else:
token.transfer(address, address.stake_in_favor + address.stake_against)
return;
if (stake_in_favor > stake_against)
for addresss in voters:
to_transfer := (address.stake_in_favor / stake_in_favor) * stake // czy jakoś tak, to się sprawdzi
if (to_transfer > 0)
token.transfer(address,to_transfer)
do_the_action(voting) // wykonaj akcję przypisaną do głosowania
else
for addresss in voters:
to_transfer := (address.stake_against / stake_against) * stake // czy jakoś tak, to się sprawdzi
if (to_transfer > 0)
token.transfer(address,to_transfer)
from dao-contracts.
Done.
from dao-contracts.
Related Issues (20)
- VariableRepo Contract HOT 1
- All variables and Gherkin tests.
- Remove hardcoded ids from test steps
- Update JS generic client.
- Deployment script.
- Admin Contract HOT 1
- KYC Contract Skeleton HOT 1
- Complex Mappings. HOT 1
- Use dao-erc20 in reputation. HOT 1
- Write documentation for Variable Repository and Repo Voter.
- Implement Admin contract. HOT 1
- Document Admin contract. HOT 1
- E2E test.
- Update types.
- Update docs.
- Split `dao_nft` into `kyc_nft` and `va_nft`. HOT 1
- Make sure only VA can create votings unless spec otherwise.
- BidEscrow Tracking Issue.
- `final` version tracking issue.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dao-contracts.