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

feat: u256 support #111

Open
tdelabro opened this issue Jan 20, 2025 · 0 comments
Open

feat: u256 support #111

tdelabro opened this issue Jan 20, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@tdelabro
Copy link
Collaborator

tdelabro commented Jan 20, 2025

Feature Request

Describe the Feature Request

Support for u256

Describe Preferred Solution

I would like for this lib to expose a U256 type, made of two felts, low and high.

pub struct U256 {
  low: Felt,
  high: Felt,
}
  • lot of quality of like conversion methods: From, FromStr, From<(u128, u128)>, TryInto, TryInto<[Felt, 2]> and so on

Alternative Solution

Some more efficient internal representation, but keeping the ability transform from/to two felts when the need arise

Related Code

I have to use https://docs.rs/starknet/0.13.0/starknet/core/types/struct.U256.html instead. Which doesn't do a great job. So I instead have to handle tupples or custom structs to do this

@tdelabro tdelabro added the enhancement New feature or request label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant