-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
ERC20 simplification with allowing _transfer() to perform _mint() and _burn() functionalities #3109
Conversation
… _burn() functionalities
Hello @k06a I'm really not confortable with this change. In particular, it would allow a dev to call Can you give more details about your usecase ? I was not here when the decision was taken, but having the mint & burn be separate function from transfer is helping with multiple things:
|
@Amxx I see, but this issue could be solved by moving totalSupply modification into the _transfer method. Your points makes sense for me, but what about extracting such a private |
Having an additional What about leaving everything as now, and adding a |
@Amxx this would work and can be introduced as an extension. But I was thinking about reducing code size of the existing solution. |
I'm more concerned by the gas cost of executing transactions then by the cost of deployment. Maybe we should produce number to check the impact of such a change on both |
I agree that both gas impacts are important. |
I'd like to see the numbers but I believe the bytecode size impact could be significant, and the runtime cost impact may be negligible. The additional cost contains no storage reads or writes as far as I can tell, it's just stack operations and jumps. I think we have to consider this improvement, and a similar strategy could be valuable in other contracts.
|
We are probably going to move forward with this in 5.0 along with the removal of before and after hooks (replaced with "simple" overriding of |
Let's discuss this opportunity to minimize ERC20 source code.
PR Checklist