Submitted by RadiantLabs
The StRSR contract implements an era-based wrapping of the stakeRate and draftRate exchange rates whenever these pass the maximum accepted value of MAX_STAKE_RATE and MAX_DRAFT_RATE; the effect of this action is that StRSR token holders see their balance reset (stakeRate reset) and/or all StRSR vesting withdraws are forgotten and the relative funds lost (draftRate reset).
From the code below, we can see that these two rates can be reset independently;
 and wed then argue that they will most likely happen at different times, at the very least because rewards contribute to the evolution of stakeRate only.
In the event only one of the two rates reaches the cap and undergoes a reset, stakers can dodge the bullet of collectivized losses, by:
Users can avoid the collectivization of rate wrapping losses, and artificially get a share of any RSR left in the StRSR contract.
This latter quantity may be considerable, because while unlikely, its not impossible that the rate wrapping happens when little RSR is seized from an otherwise large RSR balance in the StRSR contract.
Alice is an StRSR token holder:
A similar sequence can be performed to avoid losses on funds that are being unstaked by instead calling cancelUnstake first and unstake later.
Code review, Foundry
Consider wrapping both rates when at least one reaches the maximum.
tbrent (Reserve) acknowledged and commented:
cccz (judge) decreased severity to Low
3docSec (warden) commented:
tbrent (Reserve) commented:
cccz (judge) increased severity to Medium and commented:
Reserve mitigated
Status: Mitigation confirmed. Full details in reports from ether_sky and Bauchibred.
