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

Add library generator to resolve struct member pointers #3

Open
d1ll0n opened this issue Dec 7, 2022 · 0 comments
Open

Add library generator to resolve struct member pointers #3

d1ll0n opened this issue Dec 7, 2022 · 0 comments
Labels
good first issue Good for newcomers

Comments

@d1ll0n
Copy link
Owner

d1ll0n commented Dec 7, 2022

example:

struct Data {
  uint256 a;
  uint256[] arr;
}
library DataPointers {
  function Data_a_pointer(MemoryPointer mPtr) internal pure returns (MemoryPointer aPtr) {
     aPtr =  mPtr;
  }
  function Data_a_pointer(CalldataPointer mPtr) internal pure returns (CalldataPointer aPtr) {
      aPtr = mPtr;
   }
  function Data_arr_pointer(MemoryPointer mPtr) internal pure returns (MemoryPointer arrPtr) {
      arrPtr = mPtr.pptr(32);
  }
  function Data_arr_pointer(CalldataPointer mPtr) internal pure returns (CalldataPointer arrPtr) {
      arrPtr = mPtr.pptr(32);
  }
}
@d1ll0n d1ll0n added the good first issue Good for newcomers label Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant