Submitted by WatchPug, also found by cmichel.
The formula of the number of prizes for a degree per the document: https://v4.docs.pooltogether.com/protocol/concepts/prize-distribution/#splitting-the-prizes is:
Should be changed to:
or
Per the document:
Due to the miscalculation of number of prizes for a degree, it will be smaller than expected, as a result, prize for a degree will be larger than expected. Making the protocol giving out more prizes than designed.
Because 2^x = 1 << x
Therefore, when n > 0:
QED.
By definition, degree n is constructed by 3 chunks:
Therefore, total numberOfPrizesForDegree will be:
QED.
https://github.com/pooltogether/v4-core/blob/055335bf9b09e3f4bbe11a788710dd04d827bf37/contracts/DrawCalculator.sol#L423-L431
L423-431 should change to:
BTW, the comment on L416 is wrong:
PierrickGT (PoolTogether) confirmed and patched:
Alex the Entreprenerd (judge) commented:
