Closed d10r closed 2 months ago
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.
Link: https://xkcd.com/2017
fixes #1992