The withdraw function is as follow -
moreover _update(), calls _mintRAACRewards()
, which in turn mints RAAC tokens to stability pool, which shouldn't be done.
Whenever user deposits RTokens in StabilityPool.sol
, _update()
is called too, means RAAC gets minted to stability pool.
These RAACs will be used to pay raac rewards; when user withdraws from stability pool.
But in current implementation additional RAACs is being minted to stability pool, when withdraw function is hit.
which is unnecessary, as this part is already done in deposit function.
Why it's problematic ?
when user hits withdraw function, the raac reward for user is calculated via -
As we can see, the return value is directly proportional to totalRewards (raac balance of stabilty pool).
so, user reward will be high if raac balance of stability pool is high.
User is getting more raac rewards than requirement.
Manual
If it's withdraw function no need to mint additional raacs to stability pool.
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.