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 Answer 1

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
4
  • You mentioned "smart contract" several times in your post, which "smart contracts" are you referring to for each bullet point? Jan 16, 2023 at 20:54
  • Two smart contracts used in the delegacall proxy pattern. Jan 16, 2023 at 20:56
  • I'm asking which is the proxy and which is the logic contract? Jan 16, 2023 at 21:06
  • Please see the linked answer for details. Jan 17, 2023 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.