Await implementation verification before proxy verification API call

pull/5285/head
Manuel Wedler 3 months ago committed by Aniket
parent 8d20a70afe
commit 70bb7a264c
  1. 2
      apps/contract-verification/src/app/types/VerificationTypes.ts
  2. 11
      apps/contract-verification/src/app/views/VerifyView.tsx

@ -57,7 +57,7 @@ export interface SubmittedContracts {
type SourcifyStatus = 'fully verified' | 'partially verified' type SourcifyStatus = 'fully verified' | 'partially verified'
type EtherscanStatus = 'verified' | 'already 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 { export interface VerificationResponse {
status: VerificationStatus status: VerificationStatus

@ -103,7 +103,7 @@ export const VerifyView = () => {
continue 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 newSubmittedContract.proxyAddress = proxyAddress
@ -123,6 +123,15 @@ export const VerifyView = () => {
} }
const { verifierInfo } = receipt 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] const verifierSettings = chainSettings.verifiers[verifierInfo.name]
try { try {
const verifier = getVerifier(verifierInfo.name, verifierSettings) const verifier = getVerifier(verifierInfo.name, verifierSettings)

Loading…
Cancel
Save