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

Andrew7234/evm token transfers #504

Merged
merged 1 commit into from Aug 22, 2023
Merged

Conversation

Andrew7234
Copy link
Collaborator

@Andrew7234 Andrew7234 commented Aug 16, 2023

https://app.clickup.com/t/8692hqtf5

Adds support for dead-reckoning evmToken.NumTransfers without using triggers.

The accounting in this is almost identical to how we track evmToken.TotalSupply, in that we maintain two dead-reckoned sums in analysis.evmTokens and chain.evmTokens for possible and confirmed evm tokens, respectively. Once the evmTokens analyzer downloads a token, it copies the value from analysis to chain.

@Andrew7234 Andrew7234 marked this pull request as ready for review August 16, 2023 21:35
@Andrew7234 Andrew7234 self-assigned this Aug 16, 2023
Copy link
Collaborator

@mitjat mitjat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, looks good!
It's unfortunate that we need the kludge of tracking state in both analysis and chain evm_tokens tables. As discussed in #456, I'll try to make away with that soon.

Comment on lines 307 to 309
// Note that total_supply is optional for ERC721 contracts.
// If the evm_tokens analyzer is able to fetch the total supply from the node,
// it will supersede this.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Note that total_supply is optional for ERC721 contracts.
// If the evm_tokens analyzer is able to fetch the total supply from the node,
// it will supersede this.
// Note that total_supply is optional for ERC721 contracts.
// If the evm_tokens analyzer is able to fetch the total supply from the node,
// it will supersede this, but implementing totalSupply() is optional for ERC721 contracts,
// so we have to maintain this dead-reckoned fallback.

Wording nit, just to make it clearer what the implications are of having an optional totalSupply()

@Andrew7234 Andrew7234 force-pushed the andrew7234/evm-token-transfers branch from 91efa67 to 6e59c56 Compare August 22, 2023 16:22
[analyzer] dead-reckon numTransfers

[api] update with evmtokens.numTransfers

linter

address comment

rename migration
@Andrew7234 Andrew7234 force-pushed the andrew7234/evm-token-transfers branch from 6e59c56 to d753ce1 Compare August 22, 2023 16:26
@Andrew7234 Andrew7234 merged commit 9564c2c into main Aug 22, 2023
6 checks passed
@Andrew7234 Andrew7234 deleted the andrew7234/evm-token-transfers branch August 22, 2023 16:32
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

Successfully merging this pull request may close these issues.

None yet

2 participants