wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.17k stars 283 forks source link

Add support for UUPSUpgradeable proxy #480

Open brians210 opened 10 months ago

brians210 commented 10 months ago

my contract is using UUPSUpgradeable, when i deploy the contract

await deploy("TestProxy", {
  from: deployer,
  log: true,
  proxy: {
    owner: deployer,
    proxyContract: "UUPSUpgradeable",
    execute: {
      init: {
        methodName: "initialize",
      },
    },
  },
});

the error happen, Error: function "upgradeTo" will shadow "upgradeTo".

is it not supporting UUPSUpgradeable proxy, or my script is wrong?

wighawag commented 10 months ago

what is UUPSUpgradeable ?

brians210 commented 10 months ago

i am using @openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol

wighawag commented 10 months ago

Ha I see, UUPSUpgradeable is an abstract contract that your implementation contract (not the proxy) can use to help you manage upgrades

To use an UUPS proxy you can use the ERC1967Proxy as proxyContract