-
Notifications
You must be signed in to change notification settings - Fork 271
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
Issue with deployProxy when using ContractFactory instantiated directly with ABI and Bytecode #916
Comments
My issue is potentially caused by having an importer file that specifically imports a contract from an installed dependency which I'm doing to avoid the issue described in #86 |
Can you share what is your use case for using a ContractFactory with ABI+bytecode? The plugin normally expects |
@ericglau in a hardhat project I'm installing a package that has upgradeable contracts, those packages are private but for the purposes of this discussion let's say this package is an openzeppelin upgradeable version of Uniswap/v3-core. Now in my hardhat project that installs this upgradeable const UniswapV3FactoryContractFactory = new ethers.ContractFactory(UPGRADEABLE_FACTORY_ABI, UPGRADEABLE_FACTORY_BYTECODE, deployerSigner);
const upgradeableUniswapV3Factory = await upgrades.deployProxy(UniswapV3FactoryContractFactory, [], {
initializer: "initialize",
}); With the error:
|
@ericglau it would be great to at least have the option(say called |
We can consider adding an option similar to this. However, I think your scenario is failing at an earlier step because the If I pass in an actual signer (for example in tests, But aside from the signer issue, for now you may need to deploy the implementation and proxy contracts directly (using ERC1967Proxy.sol or TransparentUpgradeableProxy.sol) until we add the proposed option. |
@ericglau thanks for investigating, yeah the deployer issue was a bug on my end. |
Summary:
I encountered an error while using the
@openzeppelin/[email protected]
plugin'sdeployProxy
function. The error arises when I use aContractFactory
created directly with the ABI and Bytecode, whereas usinggetContractFactory
works correctly.Details:
Initial Problem:
deployProxy
function from@openzeppelin/hardhat-upgrades
, I received the following error:Setup:
6.4.0
.2.19.0
Working Alternative:
getContractFactory
, the error doesn't appear and everything works as expected:attach
method on theContractFactory
:Current Status:
[email protected]
, usinggetContractFactory
works flawlessly.ContractFactory
directly with ABI and Bytecode (as shown above) still results in the aforementioneddeployProxy
error.Steps to Reproduce:
[email protected]
and[email protected]
.@openzeppelin/hardhat-upgrades
plugin.deployProxy
function.Expected Behavior:
Both methods of creating a
ContractFactory
(direct ABI/Bytecode instantiation and usinggetContractFactory
) should work seamlessly with thedeployProxy
function without any errors.The text was updated successfully, but these errors were encountered: