Open c4-bot-9 opened 4 weeks ago
The OperatorDelegator.getTokenBalanceFromStrategy() incorrectly uses address(this) to check for the queued amount instead of address(token).
OperatorDelegator.getTokenBalanceFromStrategy()
address(this)
address(token)
address(this) will always return 0, which means that queuedShares[address(token)] will not be accounted for.
0
queuedShares[address(token)]
This mitigation proposes the usage of address(token) instead of address(this):
- queuedShares[address(this)] == 0 + queuedShares[address(token)] == 0
This mitigation succesfully mitigates the original issue. The address of the token is used, which will succesfully get the underlying token amount from the amount of shares + queued withdrawal shares.
n/a
LGTM
alcueca marked the issue as satisfactory
Lines of code
Vulnerability details
Original Issue Summary
The
OperatorDelegator.getTokenBalanceFromStrategy()
incorrectly usesaddress(this)
to check for the queued amount instead ofaddress(token)
.address(this)
will always return0
, which means thatqueuedShares[address(token)]
will not be accounted for.Mitigation
This mitigation proposes the usage of
address(token)
instead ofaddress(this)
:Comments
This mitigation succesfully mitigates the original issue. The address of the token is used, which will succesfully get the underlying token amount from the amount of shares + queued withdrawal shares.
Suggestion
n/a
Conclusion
LGTM