diff --git a/apps/contract-verification/src/app/Verifiers/AbstractVerifier.ts b/apps/contract-verification/src/app/Verifiers/AbstractVerifier.ts index 480fc5bd9b..021c45c988 100644 --- a/apps/contract-verification/src/app/Verifiers/AbstractVerifier.ts +++ b/apps/contract-verification/src/app/Verifiers/AbstractVerifier.ts @@ -3,7 +3,7 @@ import type { LookupResponse, SubmittedContract, VerificationResponse } from '.. // Optional function definitions export interface AbstractVerifier { - verifyProxy(submittedContract: SubmittedContract): Promise + verifyProxy?(submittedContract: SubmittedContract): Promise checkVerificationStatus?(receiptId: string): Promise checkProxyVerificationStatus?(receiptId: string): Promise } diff --git a/apps/contract-verification/src/app/Verifiers/BlockscoutVerifier.ts b/apps/contract-verification/src/app/Verifiers/BlockscoutVerifier.ts index fd7b95563f..4c3efc89a4 100644 --- a/apps/contract-verification/src/app/Verifiers/BlockscoutVerifier.ts +++ b/apps/contract-verification/src/app/Verifiers/BlockscoutVerifier.ts @@ -26,7 +26,7 @@ export class BlockscoutVerifier extends EtherscanVerifier { super(apiUrl, apiUrl, undefined) } - getContractCodeUrl(address: string): string { + getContractCodeUrl(address: string, chainId: string): string { const url = new URL(this.explorerUrl + `/address/${address}`) url.searchParams.append('tab', 'contract') return url.href diff --git a/apps/contract-verification/src/app/Verifiers/EtherscanVerifier.ts b/apps/contract-verification/src/app/Verifiers/EtherscanVerifier.ts index 8d5a6198a2..1e127e6a32 100644 --- a/apps/contract-verification/src/app/Verifiers/EtherscanVerifier.ts +++ b/apps/contract-verification/src/app/Verifiers/EtherscanVerifier.ts @@ -74,9 +74,10 @@ export class EtherscanVerifier extends AbstractVerifier { } const verificationResponse: EtherscanRpcResponse = await response.json() + const lookupUrl = this.getContractCodeUrl(submittedContract.address, submittedContract.chainId) if (verificationResponse.result.includes('already verified')) { - return { status: 'already verified', receiptId: null, lookupUrl: this.getContractCodeUrl(submittedContract.address) } + return { status: 'already verified', receiptId: null, lookupUrl } } if (verificationResponse.status !== '1' || verificationResponse.message !== 'OK') { @@ -84,7 +85,6 @@ export class EtherscanVerifier extends AbstractVerifier { throw new Error(verificationResponse.result) } - const lookupUrl = this.getContractCodeUrl(submittedContract.address) return { status: 'pending', receiptId: verificationResponse.result, lookupUrl } } @@ -117,6 +117,10 @@ export class EtherscanVerifier extends AbstractVerifier { const verificationResponse: EtherscanRpcResponse = await response.json() + if (verificationResponse.message === 'Smart-contract not found or is not verified') { + return { status: 'failed', receiptId: null, message: verificationResponse.message } + } + if (verificationResponse.status !== '1' || verificationResponse.message !== 'OK') { console.error('Error on Etherscan API proxy verification at ' + this.apiUrl + '\nStatus: ' + verificationResponse.status + '\nMessage: ' + verificationResponse.message + '\nResult: ' + verificationResponse.result) throw new Error(verificationResponse.result) @@ -144,7 +148,7 @@ export class EtherscanVerifier extends AbstractVerifier { const checkStatusResponse: EtherscanCheckStatusResponse = await response.json() - if (checkStatusResponse.result.startsWith('Fail - Unable to verify')) { + if (checkStatusResponse.result.startsWith('Fail - Unable to verify') || (checkStatusResponse.result as string) === 'Error: contract does not exist') { return { status: 'failed', receiptId, message: checkStatusResponse.result } } if (checkStatusResponse.result === 'Pending in queue') { @@ -229,23 +233,23 @@ export class EtherscanVerifier extends AbstractVerifier { const lookupResponse: EtherscanGetSourceCodeResponse = await response.json() + if (lookupResponse.result[0].ABI === 'Contract source code not verified' || !lookupResponse.result[0].SourceCode || (lookupResponse.result as unknown as string) === 'Contract source code not verified') { + return { status: 'not verified' } + } + if (lookupResponse.status !== '1' || !lookupResponse.message.startsWith('OK')) { const errorResponse = lookupResponse as unknown as EtherscanRpcResponse console.error('Error on Etherscan API lookup at ' + this.apiUrl + '\nStatus: ' + errorResponse.status + '\nMessage: ' + errorResponse.message + '\nResult: ' + errorResponse.result) throw new Error(errorResponse.result) } - if (lookupResponse.result[0].ABI === 'Contract source code not verified' || !lookupResponse.result[0].SourceCode) { - return { status: 'not verified' } - } - - const lookupUrl = this.getContractCodeUrl(contractAddress) + const lookupUrl = this.getContractCodeUrl(contractAddress, chainId) const { sourceFiles, targetFilePath } = this.processReceivedFiles(lookupResponse.result[0], contractAddress, chainId) return { status: 'verified', lookupUrl, sourceFiles, targetFilePath } } - getContractCodeUrl(address: string): string { + getContractCodeUrl(address: string, chainId: string): string { const url = new URL(this.explorerUrl + `/address/${address}#code`) return url.href } diff --git a/apps/contract-verification/src/app/Verifiers/RoutescanVerifier.ts b/apps/contract-verification/src/app/Verifiers/RoutescanVerifier.ts new file mode 100644 index 0000000000..e500b49064 --- /dev/null +++ b/apps/contract-verification/src/app/Verifiers/RoutescanVerifier.ts @@ -0,0 +1,14 @@ +import { EtherscanVerifier } from './EtherscanVerifier' + +export class RoutescanVerifier extends EtherscanVerifier { + LOOKUP_STORE_DIR = 'routescan-verified' + + // Routescan does not support proxy verification + verifyProxy = undefined + checkProxyVerificationStatus = undefined + + getContractCodeUrl(address: string, chainId: string): string { + const url = new URL(this.explorerUrl + `/address/${address}/contract/${chainId}/code`) + return url.href + } +} diff --git a/apps/contract-verification/src/app/Verifiers/index.ts b/apps/contract-verification/src/app/Verifiers/index.ts index 23de8cd89d..92de876f5b 100644 --- a/apps/contract-verification/src/app/Verifiers/index.ts +++ b/apps/contract-verification/src/app/Verifiers/index.ts @@ -3,11 +3,13 @@ import { AbstractVerifier } from './AbstractVerifier' import { BlockscoutVerifier } from './BlockscoutVerifier' import { EtherscanVerifier } from './EtherscanVerifier' import { SourcifyVerifier } from './SourcifyVerifier' +import { RoutescanVerifier } from './RoutescanVerifier' export { AbstractVerifier } from './AbstractVerifier' export { BlockscoutVerifier } from './BlockscoutVerifier' export { SourcifyVerifier } from './SourcifyVerifier' export { EtherscanVerifier } from './EtherscanVerifier' +export { RoutescanVerifier } from './RoutescanVerifier' export function getVerifier(identifier: VerifierIdentifier, settings: VerifierSettings): AbstractVerifier { switch (identifier) { @@ -26,5 +28,7 @@ export function getVerifier(identifier: VerifierIdentifier, settings: VerifierSe return new EtherscanVerifier(settings.apiUrl, settings.explorerUrl, settings.apiKey) case 'Blockscout': return new BlockscoutVerifier(settings.apiUrl) + case 'Routescan': + return new RoutescanVerifier(settings.apiUrl, settings.explorerUrl, settings.apiKey) } } diff --git a/apps/contract-verification/src/app/components/AccordionReceipt.tsx b/apps/contract-verification/src/app/components/AccordionReceipt.tsx index 33ee96a7ce..7aedb3e7f1 100644 --- a/apps/contract-verification/src/app/components/AccordionReceipt.tsx +++ b/apps/contract-verification/src/app/components/AccordionReceipt.tsx @@ -88,7 +88,7 @@ const ReceiptsBody = ({ receipts }: { receipts: VerificationReceipt[] }) => { return (
    {receipts.map((receipt) => ( -
  • +
  • {receipt.verifierInfo.name} diff --git a/apps/contract-verification/src/app/types/VerificationTypes.ts b/apps/contract-verification/src/app/types/VerificationTypes.ts index 32c1110a76..1ec5579976 100644 --- a/apps/contract-verification/src/app/types/VerificationTypes.ts +++ b/apps/contract-verification/src/app/types/VerificationTypes.ts @@ -17,8 +17,8 @@ export interface Chain { infoURL?: string } -export type VerifierIdentifier = 'Sourcify' | 'Etherscan' | 'Blockscout' -export const VERIFIERS: VerifierIdentifier[] = ['Sourcify', 'Etherscan', 'Blockscout'] +export type VerifierIdentifier = 'Sourcify' | 'Etherscan' | 'Blockscout' | 'Routescan' +export const VERIFIERS: VerifierIdentifier[] = ['Sourcify', 'Etherscan', 'Blockscout', 'Routescan'] export interface VerifierInfo { name: VerifierIdentifier diff --git a/apps/contract-verification/src/app/utils/default-apis.json b/apps/contract-verification/src/app/utils/default-apis.json index 406e9fe922..b20059f57b 100644 --- a/apps/contract-verification/src/app/utils/default-apis.json +++ b/apps/contract-verification/src/app/utils/default-apis.json @@ -572,5 +572,329 @@ "81247166294": { "apiUrl": "https://testnet.otoscan.io" } + }, + "Routescan": { + "explorerUrl": "https://routescan.io", + "8453": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/8453/etherscan" + }, + "167000": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/167000/etherscan" + }, + "357": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/357/etherscan" + }, + "1": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/1/etherscan" + }, + "19": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/19/etherscan" + }, + "10": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/10/etherscan" + }, + "81457": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/81457/etherscan" + }, + "53935": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/53935/etherscan" + }, + "432204": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/432204/etherscan" + }, + "480": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/480/etherscan" + }, + "14": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/14/etherscan" + }, + "5000": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/5000/etherscan" + }, + "254": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/254/etherscan" + }, + "43114": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan" + }, + "7777777": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/7777777/etherscan" + }, + "324": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/324/etherscan" + }, + "7560": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/7560/etherscan" + }, + "185": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/185/etherscan" + }, + "888888888": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/888888888/etherscan" + }, + "34443": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/34443/etherscan" + }, + "88888": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/88888/etherscan" + }, + "20240603": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/20240603/etherscan" + }, + "6119": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/6119/etherscan" + }, + "291": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/291/etherscan" + }, + "252": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/252/etherscan" + }, + "1088": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan" + }, + "8008": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/8008/etherscan" + }, + "288": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/288/etherscan" + }, + "65536": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/65536/etherscan" + }, + "424": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/424/etherscan" + }, + "183": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/183/etherscan" + }, + "33979": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/33979/etherscan" + }, + "10849": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/10849/etherscan" + }, + "2044": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/2044/etherscan" + }, + "8888": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/8888/etherscan" + }, + "1853": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/1853/etherscan" + }, + "56288": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/56288/etherscan" + }, + "710420": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/710420/etherscan" + }, + "4337": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/4337/etherscan" + }, + "333000333": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/333000333/etherscan" + }, + "3011": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/3011/etherscan" + }, + "1234": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/1234/etherscan" + }, + "504441": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/504441/etherscan" + }, + "7887": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/7887/etherscan" + }, + "7979": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/7979/etherscan" + }, + "10507": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/10507/etherscan" + }, + "5566": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/5566/etherscan" + }, + "151": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/151/etherscan" + }, + "62707": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/62707/etherscan" + }, + "70953": { + "apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/70953/etherscan" + }, + "64165": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/64165/etherscan" + }, + "49321": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/49321/etherscan" + }, + "80084": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/80084/etherscan" + }, + "84532": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/84532/etherscan" + }, + "70805": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/70805/etherscan" + }, + "421614": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/421614/etherscan" + }, + "11155111": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/11155111/etherscan" + }, + "1946": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/1946/etherscan" + }, + "17000": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/17000/etherscan" + }, + "11155420": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/11155420/etherscan" + }, + "16": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/16/etherscan" + }, + "168587773": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/168587773/etherscan" + }, + "919": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/919/etherscan" + }, + "999999999": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/999999999/etherscan" + }, + "4801": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/4801/etherscan" + }, + "2233": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/2233/etherscan" + }, + "114": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/114/etherscan" + }, + "4460": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/4460/etherscan" + }, + "2522": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/2522/etherscan" + }, + "20241133": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/20241133/etherscan" + }, + "233": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/233/etherscan" + }, + "28122024": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/28122024/etherscan" + }, + "10888": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/10888/etherscan" + }, + "80008": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/80008/etherscan" + }, + "3397901": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/3397901/etherscan" + }, + "9728": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/9728/etherscan" + }, + "1687": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/1687/etherscan" + }, + "28882": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/28882/etherscan" + }, + "88882": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/88882/etherscan" + }, + "43113": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/43113/etherscan" + }, + "164": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/164/etherscan" + }, + "111557560": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/111557560/etherscan" + }, + "167009": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/167009/etherscan" + }, + "920637907288165": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/920637907288165/etherscan" + }, + "153": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/153/etherscan" + }, + "335": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/335/etherscan" + }, + "432201": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/432201/etherscan" + }, + "9270": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/9270/etherscan" + }, + "7589": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/7589/etherscan" + }, + "686669576": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/686669576/etherscan" + }, + "431234": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/431234/etherscan" + }, + "3939": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/3939/etherscan" + }, + "26659": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/26659/etherscan" + }, + "3012": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/3012/etherscan" + }, + "555666": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/555666/etherscan" + }, + "7210": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/7210/etherscan" + }, + "173750": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/173750/etherscan" + }, + "7222": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/7222/etherscan" + }, + "779672": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/779672/etherscan" + }, + "749": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/749/etherscan" + }, + "167008": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/167008/etherscan" + }, + "31335": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/31335/etherscan" + }, + "80085": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/80085/etherscan" + }, + "10880": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/10880/etherscan" + }, + "55551": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/55551/etherscan" + }, + "25043": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/25043/etherscan" + }, + "8082": { + "apiUrl": "https://api.routescan.io/v2/network/testnet/evm/8082/etherscan" + } } } diff --git a/apps/contract-verification/src/app/utils/default-settings.ts b/apps/contract-verification/src/app/utils/default-settings.ts index 8ea1efac22..be818cae3c 100644 --- a/apps/contract-verification/src/app/utils/default-settings.ts +++ b/apps/contract-verification/src/app/utils/default-settings.ts @@ -13,6 +13,8 @@ export function mergeChainSettingsWithDefaults(chainId: string, userSettings: Co let defaultsForVerifier: VerifierSettings if (verifierId === 'Sourcify') { defaultsForVerifier = DEFAULT_APIS['Sourcify'] + } else if (verifierId === 'Routescan') { + defaultsForVerifier = { ...DEFAULT_APIS['Routescan'][chainId], explorerUrl: DEFAULT_APIS['Routescan'].explorerUrl } } else { defaultsForVerifier = DEFAULT_APIS[verifierId][chainId] ?? {} } diff --git a/apps/contract-verification/src/app/views/LookupView.tsx b/apps/contract-verification/src/app/views/LookupView.tsx index de09888718..120dd1574c 100644 --- a/apps/contract-verification/src/app/views/LookupView.tsx +++ b/apps/contract-verification/src/app/views/LookupView.tsx @@ -61,9 +61,9 @@ export const LookupView = () => { } const sendToMatomo = async (eventAction: string, eventName: string) => { - await clientInstance.call('matomo' as any, 'track', ['trackEvent', 'ContractVerification', eventAction, eventName]); + await clientInstance.call('matomo' as any, 'track', ['trackEvent', 'ContractVerification', eventAction, eventName]) } - + const handleOpenInRemix = async (lookupResponse: LookupResponse) => { for (const source of lookupResponse.sourceFiles ?? []) { try { @@ -74,7 +74,7 @@ export const LookupView = () => { } try { await clientInstance.call('fileManager', 'open', lookupResponse.targetFilePath) - await sendToMatomo('lookup', "openInRemix On: " + selectedChain) + await sendToMatomo('lookup', 'openInRemix On: ' + selectedChain) } catch (err) { console.error(`Error focusing file ${lookupResponse.targetFilePath}: ${err.message}`) } @@ -84,20 +84,13 @@ export const LookupView = () => { <>
    - +
    - { chainSettings && + {chainSettings && VERIFIERS.map((verifierId) => { if (!validConfiguration(chainSettings, verifierId)) { return ( @@ -131,8 +124,9 @@ export const LookupView = () => { return (
    -
    - {verifierId} {chainSettings.verifiers[verifierId].apiUrl} +
    + {verifierId}  + {chainSettings.verifiers[verifierId].apiUrl}
    {!!loadingVerifiers[verifierId] && (
    @@ -159,8 +153,7 @@ export const LookupView = () => { )}
    ) - }) - } + })}
    ) diff --git a/apps/contract-verification/src/app/views/ReceiptsView.tsx b/apps/contract-verification/src/app/views/ReceiptsView.tsx index c24b63ca6b..70a39631b3 100644 --- a/apps/contract-verification/src/app/views/ReceiptsView.tsx +++ b/apps/contract-verification/src/app/views/ReceiptsView.tsx @@ -9,7 +9,7 @@ export const ReceiptsView = () => { return (
    {contracts.length > 0 ? contracts.map((contract, index) => ( - + )) :
    No contracts submitted for verification
    }
    ) diff --git a/apps/contract-verification/src/app/views/SettingsView.tsx b/apps/contract-verification/src/app/views/SettingsView.tsx index a4511a6216..e96c9187ed 100644 --- a/apps/contract-verification/src/app/views/SettingsView.tsx +++ b/apps/contract-verification/src/app/views/SettingsView.tsx @@ -47,6 +47,12 @@ export const SettingsView = () => { Blockscout - {selectedChain.name} handleChange('Blockscout', 'apiUrl', result)} />
    +
    + Routescan - {selectedChain.name} + handleChange('Routescan', 'apiKey', result)} /> + handleChange('Routescan', 'apiUrl', result)} /> + handleChange('Routescan', 'explorerUrl', result)} /> +
    )} diff --git a/apps/contract-verification/src/app/views/VerifyView.tsx b/apps/contract-verification/src/app/views/VerifyView.tsx index a924a2a89a..1939712b9b 100644 --- a/apps/contract-verification/src/app/views/VerifyView.tsx +++ b/apps/contract-verification/src/app/views/VerifyView.tsx @@ -41,14 +41,13 @@ export const VerifyView = () => { setEnabledVerifiers({ ...enabledVerifiers, [verifierId]: checked }) } - const sendToMatomo = async (eventAction: string, eventName: string) => { await clientInstance.call("matomo" as any, 'track', ['trackEvent', 'ContractVerification', eventAction, eventName]); } const handleVerify = async (e) => { e.preventDefault() - + const { triggerFilePath, filePath, contractName } = selectedContract const compilerAbstract = compilationOutput[triggerFilePath] if (!compilerAbstract) { @@ -68,9 +67,10 @@ export const VerifyView = () => { name: verifierId as VerifierIdentifier, } receipts.push({ verifierInfo, status: 'pending', contractId, isProxyReceipt: false, failedChecks: 0 }) - if (enabledVerifiers.Blockscout) await sendToMatomo('verify', "verifyWith: Blockscout On: " + selectedChain?.chainId + " IsProxy: " + (hasProxy && !proxyAddress)) - if (enabledVerifiers.Etherscan) await sendToMatomo('verify', "verifyWithEtherscan On: " + selectedChain?.chainId + " IsProxy: " + (hasProxy && !proxyAddress)) - if (enabledVerifiers.Sourcify) await sendToMatomo('verify', "verifyWithSourcify On: " + selectedChain?.chainId + " IsProxy: " + (hasProxy && !proxyAddress)) + if (enabledVerifiers.Blockscout) await sendToMatomo('verify', "verifyWith: Blockscout On: " + selectedChain?.chainId + " IsProxy: " + (hasProxy && proxyAddress)) + if (enabledVerifiers.Etherscan) await sendToMatomo('verify', "verifyWithEtherscan On: " + selectedChain?.chainId + " IsProxy: " + (hasProxy && proxyAddress)) + if (enabledVerifiers.Sourcify) await sendToMatomo('verify', "verifyWithSourcify On: " + selectedChain?.chainId + " IsProxy: " + (hasProxy && proxyAddress)) + if (enabledVerifiers.Routescan) await sendToMatomo('verify', "verifyWithRoutescan On: " + selectedChain?.chainId + " IsProxy: " + (hasProxy && proxyAddress)) } const newSubmittedContract: SubmittedContract = { @@ -256,7 +256,7 @@ export const VerifyView = () => { ) : ( - {chainSettings.verifiers[verifierId].apiUrl} + {chainSettings.verifiers[verifierId].apiUrl} )} @@ -269,7 +269,7 @@ export const VerifyView = () => { !selectedContract ? "Please select the contract (compile if needed)." : ((hasProxy && !!proxyAddressError) || (hasProxy && !proxyAddress)) ? "Please provide a valid proxy contract address." : "Please provide all necessary data to verify") // Is not expected to be a case - : "Verify with selected tools"}> + : "Verify with selected tools"}>