[Contract version] used "@openzeppelin/contracts": "^5.0.0" as dependency but the proxy admin is from v4.8.3

Hello,
I used "@openzeppelin/contracts": "^5.0.0" as dependency with hardhat to deploy an upgradeable contract, the proxy pattern used is TransparentUpgradeableProxy.
I deployed the token implementation contract on sepolia, and then I figured out the ProxyAdmin and the TransparentUpgradeableProxy are not the same as the ones on openzeppelin-contracts v5.0.0, the contracts deployed are from v4.8.3. Noted at the contracts // OpenZeppelin Contracts (last updated v4.8.3) (proxy/transparent/ProxyAdmin.sol)

As I used v5.0.0, I expected the ProxyAdmin.sol and is the TransparentUpgradeableProxy.sol are the same as the ones in openzeppelin-contracts v5.0.0, does anyone know how to force the plugin to use the ProxyAdmin and TransparentUpgradeableProxy from openzeppelin-contracts v5.0.0 ?

I tried to dig a bit more why this happened, it might link to the configuration on this file https://github.com/OpenZeppelin/openzeppelin-upgrades/blob/master/packages/core/package.json ?

Here are all my dependencies :

{
  "devDependencies": {
    "@nomicfoundation/hardhat-ethers": "^3.0.4",
    "@nomicfoundation/hardhat-toolbox": "^3.0.0",
    "@openzeppelin/hardhat-upgrades": "^2.3.3",
    "ethers": "^6.8.1",
    "hardhat": "^2.19.0"
  },
  "dependencies": {
    "@openzeppelin/contracts": "^5.0.0",
    "@openzeppelin/contracts-upgradeable": "^5.0.0"
  }
}

Currently, the upgrades plugin (which I guess you used) still uses proxy code from the 4.x releases. This should have no effect on your contracts behavior and on your ability to perform upgrades.

We should update that dependency in an upcomming version of the upgrades plugin.

Hi @Amxx , thanks a lot for the response, btw where can I check which version's contracts I'm using ? Is this the correct configuration file that I should check ?

Hello, Thanks I had a similar issue. I have 2 questions please

  • Is there a roadmap, timeline or task for the updated in the plugin to follow?

  • Let says I have already deployed my upgradable-contracts (using only version 4.x.x) on mainnet with the current version v2.4.0 of the upgradabel-plugin. Can I use the later the new version of the plugin (that uses 5.0.0) to upgrade the contracts or must use the current version (v2.4.0)?

Thank you

Hi @Majd_TL51,

  • Here is the issue for the plugin to deploy 5.0 proxies: https://github.com/OpenZeppelin/openzeppelin-upgrades/issues/907. You can subscribe to that issue for updates. There is a PR linked in that issue which is pending review.

  • You will be able to use the new version of the plugin (when it is released) to upgrade your existing deployments.

1 Like