From c9617aef6d43e6726ad9a8fe3800e9f09744cb50 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 8 Jun 2023 12:34:54 +0530 Subject: [PATCH] update verify script to support proxy contract verification --- apps/etherscan/src/app/utils/scripts.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/etherscan/src/app/utils/scripts.ts b/apps/etherscan/src/app/utils/scripts.ts index ddbc13e8703..0e880d95137 100644 --- a/apps/etherscan/src/app/utils/scripts.ts +++ b/apps/etherscan/src/app/utils/scripts.ts @@ -6,13 +6,15 @@ export const verifyScript = ` * @param {string} contractName - Name of the contract * @param {string} contractFile - File where the contract is located * @param {number | string} chainRef - Network chain id or API URL + * @param {boolean} isProxyContract - true, if contract is a proxy contract + * @param {string} expectedImplAddress - Implementation contract address, in case of proxy contract verification * @returns {{ guid, status, message, succeed }} verification result */ -export const verify = async (apikey: string, contractAddress: string, contractArguments: string, contractName: string, contractFile: string, chainRef: number | string) => { +export const verify = async (apikey: string, contractAddress: string, contractArguments: string, contractName: string, contractFile: string, chainRef: number | string, isProxyContract: boolean, expectedImplAddress: string) => { const compilationResultParam = await remix.call('compilerArtefacts' as any, 'getCompilerAbstract', contractFile) console.log('verifying.. ' + contractName) // update apiKey and chainRef to verify contract on multiple networks - return await remix.call('etherscan' as any, 'verify', apikey, contractAddress, contractArguments, contractName, compilationResultParam, chainRef) + return await remix.call('etherscan' as any, 'verify', apikey, contractAddress, contractArguments, contractName, compilationResultParam, chainRef, isProxyContract, expectedImplAddress) }` export const receiptGuidScript = `