daostack / infra

GNU General Public License v3.0
25 stars 22 forks source link

rounding error when calculating winning votes #67

Closed jellegerbrandy closed 5 years ago

jellegerbrandy commented 5 years ago

So this is a proposal state (from the subgraph running test):

{
  "data": {
    "proposal": {
      "dao": {
        "name": "Nefarious Soaper",
        "nativeReputation": {
          "totalSupply": "5910798000000000000000"
        }
      },
      "executionState": "None",
      "queuedVoteRequiredPercentage": "50",
      "stage": "Queued",
      "votesAgainst": "0",
      "votesFor": "2960100000000000000000"
    }
  }
}

what you would expect: that this proposal would pass and be executed, because more than 50% of the total reputation votes FOR:

2960100000000000000000 / 5910798000000000000000
0.5007953240831441

what actually happens

???

orenyodfat commented 5 years ago

looks more like subgraph or not an issue at all . as it might be that the total supply of the dao does not reflect the value at the moment of voting.