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

Change types and add modifier to getter #296

Merged
merged 5 commits into from
Oct 14, 2024
Merged

Conversation

andreivladbrg
Copy link
Member

@andreivladbrg andreivladbrg commented Oct 10, 2024

Closes #295

Changes

  • fix: use uint256 for scaledOngoingDebt
  • fix: add notNull in isTransferable getter
  • fix: use uint256 in depletionTimeOf

Copy link
Member

@smol-ninja smol-ninja left a comment

Choose a reason for hiding this comment

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

Good quick work on the PR.

Now since depletion time return uint256 value, we should use it as it is in tests instead of down casting it to uint40. There is no need for that.

src/SablierFlow.sol Outdated Show resolved Hide resolved
src/SablierFlow.sol Show resolved Hide resolved
tests/integration/fuzz/depletionTimeOf.t.sol Outdated Show resolved Hide resolved
@andreivladbrg andreivladbrg force-pushed the fix/types-and-getter branch 2 times, most recently from fa1b1af to 4969ae9 Compare October 11, 2024 13:28
@andreivladbrg
Copy link
Member Author

@smol-ninja While going through the code again, I realized I made some errors in the fixes and force-pushed my initial commit (your review comments might be outdated now—sorry).

These issues should have been addressed, but the changes caused some tests to break. I still need to debug that as well

fix: add notNull in isTransferable getter
fix: use uint256 in depletionTimeOf
@andreivladbrg
Copy link
Member Author

@smol-ninja just finished with the test fixes


since this finding https://cantina.xyz/code/99ae802b-f05c-4e36-a1d1-240d5146649c/findings/8 is also related to the depletionTimeOf function, and the fix is small, should we also address this in this PR

@smol-ninja
Copy link
Member

Sounds good. Took me a while to understand the context of finding. It was confusing to me.

Copy link
Member

@smol-ninja smol-ninja left a comment

Choose a reason for hiding this comment

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

src/SablierFlow.sol Show resolved Hide resolved
refactor: use uint256 for snapshot debt
@andreivladbrg
Copy link
Member Author

andreivladbrg commented Oct 12, 2024

@smol-ninja just pushed a new commit cdedfd1

@andreivladbrg andreivladbrg changed the title Change types and add modifier to getterr Change types and add modifier to getter Oct 12, 2024
Copy link
Member

@smol-ninja smol-ninja left a comment

Choose a reason for hiding this comment

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

Other than what I have mentioned below, all looks good now.

src/SablierFlow.sol Outdated Show resolved Hide resolved
tests/invariant/handlers/FlowCreateHandler.sol Outdated Show resolved Hide resolved
Copy link
Member

@smol-ninja smol-ninja left a comment

Choose a reason for hiding this comment

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

LGTM

@andreivladbrg andreivladbrg merged commit 7071368 into main Oct 14, 2024
7 checks passed
@andreivladbrg andreivladbrg deleted the fix/types-and-getter branch October 14, 2024 13:20
andreivladbrg added a commit that referenced this pull request Oct 15, 2024
* fix: use uint256 for scaledOngoingDebt

fix: add notNull in isTransferable getter
fix: use uint256 in depletionTimeOf

* test: remove undeeded down casting

* fix: use ">" in depletionTimeOf

refactor: use uint256 for snapshot debt

* address last review comments

* test: lower the rps bound range
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.

Change datatypes as per Cantina recommendation
2 participants