-
Notifications
You must be signed in to change notification settings - Fork 56
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
use ERC20_MAIN macro #99
Conversation
Hey frenz, thanks for working on this one. tbh I'm not 100% sure whats going on. Looks like were removing some macro calls because they already exist in the parent or smthg? i dont get this comment:
I dont see that change to jump here? Also it looks like @MathisGD is on this so I'll let you guys finish this up, lemme know if I can help. |
Yeah, thanks! I was thinking that was why the function dispatching part of the erc20 main was copied into the Wrapping contract. But under the hood like @MathisGD said, it would look the same way and is more of a preference stuff. The original pr I wanted to make was Changing the jumpi to jump to enable all this |
i see. so can this pr be closed now? or whats the path forward? |
I still think that it is better not to have the code duplication. |
Agree - @MathisGD So all good to merge this? |
I would have harmonized the two contracts (#99 (comment)) but that's not a big deal |
Is the current commit okay? |
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.
ye haw
Changing
no-match jumpi
tono-match jump
in ERC20.huff function dispatcher leaves the shifted function sig on the stack for contracts inheriting it which can use it after theno-match
JUMPDEST. This way, importing (wrapping) contracts only have to add:to the start of their MAIN() macro then add their specific function below it rather than copying all of ERC20.huff dispatch macro.