BreadchainCoop / breadchain

2 stars 1 forks source link

Feature: Receiving/storing votes as points rather than percentages #29

Closed subject026 closed 5 months ago

subject026 commented 5 months ago

We're allowing users to define the split they want with point values for each project eg:

Project A - 1 points -> 25% Project B - 2 points -> 50% Project C - 1 points -> 25%

Currently we're requiring votes to be submitted as percentages meaning these points need be converted to % on the front-end before sending the tx.

We want to allow users to change/update their vote anytime before the next disbursement so we'd need to convert the % back into points on the front-end. This wouldn't actually be possible in some cases because of the rounding that would need to happen to convert certain combinations of points to %.

The best approach IMO would be to just store the user's vote as points and convert them in the contract when necessary.

Because of the rounding that will need to happen we can look at using using permyriad (/10000) rather than percent so we can allocate the remainder without having as much of an impact on the amounts paid out.

We could consider distributing based just on the rounded values and leave the small amount of bread left over from the remainders in the pot for the next disbursement.

subject026 commented 5 months ago

@RonTuretzky I know we discussed this a bit last week but I'm not sure whether what you have in mind would solve the problem when someone wants to change their vote.

RonTuretzky commented 5 months ago

@subject026 Begining to implement this