-
Notifications
You must be signed in to change notification settings - Fork 2
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
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.
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.
tests/integration/concrete/depletion-time-of/depletionTimeOf.t.sol
Outdated
Show resolved
Hide resolved
fa1b1af
to
4969ae9
Compare
@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
4969ae9
to
703b9ec
Compare
@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 |
Sounds good. Took me a while to understand the context of finding. It was confusing to me. |
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.
- As we discussed over slack, given that
snapshotDebt
has its own slot, are you not considering usinguint256
for it, so as to avoid downcasting while storing to it? - Lets include https://cantina.xyz/code/99ae802b-f05c-4e36-a1d1-240d5146649c/findings/8 in this PR as well.
refactor: use uint256 for snapshot debt
@smol-ninja just pushed a new commit cdedfd1 |
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.
Other than what I have mentioned below, all looks good now.
tests/integration/concrete/depletion-time-of/depletionTimeOf.tree
Outdated
Show resolved
Hide resolved
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.
* 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
Closes #295
Changes