Closed sherlock-admin2 closed 4 months ago
2 comment(s) were left on this issue during the judging contest.
z3s commented:
Invalid; No clear impact mentioned
PNS commented:
The eETH token represents a claim on the same amount of ETH (eETH docs)
KupiaSec
medium
EETHAdapter.totalAssets() returns wrong value
Summary
EETHAdapter.totalAssets()
returns wrong value and this can affectBaseLSTAdaper.prefundedDeposit()
andTranche.issue()
.Vulnerability Detail
EETHAdapter.totalAssets()
returns the sum oftotalQueueEth
,bufferEth
andeEthBalance
.The problem is
totalQueueEth
andbufferEth
are in terms ofETH
, buteEthBalance
is in terms ofEETH
.EETH
isether.fi Staked ETH
, and the priceEETH
is not the same asETH
. 1EETH
is almost 1ETH
in most cases, but it can vary from 0.88ETH
to 1.3ETH
in some cases. As a result,EETHAdapter.totalAssets()
returns wrong value and this can affectBaseLSTAdaper.prefundedDeposit()
andTranche.issue()
.Tranche.issue()
is very important in Napier protocol so this error can affect overall workflow of Napier protocol.Impact
EETHAdapter.totalAssets()
returns wrong value andTranche.issue()
might not work as intended.Tool used
Manual Review
Code Snippet
https://github.com/sherlock-audit/2024-05-napier-update/blob/main/napier-v1/src/adapters/etherfi/EETHAdapter.sol#L129-L132
Recommendation
Get equivalent
ETH
value fromEETH
balance inEETHAdapter.totalAssets()