The ZeppelinOS development platform is built to help developers with maintaining upgradable contracts. As we discussed in the introduction section of this chapter, this upgradability is not a native concept in Ethereum, the EVM, or Solidity. It was developed using sophisticated Solidity upgradability design patterns, delegate calls, and assembly code. Hence, there are some recommendations that a developer must know about before working on writing upgradable contracts.
The state variables present in contracts are stored in storage slots. State variables take a position in the storage slots in the order in which they are defined in the contract. As upgradable contracts created using the zos platform, state variables are always stored in the Proxy contract; therefore, when the implementation changes, the state variables that are still...