Right.
- But how
symbol()
still return v1's setup? shouldn't all call delegated to v2?
The initializer for v2 is not called during the upgrade. The token name is part of the proxy's state (since it is stored in storage), and since it was initialized in v1, it does not change. However, upgradeProxy
has a call
option for calling a function during the upgrade, which you can use to call a custom function to migrate the state.
Also, the release candidate for Contracts 4.6 has support for reinitializers (which can be the function that you call with the call
option during an upgrade).