From 70bb7a264c79ac05053a1fb64268635a0e1d0a9e Mon Sep 17 00:00:00 2001 From: Manuel Wedler Date: Fri, 6 Sep 2024 18:32:10 +0200 Subject: [PATCH] Await implementation verification before proxy verification API call --- .../src/app/types/VerificationTypes.ts | 2 +- .../src/app/views/VerifyView.tsx | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/contract-verification/src/app/types/VerificationTypes.ts b/apps/contract-verification/src/app/types/VerificationTypes.ts index f58df26381..bfe244a2e1 100644 --- a/apps/contract-verification/src/app/types/VerificationTypes.ts +++ b/apps/contract-verification/src/app/types/VerificationTypes.ts @@ -57,7 +57,7 @@ export interface SubmittedContracts { type SourcifyStatus = 'fully verified' | 'partially verified' type EtherscanStatus = 'verified' | 'already verified' -export type VerificationStatus = SourcifyStatus | EtherscanStatus | 'failed' | 'pending' | 'not verified' | 'unknown' | 'lookup failed' +export type VerificationStatus = SourcifyStatus | EtherscanStatus | 'failed' | 'pending' | 'not verified' | 'unknown' | 'lookup failed' | 'awaiting implementation verification' export interface VerificationResponse { status: VerificationStatus diff --git a/apps/contract-verification/src/app/views/VerifyView.tsx b/apps/contract-verification/src/app/views/VerifyView.tsx index 2539a5f4c7..717d4b2483 100644 --- a/apps/contract-verification/src/app/views/VerifyView.tsx +++ b/apps/contract-verification/src/app/views/VerifyView.tsx @@ -103,7 +103,7 @@ export const VerifyView = () => { continue } - proxyReceipts.push({ verifierInfo, status: 'pending', contractId, isProxyReceipt: true, failedChecks: 0 }) + proxyReceipts.push({ verifierInfo, status: 'awaiting implementation verification', contractId, isProxyReceipt: true, failedChecks: 0 }) } newSubmittedContract.proxyAddress = proxyAddress @@ -123,6 +123,15 @@ export const VerifyView = () => { } const { verifierInfo } = receipt + + if (receipt.status === 'awaiting implementation verification') { + const implementationReceipt = newSubmittedContract.receipts.find((r) => r.verifierInfo.name === verifierInfo.name) + if (implementationReceipt.status === 'pending') { + setTimeout(() => verify(receipt), 1000) + return + } + } + const verifierSettings = chainSettings.verifiers[verifierInfo.name] try { const verifier = getVerifier(verifierInfo.name, verifierSettings)