Since totalEligibleStake and totalBonus are cached and not scaled according to token balance of pool, calling claimSurvived() would revert for late callers since actual balance of pool is less than totalEligibleStake + totalBonus.
totalEligibleStake is calculated as a sum of funds recieved from each staker in the form of token balance, totalBonus is calculated based on time and amount of stake recieved. when a pool is finalized by flagOutcome() or claimExpired(), totalBonus && totalEligibleStake are logged.
Under Normal behaviour totalEligibleStake + totalBonus is always less than or equal to token balance of pool.
The issue is this assumption fails In case of rebase tokens when a rebase contraction event occurs, balance of pool address is lower than required balance for all stakers to claim stake and bonus rewards after staking period ends and outcome is set to SURVIVED. since payout is calculated based on eligibleStake + bonusShare per user, depending on the amount rebased late callers of claimSurvived() will not be able to recieve their promised rewards.
Likelihood is high:
since the variable calculation only relies on funds recieved and does not scale with actual pool balance.
since depending on the kind of rebase token contraction can be frequent and severe.
Impact is high:
since Depending on the amount left after rebase a huge chunk of stakers's funds will be lost.
add to test/unit/ConfidencePool.t.sol
scale eligibleStake, bonusShare as a percentage of pool token balance, under normal conditions this would work as expected and in rebase contraction or expansion events since they are percentages and not absolute values all funds will be distributed without fail.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.