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

Align number implementations to 256 bits #20

Closed
clearloop opened this issue Jul 7, 2023 · 1 comment
Closed

Align number implementations to 256 bits #20

clearloop opened this issue Jul 7, 2023 · 1 comment

Comments

@clearloop
Copy link
Member

clearloop commented Jul 7, 2023

Describe the feature

we only can do static type checks while compiling since the stack item of solidity is 256 bits, so whatever optimize the types or not doesn't matter to EVM, but still needs these types

  • i128
  • u128
  • i256
  • u256

Solution

Need an external library to implement these, mb defined in zink/numbers


for u256 operations, we can use host functions like ("zink", "u256_add"), etc, do it in EVM for saving space in WASM:

  • u256::Zero -> ("zink", "u256_zero")
@clearloop
Copy link
Member Author

in favor of #156

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 a pull request may close this issue.

1 participant