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 packing layerId into ERC721A _extraData #4

Open
emo-eth opened this issue Sep 22, 2022 · 0 comments
Open

Explore packing layerId into ERC721A _extraData #4

emo-eth opened this issue Sep 22, 2022 · 0 comments

Comments

@emo-eth
Copy link
Owner

emo-eth commented Sep 22, 2022

We should always store layerId for base tokens upon binding, since they may be re-bound or rearranged, and the extra 100-200 gas to read the extraData from warm ownership slot is going to be cheaper than the layer seed calculation + lookup.

Since layer tokens are burned upon being bound, they should not store their layerId during the binding process.

It may be worth looking into calculating+storing the layerId for any token when transferring. The ownership/extraData storage slot will already be warm, but calculating will add at least 5000 gas on first transfer after reveal in worst cases (max 2 SLOADs for packed distributions, plus all comparison and calculation overhead - unsure on specific gas usage).

Minimizing gas usage during binding+arranging for end-user experience may be worth the added gas overhead during transfer - but a better gas analysis should be done.

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

No branches or pull requests

1 participant