huff-language / huffmate

A library of modern, hyper-optimized, and extensible Huff contracts with extensive testing and documentation built by Huff maintainers.

Home Page:https://github.com/pentagonxyz/huffmate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shouldnt the ERC721 implementation revert on `ownerOf(address(0))`?

eugenioclrc opened this issue · comments

This is a quote from eip-721

/// @notice Find the owner of an NFT
/// @param _tokenId The identifier for an NFT
/// @dev NFTs assigned to zero addresses are considered invalid, and queries
/// about them do throw.
/// @return The address of the owner of the NFT
function ownerOf(uint256 _tokenId) external view returns (address);

I dig into other implementations and see that ownerOf(address(0)) reverts;

But in the Huffmate implementation is returning always 0, shoulndt revert instead?
Please view ERC721.t.sol#L821-L824

Buttplug

Do you mean that the view function returning the owner of a given tokenId should revert when the "owner" is address zero ? If yes it seems that your are right.