From 0560d16d9b6779b6b0cc8f7a8aa86b99ad880bf5 Mon Sep 17 00:00:00 2001 From: viraj124 Date: Tue, 24 Sep 2024 21:43:59 +0530 Subject: [PATCH] debug: update verification script --- .../scripts/hardhat/verifyDeployment.ts | 42 ++----------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/packages/solidity-contracts/scripts/hardhat/verifyDeployment.ts b/packages/solidity-contracts/scripts/hardhat/verifyDeployment.ts index c05cc6c9..daa30dd5 100644 --- a/packages/solidity-contracts/scripts/hardhat/verifyDeployment.ts +++ b/packages/solidity-contracts/scripts/hardhat/verifyDeployment.ts @@ -10,12 +10,9 @@ task('verify-deployment', 'Verifies the deployed contract bytecode').setAction( const deployments = await hre.deployments.all(); - for (const [contractName, deployment] of Object.entries(deployments)) { console.log(`\nVerifying ${contractName} (${deployment.address}):`); - - try { console.log('--- Fetching deployed bytecode...'); let deployedBytecode: string; @@ -33,7 +30,6 @@ task('verify-deployment', 'Verifies the deployed contract bytecode').setAction( const ContractFactory = await localHardhat.ethers.getContractFactory( deployment.linkedData.factory ); - let localAddress: string; if (!deployment.linkedData.isProxy) { console.log('--- Validating Upgrade...'); @@ -47,46 +43,14 @@ task('verify-deployment', 'Verifies the deployed contract bytecode').setAction( ); console.log('--- Upgrade Validated...'); - - console.log( - '--- Performing mock upgrade to fetch the local bytecode...' - ); - - const proxyfactory = await localHardhat.ethers.getContractFactory( - contractName - ); - const proxy = await localHardhat.upgrades.deployProxy(proxyfactory, [], { - initializer: 'initialize', - constructorArgs: deployment.linkedData.constructorArgs, - }); - - await proxy.waitForDeployment(); - - - const contract = await localHardhat.upgrades.upgradeProxy( - deployment.address, - ContractFactory, - { - kind: 'uups', - constructorArgs: deployment.linkedData.constructorArgs, - } - ); - - console.log('--- Upgrade successful'); - await contract.waitForDeployment(); - localAddress = await contract.getAddress(); } else continue; console.log('--- Fetching local deployment bytecode...'); let localBytecode: string; if (!deployment.linkedData.isProxy) { - - localBytecode = await hre.ethers.provider.getCode( - localAddress - ); - // await (await hre.artifacts.readArtifact(deployment.linkedData.factory)).deployedBytecode - - // localBytecode = await (await hre.artifacts.readArtifact(deployment.linkedData.factory)).deployedBytecode + localBytecode = await ( + await hre.artifacts.readArtifact(deployment.linkedData.factory) + ).bytecode; } else continue; console.log('--- Comparing bytecodes...');