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

fix: unsafe casts better explained #275

Merged
merged 1 commit into from
Sep 1, 2024
Merged

Conversation

lekhovitsky
Copy link
Collaborator

@StErMi
Copy link

StErMi commented Aug 29, 2024

@lekhovitsky part of the unsafe casts / type conversions have been documented via the PR, but there are still some of them that have not been covered by a dev comment.

@lekhovitsky would you mind providing an official statement to acknowledge the remaining items to be covered?

@lekhovitsky
Copy link
Collaborator Author

@StErMi

  • block.number and block.timestamp casts are safe for sufficiently long time not to worry about it, even on chains with sub-second block times;
  • Cumulative loss logic is removed in feat: loss liquidator #280, so this line can be ignored (but cast safety follows from the assumption that underlying amounts fit into uint96);
  • uint128(newDebtInCurrentBlock) has been documented even before fixes.

@StErMi
Copy link

StErMi commented Aug 29, 2024

@lekhovitsky PR #280 cannot be considered in the context of the fix review because it is not part of the PR included in the fix review. I must consider it as not existing unfortunately.

Base automatically changed from spearbit-27-28-29-31-84-93-94 to spearbit-fixes September 1, 2024 10:31
@lekhovitsky lekhovitsky merged commit 0860422 into spearbit-fixes Sep 1, 2024
3 checks passed
@lekhovitsky lekhovitsky deleted the spearbit-9 branch September 1, 2024 10:31
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.

2 participants