From db238d7eea7d62eec04094ab781e985f324cbf0e Mon Sep 17 00:00:00 2001 From: Foivos Date: Thu, 14 Jul 2022 17:15:22 +0300 Subject: [PATCH] upgrade upgradable now takes constructor args. --- scripts/upgradable.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/upgradable.js b/scripts/upgradable.js index 6182c422..d5d32927 100644 --- a/scripts/upgradable.js +++ b/scripts/upgradable.js @@ -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);