Hey Solidity ninjas 🥷

Question:
1. What happens if I try to change the name of a State Variable in the version 2 of an upgradeable.

If version 1 had a State Variable called VarOne, in version 2 Can I change its name to VarTwo, without disturbing its Storage layout.

Is this doable? If not, what is the blocker here?

PS: Already have this resource - https://forum.openzeppelin.com/t/can-you-rename-variables-in-a-deployed-upgradeable-contract/1749.
Let me know if there is anything lese one needs to know about this. Thanks 🙏

Jul 31, 2022, 9:40 AM
It is possible as long as you don't change the order of vars (storage layout)
Oz upgrades plugin will throw a warning, but just a warning to notify the name has changed
Jul 31, 2022, 9:48 AM
Yeah, I guess changing name alone is fine, unless storage layout is disturbed
Thanks though @grimreaper619
Jul 31, 2022, 9:49 AM

© 2024 Draquery.com All rights reserved.