From 0c405da4fda019fe7a8294329bf55dd9f0704af3 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Wed, 5 Jul 2023 13:49:02 +0200 Subject: [PATCH] Updates to WalletCoordinator upgrade script - cast type of proxy admin instance - update deployment artifact before referencing it in by `getContract("WalletCoordinator")` - verify implementation contract --- .../81_upgrade_wallet_coordinator_v2.ts | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts b/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts index 5428dbb5b..09f34895a 100644 --- a/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts +++ b/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts @@ -28,7 +28,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { ) // Assemble proxy upgrade transaction. - const proxyAdmin: ProxyAdmin = await hre.upgrades.admin.getInstance() + const proxyAdmin: ProxyAdmin = + (await hre.upgrades.admin.getInstance()) as ProxyAdmin const proxyAdminOwner = await proxyAdmin.owner() const upgradeTxData = await proxyAdmin.interface.encodeFunctionData( @@ -43,6 +44,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { `\t\tdata: ${upgradeTxData}` ) + // Update Deployment Artifact + const walletCoordinatorArtifact: Artifact = + hre.artifacts.readArtifactSync("WalletCoordinator") + + await deployments.save("WalletCoordinator", { + ...proxyDeployment, + abi: walletCoordinatorArtifact.abi, + implementation: newImplementationAddress, + }) + // Assemble parameters upgrade transaction. const walletCoordinator: WalletCoordinator = await helpers.contracts.getContract("WalletCoordinator") @@ -62,22 +73,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { `\t\tdata: ${updateRedemptionProposalParametersTxData}` ) - // Update Deployment Artifact - const walletCoordinatorArtifact: Artifact = - hre.artifacts.readArtifactSync("WalletCoordinator") - - await deployments.save("WalletCoordinator", { - ...proxyDeployment, - abi: walletCoordinatorArtifact.abi, - implementation: newImplementationAddress, - }) - if (hre.network.tags.etherscan) { // We use `verify` instead of `verify:verify` as the `verify` task is defined // in "@openzeppelin/hardhat-upgrades" to perform Etherscan verification // of Proxy and Implementation contracts. await hre.run("verify", { - address: proxyDeployment.address, + address: newImplementationAddress, constructorArgsParams: proxyDeployment.args, }) }