zink icon indicating copy to clipboard operation
zink copied to clipboard

Refactor stack and memory pointers in asm

Open clearloop opened this issue 8 months ago • 0 comments

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 avatar Oct 27 '23 21:10 clearloop