The StabilityPool::calculateRaacRewards calculates rewards using mismatched token bases. The contract incorrectly mixes userDeposits[user] that represents the user rToken deposit amounts with deToken.totalSupply values that represents the total supply of deToken. These values are used directly in a division without accounting for their different bases. This leads users to receive significantly more or fewer rewards than intended, depending on decimal differences.
Consider this scenario:
User A deposits 100 rToken (18 decimals) -> gets 100 deToken (6 decimals)
userDeposits[A] = 100 * 1e18
deToken.totalSupply() = 100 * 1e6
Reward Calculation:
totalRewards = 1000 RAAC
User A rewards = (1000 * (100 * 1e18)) / (100 * 1e6) = 1000 * 1e12 RAAC
User gets 1000x more rewards than intended
Users can receive significantly more or fewer rewards than intended, depending on decimal differences. Early depositors could drain the reward pool by receiving outsized rewards.
Manual review
Use the same token base (rToken) for both the numerator and denominator.
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.