-
Notifications
You must be signed in to change notification settings - Fork 329
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
DO NOT REVIEW Strict Custom Types #784
Conversation
feat: types everywhere
8922bd4
to
bcacb32
Compare
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.
few comments 🤝
.unwrap() | ||
.divWad(existingShares.unwrap() + addedOwnedShares.unwrap()) | ||
.divWad(totalMagnitude); | ||
newDepositScalingFactor = existingShares.calculateNewScalingFactor( |
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.
Nice, was planning on this 👍
@@ -516,7 +516,7 @@ contract DelegationManager is | |||
operator: operator, | |||
staker: staker, | |||
strategy: strategies[i], | |||
existingShares: uint256(0).wrapShares(), | |||
existingShares: Shares(0), |
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.
Oh nice, didn't know this was valid syntax.
@@ -183,6 +183,7 @@ contract StrategyManager is | |||
IERC20 token, | |||
OwnedShares ownedShares | |||
) external onlyDelegationManager { | |||
// TODO: add Shares type to StrategyBase |
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.
Can do this if needed.
Adds custom types to SM & DM, with a focus on abstracting conversions away to the SlashingLibrary.
One item I'd like some comment on is how strict we want to be between conversions. Do we want to enforce conversion from A to B then B to C if we want to convert from A to C
We can currently do the following conversions:
Is there room for simplification here?