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

program: Amount Casting - Imprecision/Overflow - HAL-05 #63

Open
joncinque opened this issue Jan 13, 2025 · 0 comments
Open

program: Amount Casting - Imprecision/Overflow - HAL-05 #63

joncinque opened this issue Jan 13, 2025 · 0 comments

Comments

@joncinque
Copy link
Contributor

Recreation of solana-labs/solana-program-library#3799

Description

The amount_to_ui_amount and ui_amount_to_amount instructions take an u64 amount and f64 amount, do some arithmetic operations and cast the result to f64 and u64 respectively. When converting/casting between types, an “overflow”/wrapping or mismatch may occur and result in logic bugs.

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

No branches or pull requests

1 participant