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

Keep a mapping of templates with the template hash as the key #122

Open
edmundedgar opened this issue Sep 22, 2023 · 1 comment
Open

Keep a mapping of templates with the template hash as the key #122

edmundedgar opened this issue Sep 22, 2023 · 1 comment

Comments

@edmundedgar
Copy link
Contributor

We store the hash of new templates in template_hashes which maps template ID to its content.

We should probably have done this the other way around, stored the template hash against the template ID and added a check to make sure the templates are unique, either erroring out if they're not or just returning the existing template ID. This would make it easier to get the ID of a template automatically instead of having to worry about managing different template IDs on different chains.

Consider either adding an additional mapping or checking how much the current mapping is used, and replacing it if we don't need it.

@edmundedgar edmundedgar added the v4 likely contract version 4 feature label Jan 25, 2024
@edmundedgar edmundedgar added v5 and removed v3.1 v4 likely contract version 4 feature labels Feb 1, 2024
@edmundedgar
Copy link
Contributor Author

This turns out to be a little bit hairy because our templates start at 0 which makes checking them in a mapping slightly complicated. Booting it to v5, we may do a separate template manager contract while we're at it.

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

No branches or pull requests

1 participant