chiru-labs / ERC721A

https://ERC721A.org
MIT License
2.5k stars 839 forks source link

ERC721A Contracts Classified as ERC-20 Tokens in Etherscan #454

Closed 0xfcks closed 1 year ago

0xfcks commented 1 year ago

I've been struggling to understand why Etherscan is not displaying the proper Token Holders data for a ERC721A contract inside its Token Page.

I finally recognized that Etherscan was classifying my ERC721A contract as an ERC-20 token. After reading this StackOverflow thread that seemed to suggest that my ERC721A contract does not implement the full EIP-721 interface.

When I checked the ERC721A contract against the EIP-721 interface it seems all the same functions exist but the arguments contained in ERC721A are expressed slightly different from the EIP-721 (ERC721A uses underscores _). For example,

EIP-721 balanceOf function signature: function balanceOf(address _owner) vs ERC721A balanceOf event signature: function balanceOf(address owner)

The function signatures, however, are still the same 0x70a08231.

Just wondering if any one else has had issues with this in the past.

Vectorized commented 1 year ago

See here for details on how to override supportsInterface correctly.

Returning super.supportsInterface only works if all the classes inherits from a single class (e.g. In OpenZeppelin, everything inherits from the Context class).

0xfcks commented 1 year ago

gotcha! thanks!