Users depositing rebase tokens will lose points and funds
Summary
Usage of rebase tokens will lead to lost points and funds.
Vulnerability Detail
A user can deposit rebase tokens likestETH and eETH into SophonFarming.sol using the deposit* functions. We will be focussing on stETH in this report but the same applies to eETH.
stETH is a transferable rebasing utility token representing a share of the total ETH staked
through the protocol, which consists of user deposits and staking rewards.
Because stETH rebases daily, it communicates the position of the share daily.
The mechanism which updates the stETH balances every day is called a “rebase”.
Every day at 12PM UTC the amount of stETH in your address will increase with the current APR.
stETH is a rebase token, which means that overtime, the balance of a user increases with the current APR.
This is a problem in the current iteration of the project.
Impact
Alice deposits 1000e18 stETH for 30 days to earn points.
During these 30 days, Alice will only earn points on the initial deposited 1000e18 stETH, even though that the 1000e18 stETH has increased over the 30 days.
Furthermore, when Alice decides to withdraw, she will only be able to withdraw 1000e18 stETH, even though her initial deposit has increased due to the rebases during the 30 days.
bronze_pickaxe
medium
Users depositing rebase tokens will lose points and funds
Summary
Usage of rebase tokens will lead to lost points and funds.
Vulnerability Detail
A user can deposit rebase tokens like
stETH
andeETH
intoSophonFarming.sol
using thedeposit*
functions. We will be focussing onstETH
in this report but the same applies toeETH
.A user can deposit
stETH
usingdepositStEth()
: SophonFarming.sol#L473-L481)As per the Lido docs:
stETH
is a rebase token, which means that overtime, the balance of a user increases with the current APR. This is a problem in the current iteration of the project.Impact
1000e18 stETH
for 30 days to earn points.1000e18 stETH
, even though that the1000e18 stETH
has increased over the 30 days.1000e18 stETH
, even though her initial deposit has increased due to the rebases during the 30 days.Note that the same applies to the usage of
eETH
.Code Snippet
Tool used
Manual Review
Recommendation
Handle rebase tokens differently or don't use them at all.