Hello Everyone,
While writing some tests for my app, I noticed that the balance for some addresses is not calculated correctly.
Let’s take for example this wallet: 0x895Be97bDb9F8a244c472B18EA96DeE39ddf8fe5
.
According to the Moralis Web3 API (/{address}/nft
) and Etherscan the user has 1 token relative to the contract 0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d
(Decentraland land)
If we query BlockScout or the Decentraland API instead, the count is 6 tokens.
The Moralis API (/{address}
) doesn’t allow us to really understand what is happening. If we painstakingly go through all the transactions on the blockchain directly, we see that some data is missing that would help us: In the transaction the to
address is the contract, but in the data we can see what is actually happening is that the user is receiving a token. I think the aggregation pipeline is ignoring the attached data, hence it register only 1 token instead of 6.
I can reproduce this for a bunch of other tokens, not sure if they are all violating the ERC20 spec, but it seems like a common behavior.