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

Conflict with Hardhat/Openzepplin Upgrades Beacon Proxy #72

Open
zeryx opened this issue Sep 6, 2022 · 1 comment
Open

Conflict with Hardhat/Openzepplin Upgrades Beacon Proxy #72

zeryx opened this issue Sep 6, 2022 · 1 comment

Comments

@zeryx
Copy link

zeryx commented Sep 6, 2022

There is a conflict with the @openzepplin/hardhat-upgrades library that requires using the nativeContractFactory object when deploying a beacon proxy if the tenderly automagic setup() is used.

Expected Behavior:

const { ethers, upgrades } = require("hardhat");
const code = await ethers.getContractProxy("someContract");
const beacon = await deployBeacon(code);
const beaconProxy = await upgrades.deployBeaconProxy(beacon.address, code, [...])

console.log("my beacon proxy has been deployed with tenderly!")

Instead this is the required modification for this to work:

const { ethers, upgrades } = require("hardhat");
const code = await ethers.getContractProxy("someContract");
const beacon = await deployBeacon(code);
const code_native = code.nativeContractFactory;
const beaconProxy = await upgrades.deployBeaconProxy(beacon.address, code_native , [...])

console.log("my beacon proxy has been deployed with tenderly!")

Would love to get that supported 🙏 BeaconProxies are amazing and something we utilize everywhere.

@dule-git
Copy link
Contributor

Hey @zeryx,

The problem here is that hardhat-tenderly is overriding the ethers library used by the hardhat-upgrades library.
So deployBeacon returns our TdlyContractFactory instead of the ethers.ContractFactory.

And the workaround is as you have described.
We'll see to provide a proper solution for this so our users don't have to use these workarounds. 😢

Btw, we have implemented automatic verification of the proxy contracts that are deployed using the hardhat-upgrades library. So you can check that out!

Thanks for reporting this!

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

No branches or pull requests

2 participants