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

Unable to pass initializer arguments when using proposeUpgrade #202

Open
ghost opened this issue May 13, 2023 · 0 comments
Open

Unable to pass initializer arguments when using proposeUpgrade #202

ghost opened this issue May 13, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented May 13, 2023

I'm using defender and hardhat for my project that uses a Transparent proxy.

Currently, our multisig is the owner of our proxy therefore, a proposal must be made before upgrading the implementation contract.

When creating a proposal, I do not see an option to pass initializer arguments.

Here is my hardhat task :

task("propose-multisig-upgrade", "Propose a new updated contract to be upgraded via multisig")
  .addParam("proxy", "Address of the proxy")
  .addParam("name", "Name of the updated implementation contract (must be existant in artifacts)")
  .setAction(async (taskArgs, hre) => {
    try {
      const NewImplementation = await hre.ethers.getContractFactory(taskArgs.name);
      console.log("Preparing proposal...");
      const proposal = await hre.defender.proposeUpgrade(taskArgs.proxy, NewImplementation);
      console.log("Upgrade proposal created at:", proposal.url);
      return proposal.url;
    } catch (error) {
      console.log(error);
    }
  });

Is there a work around for this?

PS : I do not want to deploy the implementation before hand manually then propose the upgrade.

Thank you in advance.

@ghost ghost changed the title unable to pass initializer arguments when using proposeUpgrade Unable to pass initializer arguments when using proposeUpgrade May 13, 2023
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

0 participants