The ability to deposit one of the two LST's (stEth and rETH) and withdraw the other leads to various problems which can affect user’s funds and user’s experience while using the protocol.
This issue generates the following possibilities:
A. Accidental (or not) withdrawals of a different LST will cause "ERC20: transfer amount exceeds balance"
errors for people who want to withdraw the same asset they deposited.
In the example below, Chandler deposited stEth, Ross deposited rETH, Chandler mistakenly withdrew rETH forcing Ross to either withdraw stEth or getting an error when he tries to withdraw rETH.
A more intricate case of this happens when Chandler withdraws a mix of LST's. In this case when Ross would try to withdraw he’d need to withdraw the exact proportion of rETH/stETH available. For example if Chandler withdraws 25% rETH and 75% stETH then Ross needs to withdraw 75% rETH and 25% stETH or he’ll get the "ERC20: transfer amount exceeds balance" error. Same thing applies if Chandler withdraws only a partial amount, using the token different than the one he deposited;
B. The issue could be exploited by a malicious actor through sandwiching any deposit of rETH/stETH depending on the arbitrage possibility between the two tokens (obviously taking into account the Withdrawal Fees in the profitability calculation).
Forge testing
Fixing this issue requires some extreme measures:
Limit the number of LST used to 1, either stETH or rETH, and if someone wants to use the token that’s not directly accepted by the protocol facilitate the conversion by interacting with curve making a big disclaimer that everything gets converted to stETH (if this is the accepted LST) and only that can be withdrawn. This is not ideal because it limits the users flexibility.
Keep a record of who deposited what LST. This would imply a major refactoring of the codebase, introducing a lot of complexity especially around yield tracking.
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.