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

Re-fetch ERC-20 totalSupply(), balanceOf() #293

Open
mitjat opened this issue Jan 23, 2023 · 1 comment
Open

Re-fetch ERC-20 totalSupply(), balanceOf() #293

mitjat opened this issue Jan 23, 2023 · 1 comment

Comments

@mitjat
Copy link
Collaborator

mitjat commented Jan 23, 2023

After a Transfer() event of an ERC-20 token (and other similar tokens in the future), and/or periodically, fetch the token's totalSupply() from the EVM, and fetch the sender's and receiver's balanceOf() for the token from the EVM.

The goal is to be robust in the face of errors in our dead reckoning. There is a category of balances that we almost expect to get wrong with dead reckoning: When a token contract is first created, it might hardcode some initial balances and never emit events for those.

If the EVM fetch detects a discrepancy with the DB, and the DB hasn't been updated since we started the EVM fetch, log the discrepancy at error level. We'll want to look into these.

This could be a part of the same analyzer that fetches EVM token metadata, or a separate similarly-structured analyzer.

@pro-wh
Copy link
Collaborator

pro-wh commented Feb 1, 2023

little thread on how to manage dead reckoned total supply with queried total supply:

#284 (comment)

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