StabilityPool::calculateRaacRewards() assumes same decimals for RToken and DEToken
When computing the amount of DEToken to mint based on the RToken amount, we use the following code:
The code clearly expects cases where the DEToken and the RToken decimals differ. The issue is that upon computing rewards, we have the following function:
userDeposits is increased by the RToken provided upon deposits. This means that userDeposit and totalDeposits are different token amounts as totalDeposits is the supply of DEToken. If the decimals differ which is a handled and expected case in the code, then the calculations will be incorrect as userDeposit might be with 6 decimals while totalDeposits can be in 18 decimals.
Users will receive a lot less rewards or a lot more rewards depending on which token has more decimals
Manual Review
Normalize the decimals
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.