Skip to content

Instantly share code, notes, and snippets.

@sahilrajput03
Last active November 14, 2022 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sahilrajput03/97f72472a4d250100dd9faa8443c2942 to your computer and use it in GitHub Desktop.
Save sahilrajput03/97f72472a4d250100dd9faa8443c2942 to your computer and use it in GitHub Desktop.

Upgradable contracts - UUPS (better than Transparent Proxy)

Source: Official Openzeppelin youtube channel

All resources related to Upgradability from Openzeppelin: Click here

Depending on where we put the upgradeTo() function we decide b/w two types of upgradable smart contracts.

image

UUPS is newer than Transparent proxy.

Costs comparison of deployment and usage:

image


Upgrading contract with wrong order of variables compared to the older version of deployed contract throws error as we can see below:

This is becoz of the way solidity allocates the storage locaitons in a linear manner:

image

More sources:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment