huff-language / huffmate

A library of modern, hyper-optimized, and extensible Huff contracts with extensive testing and documentation built by Huff maintainers.
https://github.com/pentagonxyz/huffmate
MIT License
430 stars 55 forks source link

Shouldnt the ERC721 implementation revert on `balanceOf(address(0))`? #124

Closed eugenioclrc closed 10 months ago

eugenioclrc commented 1 year ago

This is a quote from eip-721

/// @notice Count all NFTs assigned to an owner /// @dev NFTs assigned to the zero address are considered invalid, and this /// function throws for queries about the zero address. /// @param _owner An address for whom to query the balance /// @return The number of NFTs owned by _owner, possibly zero function balanceOf(address _owner) external view returns (uint256);

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

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

Buttplug