💡Overview

The blockchain is immutable, and once a contract is deployed, you cannot change its code. This works fine for many applications that can deploy a new contract for every new version they create. Sadly, this isn't adequate for Phase's needs as a lot of info is stored in the contract itself and cannot be moved from contract to contract. We use proxies for almost everything in Phase to get around this issue. A proxy allows us to run any target contract code in the current contract's storage. This means we can deploy a contract once and upgrade its code in the future. This does have its downside, though, as all the code is upgradable, We have to safeguard and secure the protocol to a point so that a bad actor cannot change code instantly. One contract owned by a timelock will control all the proxies inside Phase. With this, every upgrade and code change has to go through a period where everyone can see them and act accordingly. Phase uses the following proxy patterns in its systems:

Last updated