Modify token presets "mint" function as virtual to allow extending#2257
Modify token presets "mint" function as virtual to allow extending#2257frangio merged 4 commits intoOpenZeppelin:masterfrom EvilJordan:master
Conversation
… parent contracts
|
This must have been an oversight. I believe all functions in these contracts should be virtual, like the rest of the library. @nventuro can you confirm this? |
|
Yes, indeed. I did a quick search and it seems no other contracts have their functions missing the I'd like to mention however that part of the intent behind the presets is to use them without having to modify them. If you find that you need to customize their behavior, it might be a better idea to use the preset as a basis to write your own custom code that interfaces directly with the base contracts ( |
Totally, and that's what I've done in my implementation, but had thought it strange this wasn't even an option. Thanks for the attention, and great work!! |
Discussion (one-sided at the time of this request) of this PR can be found here: https://forum.openzeppelin.com/t/erc721presetminterpauserautoid-mint-function-and-tokenid/2780/8
The preset
mintfunction is notoverride-able by parent contracts as it is not marked asvirtual. Sincemintis not part of the ERC721 or ERC20 standard, and the ability to usersuperand OZ's outstanding presets exists, why not allow for more flexibility?