DEV Community

chandra penugonda
chandra penugonda

Posted on

2 2

Upgradable contracts (part-1)

In Part-1, We will see what is Upgradable contract

One of the basic rules of EVM is that once a contract is deployed, it cannot be changed. Instead, an upgradable smart contract uses a special proxy pattern. The latter involves deploying proxy contracts and implementation contracts (logic contracts).

  • User interacts with proxy contract that intiates fallback function that deligates call to contract implementation(V1).
  • Proxy contract has upgrade function to deligate call to new contract implementation(V2).
  • For security purpose, upgrade function should be invoked by only Admin.
  • Admin interacts with proxy admin contract which interm calls upgrade function of the proxy

image 1

image 2

image3

what is the need to upgrade our smart contracts ?

  • fix vulnerability
  • update bussiness logic
  • add new functionality

AWS Q Developer image

Your AI Code Assistant

Generate and update README files, create data-flow diagrams, and keep your project fully documented. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more