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

perf: dry "isCold" and "isWarm" #664

Merged
merged 1 commit into from
Aug 23, 2023
Merged

perf: dry "isCold" and "isWarm" #664

merged 1 commit into from
Aug 23, 2023

Conversation

PaulRBerg
Copy link
Member

Closes #610

@smol-ninja
Copy link
Member

Why would you move only "isWarm" and "isCold" up the hierarchy? Why not other functions such as "isDepleted" as well?

@PaulRBerg
Copy link
Member Author

@smol-ninja because only isWarm and isCold can be moved upstream in the abstract contract.

Most other functions, including isDepleted, interact with the LockupLinear.Stream and LockupDynamic.Stream structs. And this means that the implementations cannot be de-duplicated.

Related: Solidity does not have anything similar to Rust traits.

Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@PaulRBerg PaulRBerg merged commit 75c76f8 into main Aug 23, 2023
@PaulRBerg PaulRBerg deleted the refactor/dry-functions branch August 29, 2023 11:53
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

Successfully merging this pull request may close these issues.

Move "isWarm" and "isCold" to "SablierV2Lockup"
3 participants