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
Index Tokens balances per Address #514
Comments
@igorffs We've just had a call to discuss some aspects of #51 and we've come up with some points we might have on our radar, chiefly while investigating the best approach to retrieve users' token balances. In the issue #51, a summary with the count of addresses that have Also, we're going to start working on the Holders tab (see #516) soon, which basically lists all addresses with Example: https://kovan.etherscan.io/token/0xdab1c67232f92b7707f49c08047b96a4db7a9fc6#balances |
I think I'd be similar to how address balances are fetched now with a separate process. The difference would be that we'd have to execute a token's contract with the During token transfer indexing, we'd have to extract out the target address, token contract address, and block number and pass that information along to the process that can fetch token balance asynchronously. |
Thanks for the feedback @alexgaribay. ❤️ My first impression was that we should use
Your comment also made notice that we probably wouldn't need, at least, to use the same
Conceptually using the same Balance entity to represent this token balance still makes sense to me, but this storage thing could be a issue. Do you folks have an opinion about that? Also, considering we're storing the |
Balances table: |
@igorffs It wouldn't happen in the same process. I was think of having a As for schema, we can't leverage the balance table since we would need another column for the token's contract address. We have to do an index like:
|
@acravenho I've just updated the description, can you take a look at it? There are a few questions there that I have to confirm yet before sending to ready to dev. \o |
Tested it here and everything seems to be working fine! 👍 |
Description
Stores a snapshot of an Addresses Tokens balances whenever it receives a TokenTransfer.
The Token balance info is present in the blockchain, so we'll need to interact with it throught the Token Smart Contract using the
balanceOf
function - which is present in ERC-20 and ERC-721 specifications.Acceptance Criteria
Questions
balanceOf
function is not implemented in the Token's contract?QUANTITY
argumentdecimals
?Observations
Both #50 and #410 will need to show the balance per Token in the Address page and interacting with the blockchain on demand may not perform properly.
For example:
An Address could have transferred 140 different tokens, which mean that we'd need to use the balanceOf for all of them at the same time in the #50 feature.
Task Breakdown
The text was updated successfully, but these errors were encountered: