Creating upgradable smart contracts
Once a smart contract is deployed in the Ethereum network, its code cannot be changed at any point. State values can be modified if this was allowed in the original code. This brings the great advantage of immutability and trust, but with a cost. The addition of a new feature, or even a bug fix, cannot be performed due to the design of Ethereum.
In this recipe, we will focus on designing and creating upgradable smart contracts that can help maintain the application better.
Getting ready...
You need to have a working Ethereum installation for deploying and testing the smart contract. You can also use the Remix IDE to write and test the Solidity code.
It is required to have good knowledge of solidity before stepping through this recipe. Go through Chapter 2, Smart Contract Development, for more information.
How to do it...
- Making a contract upgradable can be achieved through multiple methods. One of the popular implementations is to use a proxy contract that keeps...