When veRAAC token holders lock differing amounts, the fee distribution calculation may round down the reward share of users with relatively low voting power to zero. As a consequence, users who lock only a small number of tokens receive no claimable rewards even when new fees have been distributed while users with large locks receive almost all of the rewards.
FeeCollector’s reward claim logic depends on the pending reward,
computed as follows:
pendingReward = share – userRewards[user]
where share = (totalDistributed * userVotingPower) / totalVotingPower
as shown below
Take for instance the following scenario:
Alice (user1) locks 1 ether
for 365 days which gives her
a voting power of 2.5*10^17
Bob (user2) locks 20000 wei
for 365 days which gives him
a voting power of 5000
Total Voting Power is computed as:
totalVotingPower
=
When rewards are distributed, FeeCollector
calculates shares as follows:
For Alice :
share_alice
=
Because her voting power is almost the entirety of the total, this share comes out nearly equal to totalDistributed
.
For Bob:
share_bob
=
Even if totalDistributed
is a significant number, multiplying by 5000 and then divided by approximately 2.5*10^17
, using integer division which truncates decimals results in share_bob
rounding down to 0.
Alice, with her large voting power, receives close to the entire proportion of the distributed rewards.
As a result, when Bob calls claimRewards, his pending reward is calculated as zero. Even if rewards are later distributed, the proportional amount due to his lock remains too small,
and thus he receives nothing.
See how to integrate foundry to hardhat project
. Create a new file POC.t.sol
in project /test/
folder . Paste the poc and run forge test --mt test_POC
Users with small veRAAC balances will see their computed share rounded to zero, meaning they will never be able to claim a reward when distributed
Manual Review
Consider normalizing the voting power values so that even low-value voters have a meaningful contribution in the division.
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.