Enable `supportsInterface(...)` from ERC165 on ERC20 contract implementation
See original GitHub issue🧐 Motivation
In the current token implementations of OpenZeppelin contracts, only the ERC721 implementation contains the supportsInterface(...)
function.
ERC20 does not contain supportsInterface(...)
by default.
I am not sure why this is the case, but my first guess would be the order that each of these ERC20 came up?
Looking at ERC721 specs, ERC165 is mentioned but not in the formal ERC20 specs.
📝 Details
Would it make sense to add supportsInterface(...)
in ERC20, and make the contract inherit from ERC165
as well? So that by default, both fungible and non-fungible tokens implementation from OZ library can be detected easily via this function?
Let me know your thoughts @frangio @Amxx and I would be happy to make a brief PR if this feature request is accepted.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (3 by maintainers)
@Amxx This would be a good start to make it a “best practice” to include supportsInterface into ERC20 if OZ does it.
I honestly would also include erc223 too
Yea, I would like to see an EIP-1363 implementation, but a new issue should be created for that.