-
Notifications
You must be signed in to change notification settings - Fork 2
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 ERC20 Premints #48
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
5828068
to
a4b4688
Compare
a4b4688
to
802cbaf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why so much of this needed to be macros?
I tried going with generics first, but couldn't make it work. The underlying problem is that even though there is strong overlap between the two premints, it's hard to express that in generics. I was going with a generic shared zora premint type (similarly to what we have in the python version), but then ended up having to implement all data access through traits, which i then would need to implement for all new types. Also needed to put generic bounds all over the place, which to be honest I found much harder on the eyse than the macro. So I figured it's easier to just macro everything, since the function and field names are all the same, so it's basically copy&paste territory (for now). If alloy supports aliasing types in the sol macro at some point we could come back and consolidate this a little more outside of the macros. |
b0dd34e
to
b482c1f
Compare
Needed to use macros for a lot of things. The main problem is that we need to use separate namespaces for V2 and ERC20 ABI types, because we need to tweak the abi.json and change the names of some types. That's required for signatures to work correctly, but they can't both have the same names.
Experimented with a generic based solution, but ultimately went for the macros because of that.