Skip to content

Commit

Permalink
upgrade upgradable now takes constructor args.
Browse files Browse the repository at this point in the history
  • Loading branch information
Foivos committed Jul 14, 2022
1 parent e572e77 commit db238d7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/upgradable.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,18 @@ async function deployUpgradable(
return new Contract(proxy.address, implementationJson.abi, wallet);
}

async function upgradeUpgradable(proxyAddress, contractJson, setupParams, wallet) {
async function upgradeUpgradable(
proxyAddress,
wallet,
contractJson,
implementationConstructorArgs = [],
setupParams = '0x',
) {
const proxy = new Contract(proxyAddress, IUpgradable.abi, wallet);

const implementationFactory = new ContractFactory(contractJson.abi, contractJson.bytecode, wallet);

const implementation = await implementationFactory.deploy();
const implementation = await implementationFactory.deploy(...implementationConstructorArgs);
await implementation.deployed();

const implementationCode = await wallet.provider.getCode(implementation.address);
Expand Down

0 comments on commit db238d7

Please sign in to comment.