Skip to content
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

StakeRegistry.modifyStrategyParams does NOT enforce the same conditions on multipliers enforced by addStrategies #128

Closed
wadealexc opened this issue Dec 29, 2023 · 2 comments
Assignees

Comments

@wadealexc
Copy link
Collaborator

_addStrategyParams requires that multipliers are nonzero:

require(
_strategyParams[i].multiplier > 0,
"StakeRegistry._addStrategyParams: cannot add strategy with zero weight"
);

modifyStrategyParams does not have this check:

for (uint256 i = 0; i < numStrats; i++) {
// Change the strategy's associated multiplier
_strategyParams[strategyIndices[i]].multiplier = newMultipliers[i];
emit StrategyMultiplierUpdated(quorumNumber, _strategyParams[strategyIndices[i]].strategy, newMultipliers[i]);
}

Not a huge deal, but something we should consider changing for consistency.

@wadealexc wadealexc self-assigned this Dec 29, 2023
@ChaoticWalrus
Copy link
Contributor

My thoughts here:
I think this inconsistency is likely acceptable, but I do have a preference for consistency in general.
In this particular instance, I can see reducing a strategy multiplier to zero as perhaps a temporary measure / taken instead of removing a strategy from the list (e.g. in the case of an apparent infinite mint bug in the underlying token), while I don't see any case in which you would want to add a strategy with zero multiplier. However, it does feel like the correct action would be to remove the strategy from consideration, rather than reducing its multiplier to zero :|
I'm cool with adding the check to the modifyStrategyParams function -- maybe the revert message could just helpfully instruct to use the removeStrategies (or whatever its called) function instead?

@wadealexc
Copy link
Collaborator Author

closing this as it's low prio and i dont have time to address it before audits start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants