Hunter - deposit()
in DepositWrapper
causes multiple reverts to due unhandled conversion of stETH
to wstETH
#272
Labels
Non-Reward
This issue will not receive a payout
Sponsor Disputed
The sponsor disputed this issue's validity
Hunter
High
deposit()
inDepositWrapper
causes multiple reverts to due unhandled conversion ofstETH
towstETH
Summary
the function
deposit()
inDepositWrapper
is supposed to make users life easier to convert their tokens towstETH
but in fact it causes multiple reverts to due unhandled conversion ofstETH
towstETH
Vulnerability Detail
in
DepositWrapper
contract there is a function calleddeposit
that lets the users deposit to the vault of wstETH with tokens like (ETH, wETH,wstETH)but the problem lies in the fact that the function
deposit
handles the conversion betweenstETH
towstETH
in a wrong way and leads to multiple reverts, lets see howin Line #55 we check if
token
of thedeposit
isstETH
then we transfer the amount specified to the contract then we call_stethToWsteth()
function the problem here is that_stethToWsteth()
withamount
input of the userat
_stethToWsteth()
we just call
wrap
at Line #37 but the problem is that we are calling it withamount
provided indeposit
that our contract now holds 1 to 2 wei less than itImpact
High, this contract is supposed to make user interactions easier but in fact it produces harm, funds loss(on gas) and large user inconvenience
Code Snippet
deposit()
https://github.com/sherlock-audit/2024-06-mellow/blob/26aa0445ec405a4ad637bddeeedec4efe1eba8d2/mellow-lrt/src/utils/DepositWrapper.sol#L42-L75_stethToWsteth()
https://github.com/sherlock-audit/2024-06-mellow/blob/26aa0445ec405a4ad637bddeeedec4efe1eba8d2/mellow-lrt/src/utils/DepositWrapper.sol#L35-L39Tool used
Manual Review
Recommendation
Duplicate of #299
The text was updated successfully, but these errors were encountered: