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

[SUBGRAPH] fix missing token name/symbol #2017

Merged
merged 4 commits into from
Sep 9, 2024
Merged

Conversation

d10r
Copy link
Collaborator

@d10r d10r commented Sep 6, 2024

fixes #1992

@d10r d10r linked an issue Sep 9, 2024 that may be closed by this pull request
@d10r
Copy link
Collaborator Author

d10r commented Sep 9, 2024

what happened:
Custom Super Tokens tend to register via factory before initializing themselves via SuperToken.initialize(), this is the case for the native token wrapper too (see deploy script). As a result, the first invocation of getOrInitSuperToken() queries a token proxy contract which points to the canonical SuperToken logic, but isn't yet initialized.
Initialization typically happens in another transaction closely following.

The previous code handled later updating of the token symbol, but that's not the only field set on initialize, see SuperToken._initialize().
The logic now is: if symbol and name have zero length (proxy condition for detecting an uninitialized token), sync all the entity data from RPC again. This should cover all special cases of this category, even those we don't yet see - e.g. a custom SuperToken wrapper.

@d10r d10r marked this pull request as ready for review September 9, 2024 10:44
@d10r d10r requested a review from hellwolf as a code owner September 9, 2024 10:44
@d10r d10r merged commit 2b2fe84 into dev Sep 9, 2024
14 checks passed
@d10r d10r deleted the subgraph-token-symbol-fix branch September 9, 2024 14:08
Copy link

github-actions bot commented Sep 9, 2024

XKCD Comic Relif

Link: https://xkcd.com/2017
https://xkcd.com/2017

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.

[SUBGRAPH] Native Super Token name empty
2 participants