Skip to content

API endpoint /api/account/addresstokenbalance is returning ERC721sΒ #504

@itsacoyote

Description

@itsacoyote

πŸ› Bug Report

Getting the token balance of ERC20s for an address returns a list that includes ERC721s.

πŸ“ Description

The balanceService.getBalances(address) is returning a list of ERC20s along with ERC721s

πŸ”„ Reproduction Steps

https://block-explorer-api.mainnet.zksync.io/api?module=account&action=addresstokenbalance&address=0x0f6bfc4C284e489B404715B3F2610b0eb50FdE35

as well as:

https://block-explorer-api.mainnet.zksync.io/address/0x0f6bfc4C284e489B404715B3F2610b0eb50FdE35

Checking the return data, the last item in the list is "empty" data for a token with a quantity of 1.

{
      // Contract address is for CyfrinFoundryCourseNft 
      "TokenAddress": "0xBbA202c6DA89646F13C11a63C4aF182E4fFd4c2e",
      "TokenName": "",
      "TokenSymbol": "",
      "TokenQuantity": "1",
      "TokenDivisor": ""
  }

πŸ€” Expected Behavior

Only ERC20s listed for an address.

😯 Current Behavior

ERC20 and ERC721 are listed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions