1

I'm recently learning proxy patterns (https://blog.openzeppelin.com/proxy-patterns/) and understand that although it is not possible to upgrade the code of your already deployed smart contract, it is possible to set-up a proxy contract architecture that will allow you to use new deployed contracts as if your main logic had been upgraded. My question is:

  • Why do we need to separate storage and logic layers for proxy patterns?
  • What does separating storage and logic layers have relations to contracts being upgradable?

1 Answers1

0

Why do we need to separate storage and logic layers for proxy patterns?

Most proxies today use DELEGATECALL pattern.

  • Smart contract loads implementation (code) from one address
  • Another smart contract address stores data
  • When the smart contract is upgraded, the address where the code is loaded is changed
  • The storage address stays the same
Mikko Ohtamaa
  • 22,269
  • 6
  • 62
  • 127