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

Refactor stack and memory pointers in asm #167

Open
clearloop opened this issue Oct 27, 2023 · 0 comments
Open

Refactor stack and memory pointers in asm #167

clearloop opened this issue Oct 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@clearloop
Copy link
Member

clearloop commented Oct 27, 2023

Describe the feature

checks everywhere is actually not possible, once there is control flow in function, the stack/memory output could be unpredictable


EDITED

  • The stack output should always be the same in the output of control flows
  • A memory allocator for temporary values is required

https://docs.soliditylang.org/en/v0.8.15/assembly.html#memory-management
https://doc.rust-lang.org/reference/type-layout.html#size-and-alignment

The dispatcher

The dispatcher could be different from custom functions, bcz, for different functions, it has different return types which is hard to mock in rust, could be easier once we have the implementation of Vector, thus, we can just use Vec<u8> as the output for all functions


functions can return the count of the output on stack, and then, in the return function of the dispatcher, it returns the specified stack items

Solution

No response

@clearloop clearloop added the bug Something isn't working label Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant