diff --git a/apps/etherscan/src/app/utils/utilities.ts b/apps/etherscan/src/app/utils/utilities.ts index 20eb38c73e..f0f92ab6f7 100644 --- a/apps/etherscan/src/app/utils/utilities.ts +++ b/apps/etherscan/src/app/utils/utilities.ts @@ -48,3 +48,22 @@ export const getReceiptStatus = async ( console.error(error) } } + +export const getProxyContractReceiptStatus = async ( + receiptGuid: string, + apiKey: string, + etherscanApi: string +): Promise => { + const params = `guid=${receiptGuid}&module=contract&action=checkproxyverification&apiKey=${apiKey}` + try { + const response = await axios.get(`${etherscanApi}?${params}`) + const { result, message, status } = response.data + return { + result, + message, + status, + } + } catch (error) { + console.error(error) + } +} diff --git a/apps/etherscan/src/app/utils/verify.ts b/apps/etherscan/src/app/utils/verify.ts index c31fe5d675..3119e5f05f 100644 --- a/apps/etherscan/src/app/utils/verify.ts +++ b/apps/etherscan/src/app/utils/verify.ts @@ -1,4 +1,4 @@ -import { getNetworkName, getEtherScanApi, getReceiptStatus } from "../utils" +import { getNetworkName, getEtherScanApi, getReceiptStatus, getProxyContractReceiptStatus } from "../utils" import { CompilationResult } from "@remixproject/plugin-api" import { CompilerAbstract } from '@remix-project/remix-solidity' import axios from 'axios' @@ -114,7 +114,14 @@ export const verify = async ( if (message === "OK" && status === "1") { resetAfter10Seconds(client, setResults) - const receiptStatus = await getReceiptStatus( + let receiptStatus + if (isProxyContract) { + receiptStatus = await getProxyContractReceiptStatus( + result, + apiKeyParam, + etherscanApi + ) + } else receiptStatus = await getReceiptStatus( result, apiKeyParam, etherscanApi