The StabilityPool
contract allows users to stake RToken
and receive DEToken
. Stakers earn RaacToken
rewards, which are minted by RaacMinter
. However, there are two critical issues in the reward mechanism:
Total Supply Inflation: The reward calculation tracks deToken.totalSupply()
, which can be artificially inflated if DEToken
had existing tokens before being used in this protocol.
Repeated Withdrawal Exploit: A user can repeatedly withdraw small amounts to claim rewards multiple times, leading to an unfair advantage.
The function calculateRaacRewards
uses deToken.totalSupply()
to distribute rewards.
If DEToken
had an initial balance before being used in this contract, it artificially increases totalSupply
, leading to incorrect reward calculations.
This results in fewer rewards per user, creating an unfair distribution.
The withdraw
function calls calculateRaacRewards
.
A user can repeatedly withdraw small amounts and continuously receive rewards as if they still had the full deposit.
This effectively allows them to drain the reward pool unfairly.
A user deposits 100 RToken
.
They withdraw 1 RToken
and receive rewards based on the full 100 deposit.
They repeat this for every 1 RToken
withdrawn, receiving rewards multiple times.
This depletes the reward pool, leaving less rewards for other users.
Unfair Reward Distribution: Some users can claim more rewards than they should.
Denial of Service (DoS): If a user drains most of the rewards, others may be unable to withdraw their funds due to lack of incentives.
Manual Review
Instead of relying on deToken.totalSupply()
, track each user’s earned rewards separately to avoid manipulation.
Ensure users can only claim rewards once per eligible deposit instead of multiple times.
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.