Made private methods internal to allow for overriding#2027
Made private methods internal to allow for overriding#2027nventuro merged 6 commits intoOpenZeppelin:masterfrom
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.