Hi everyone, let's say I have an ERC20 contract called "A".
In A there is my balance, let's say 1000 tokens.
Then I decide to upgrade my smart contract, so now I have another ERC20 contract called "A2.0".
I didn't add any variables in A2.0.
Did my balance change? Or I still have 1000 tokens?
Thanks everyone.
The short answer is you still have 1000 tokens.
The long answer is:
- You have a proxy and an implementation contract "A" at different addresses.
- The 1000 tokens are part of the proxy's storage. The implementation contract's storage is not used.
- When you upgrade to "A2.0", your proxy's storage remains the same. The only thing that changes is the address stored at the implementation storage slot which points to the "A2.0" contract. So any calls to that proxy are delegated to "A2.0" instead of "A"