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

Procedurally generate packing libraries #5053

Closed
4 tasks
Amxx opened this issue May 23, 2024 · 0 comments · Fixed by #5056
Closed
4 tasks

Procedurally generate packing libraries #5053

Amxx opened this issue May 23, 2024 · 0 comments · Fixed by #5056
Labels
contracts Smart contract code.
Milestone

Comments

@Amxx
Copy link
Collaborator

Amxx commented May 23, 2024

Relevant proposals:

Goal:

  • Address the need of the users
    • need to idendify usecases
      • splitting ERC-4337 values (packed gas data, meta-nonce)
  • provide all the necessary tools in a single library (if possible)

Possible features:

  • packing/splitting an uint256/bytes32 into chunks of various sizes (128-128, 64-192, 192-64, 208-48, 32-224, 224-32, ...) ?
  • packing/splitting other types (smaller) into chunks of various sizes ?
  • packing/splitting an array of chunks of similar sizes into a bigger object (put Uint64x4 in a uint256)
  • (low level) extract arbitrary bytesXx/uintXx from a bigger object, given an offset

Question:

  • what are the type we pack/extract ? bytesXx (aligned left) or uintXxx (aligned right) ?
  • what do we want to pack them into ? bytesXx (aligned left) or uintXxx (aligned right) ?
  • do we want to split/pack more then two value at once, or do we consider composition for more complex types:
    For example: spliting a uint256 into two uint128, and then spliting one of the uint128 into two uint64 allows us to access any uint64 in the initial uint256
@Amxx Amxx added the contracts Smart contract code. label May 23, 2024
@Amxx Amxx added this to the 5.1 milestone May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Smart contract code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant