-
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
Made private methods internal to allow for overriding #2027
Made private methods internal to allow for overriding #2027
Conversation
Hi all! |
Hi @MickdeGraaf. Really sorry it took so long to reply to this.
@nventuro and I have discussed this and we don't think it would be right for |
Hi @MickdeGraaf, are you interested in continuing this PR or should we pick it up? |
Thank you for pushing for this @MickdeGraaf and @asselstine! In v3.0 of OpenZeppelin Contracts, which will feature support for Solidity v0.6.x, we're planning on adding hooks on events such as token transfers and approvals. That should provide an easier extension mechanism than the current overriding of the internal functions, which can be dangerous. You can take a look at current progress and discussions in #2063. Thanks again! |
Sorry missed the conversation. Thanks for merging! The hooks sound very interesting! |
Makes private functions in ERC777 internal instead of private.
Making these methods internal allows for overriding and adding of functionality in tokens developers create.
Fixes #2047
Example usecase:
In DDAI interest needs to be claimed on every transfer.
Overriding every functoin like transfer, transferfrom, send and so on would add unnecessary complexity to the code. Thats why I override the _move function.
To prevent people from making unnecessary forks of this repo(like I did) I think its wise to make all functions internal instead of private.