BreadchainCoop / breadchain

2 stars 1 forks source link

Bug: `getVotingPowerForPeriod()` reverts if account's balance has changed since end of voting power calculation period #56

Closed subject026 closed 3 months ago

subject026 commented 3 months ago

To reproduce:

  1. Deploy and initialise contract
  2. Bake/burn/transfer some bread for an account
  3. Attempt to get voting power for same account

Revert reason is "Arithmic operation resulted in underflow or overflow."

RonTuretzky commented 3 months ago

If the scenario is as i'm outlining it below, what values are you calling getVotingPowerForPeriod

referencing https://github.com/BreadchainCoop/breadchain/pull/51#pullrequestreview-2126068935

sequenceDiagram 
Blockchain ->> Blockchain : Block 1
Lewis ->> YieldDisburser : Deploy
Blockchain->> Blockchain : Block 2
Lewis ->> BREAD : Mint bread for some accounts  
Blockchain->> Blockchain : Block 3
Lewis ->> YieldDisburser: call getVotingPowerForPeriod
RonTuretzky commented 3 months ago

Should be addressed with d4809e3