-
Notifications
You must be signed in to change notification settings - Fork 442
feat(draft): preview slashOperator
shares + underlying slashed
#1624
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have this target a release branch too
_isOperatorRedistributable(operator, registeredSets) || _isOperatorRedistributable(operator, allocatedSets); | ||
} | ||
|
||
/// @inheritdoc IAllocationManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much space do we have left?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-180 bytes rip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will sort this out as well
uint256 wadToSlash | ||
) public view returns (uint256 shares) { | ||
// Fetch operator's allocation details. | ||
Allocation memory allocation = getAllocation(operator, operatorSet, strategy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should make an internal function that does this logic and is called by this function as well as slashOperator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, will sort that out once my fn is sound.
uint64 maxMagnitude = getMaxMagnitude(operator, strategy); | ||
uint64 slashedMagnitude = uint64(uint256(allocation.currentMagnitude).mulWadRoundUp(wadToSlash)); | ||
uint64 newMaxMagnitude = maxMagnitude - slashedMagnitude; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to also include shares that are being deallocated
Motivation:
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications:
Describe the modifications you've done.
Result:
After your change, what will change.