Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Decimal Value for Ethereum Tokens #1074

Open
alirezazeynali75 opened this issue Apr 28, 2024 · 1 comment
Open

Issue with Decimal Value for Ethereum Tokens #1074

alirezazeynali75 opened this issue Apr 28, 2024 · 1 comment

Comments

@alirezazeynali75
Copy link

alirezazeynali75 commented Apr 28, 2024

Hi everyone,

Description:

When interacting with the Blockbook API to query transactions involving Ethereum tokens with a decimal value of 0, such as Sensorium, inconsistencies arise in the reported decimal value. Despite tokens having a specified decimal value of 0, the API response consistently returns a decimal value of 18. This discrepancy creates confusion and inaccuracies when processing token values and can potentially lead to incorrect calculations or interpretations of token transactions.

Steps to Reproduce:

  1. Call the Blockbook API endpoint for a transaction involving a token with a decimal value of 0, for example, Sensorium.
  2. Analyze the API response to observe the reported decimal value.

Expected Behavior:

The Blockbook API response should accurately reflect the decimal value specified for the token in the transaction. Tokens with a decimal value of 0 should consistently return a decimal value of 0 in API responses.

Actual Behavior:

The Blockbook API returns a decimal value of 18 for tokens with a decimal value of 0, irrespective of the token's actual decimal value. This behavior contradicts the expected behavior and introduces ambiguity and inconsistency in token value representation.

Example API Response:

{
  "tokenTransfers": [
    {
      "type": "ERC20",
      "from": "0x0D0707963952f2fBA59dD06f2b425ace40b492Fe",
      "to": "0x7Daf50dBeBd312E29fA8A6C9507856F9Ab4547d7",
      "contract": "0xC19B6A4Ac7C7Cc24459F08984Bbd09664af17bD1",
      "name": "Sensorium",
      "symbol": "SENSO",
      "decimals": 18,
      "value": "4915"
    }
  ]
}

Additional Info

  1. Token with decimal value of 0: Sensorium
  2. Block number: 19752710
  3. Endpoint: /api/v2/block/19752710
  4. TxHash: 0x77b6ee2e04041d00d039f1fa597708b1b937cf69f9c920b844ee8d2d8484df6a
@tomasklim
Copy link
Member

#1026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants