-
Notifications
You must be signed in to change notification settings - Fork 977
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
New locker lib: unpacks length and nonzeroDeltaCount #388
Conversation
uint256 slot = NONZERO_DELTA_COUNT; | ||
assembly { | ||
let count := tload(slot) | ||
count := sub(count, 1) |
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.
Do you think its worth catching the underflow here?
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.
No because we only call this if we've incremented prior so I think its ok and its an internal function
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.
Couple of things but i love this change with them separated!
|
||
/// @notice This is a temporary library that allows us to use transient storage (tstore/tload) | ||
/// for the lockers array and nonzero delta count. | ||
library Lockers { |
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.
Would be great to see some tests for this library!
Related Issue
Which issue does this pull request resolve?
Description of changes