-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StrategyBase.explanation()
cannot be overridden to intended mutability
#453
Comments
0xSorryNotSorry marked the issue as primary issue |
Sidu28 marked the issue as sponsor disputed |
This was already reported in the Consensys Diligence audit that is linked in the contest's README: https://consensys.net/diligence/audits/2023/03/eigenlabs-eigenlayer/#strategybase--inheritance-related-issues |
Would be a Refactoring at best, closing as Known |
GalloDaSballo marked the issue as unsatisfactory: |
|
GalloDaSballo changed the severity to QA (Quality Assurance) |
Low |
GalloDaSballo marked the issue as grade-a |
After awaring the 2 QAs and the other finding, am raising to A for the high quality descriptions |
Lines of code
https://github.com/code-423n4/2023-04-eigenlayer/blob/5e4872358cd2bda1936c29f460ece2308af4def6/src/contracts/strategies/StrategyBase.sol#L158-L164
Vulnerability details
Impact
An implementation of
explanation()
, as inherited fromStrategyBase.sol
, cannot (possibly contrary to intentions) make state modifications. This implies thatStrategyBase.sol
may become useless as the intended base contract to inherit from.Proof of Concept
StrategyBase.sol
"is designed to be inherited by more complex strategies, which can then override its functions as necessary".Its function
explanation()
is declared aspure
:This means that any inheriting contract overriding this function also must be
pure
. However, an implementation might need a mutability of at leastview
. This is suggested by it's being declaredview
inIStrategy.sol
. For example, the explanation of the strategy might want to incorporate the value of some variable in the strategy, rather than just being an immutable string.There is a similar issue with
sharesToUnderlying()
andunderlyingToShares()
, both reported separately.Recommended Mitigation Steps
Declare
explanation()
as the default nonpayable.Assessed type
Context
The text was updated successfully, but these errors were encountered: