UUPS Proxies: Tutorial (Solidity + JavaScript)

Is there anyway I can see the code inside Proxy contract?

do you mean you can't see the new implementation contract's code on etherscan after upgrade? cmiiw

A post was split to a new topic: How to pass multiple arguments to initializer

As time of this writing, we can assume the following libraries:

    "@openzeppelin/contracts-upgradeable": "^5.0.0",
    "@openzeppelin/hardhat-upgrades": "^3.1.0",

That by default when deploys upgradeable contracts are of type UUPS and are not of transparents type or you have to determine the type as in the tutorial is set?

I say that because since a certain version the transparent proxies have each one their own admin proxy when before they had one admin proxy for each implementation.

Before, In the manifest it does not appear anymore the admin proxie like this:

{
  "manifestVersion": "3.2",
  "admin": {
    "address": "0x4DE8aE04812B85776eA1D20AEd421a08e29895E5",
    "txHash": "0x18e5603b5c6cf2df5a675db54e15ad3a8bd392ddc2ca49c09c390d223bd6902f"
  },
  "proxies": [
    {
      "address": "0xB9237df43640Cd12c7B896d0Cb5a878051A2d7eC",
      "txHash": "0x61450e7f0f8527a35449e9a48448007bbb8de0209c52a956cc9c3806feea586e",
      "kind": "transparent"
    },

now is like this:

{
  "manifestVersion": "3.2",
  "proxies": [
    {
      "address": "0x654bE9DD5b5239Aa58586d9ff6f6bBeDfeF3FCf1",
      "txHash": "0xee2c1e65b739e91b70051034afb488aa4f130ca07d4fd10b0b4378c8f5a990b7",
      "kind": "transparent"
    }
  ],

Does this mean that transparent contracts are no longer transparent and are of the UUPS type or does the type still need to be determined as discussed in the tutorial?

You should still specify the proxy kind if you want it to be specifically UUPS or transparent. If you don't specify it, the plugin will infer the kind as UUPS if the implementation looks like a UUPS implementation (has a function with signature upgradeTo(address) or upgradeToAndCall(address,bytes)), otherwise it defaults to transparent.

As of OpenZeppelin Contracts v5 and Hardhat Upgrades v3 and above, transparent proxies deploy their own proxy admin, and the proxy admins are not recorded in the manifest file. This is described in the Hardhat Upgrades v3 release notes. Transparent proxies are still supported.

1 Like