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

Explore generic pointers for different data locations #206

Open
vdrg opened this issue Sep 25, 2023 · 0 comments
Open

Explore generic pointers for different data locations #206

vdrg opened this issue Sep 25, 2023 · 0 comments

Comments

@vdrg
Copy link
Contributor

vdrg commented Sep 25, 2023

We could support generic pointers that could point to memory, calldata, code and others. This could be done by using a single byte to store the pointer type, and load the value into memory differently depending on the type (inside the asBytes, and the other asX functions). The only problem would be storage pointers, as we would need the whole 32 bytes to represent it... maybe we could do it in some other hacky way.

See @jtriley-eth 's https://github.com/jtriley-eth/smart-types/tree/main/src/ptr for how loading from different locations could work (our implementation would be different though, as we would have a single Pointer custom type).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant