Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy does not leverage the safety built in to contracts-upgradeable package from openzeppelin #355

Open
mistersingh179 opened this issue Jul 28, 2022 · 1 comment · May be fixed by #358

Comments

@mistersingh179
Copy link

When i upgrade a UUPS proxy contract using deploy it doesn't benefit from all the safety checks built in to @openzeppelin/contracts-upgradeable

For e.g. if i mess up the storage layout and do await upgrades.upgradeProxy(BOX_ADDRESS, BoxV2) it will error out complaining about storage layout issue.

But if i do the following, it doesn't check for any issues, does the upgrade & possibly bricks the proxy.

await deploy('Box', {
    contract: 'BoxV2',
    from: deployer, // address that will perform the transaction.
    log: true,
    proxy: {
      proxyContract: 'ERC1967Proxy',
      proxyArgs: ['{implementation}', '{data}'],
      execute: {
        onUpgrade: {
          methodName: 'init',
          args: []
        }
      }
    }
  });

Is there a way to use hardhat-deploy so behind the scenes it benefits from the safety built in to @openzeppelin/contracts-upgradeable?

@fullkomnun fullkomnun linked a pull request Aug 1, 2022 that will close this issue
@fullkomnun
Copy link
Contributor

fullkomnun commented Aug 2, 2022

@mistersingh179 I submitted a PR with support for openzeppelin's upgradability validations #358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants