From 53f1229703bc0a455cc4813ae54a8ff0d4f789f8 Mon Sep 17 00:00:00 2001 From: Manuel Wedler Date: Wed, 30 Oct 2024 15:03:21 +0100 Subject: [PATCH 1/4] verification plugin: Add Routescan verifier --- .../src/app/Verifiers/AbstractVerifier.ts | 2 +- .../src/app/Verifiers/BlockscoutVerifier.ts | 2 +- .../src/app/Verifiers/EtherscanVerifier.ts | 22 +- .../src/app/Verifiers/RoutescanVerifier.ts | 14 + .../src/app/Verifiers/index.ts | 4 + .../src/app/components/AccordionReceipt.tsx | 2 +- .../src/app/types/VerificationTypes.ts | 4 +- .../src/app/utils/default-apis.json | 324 ++++++++++++++++++ .../src/app/utils/default-settings.ts | 2 + .../src/app/views/LookupView.tsx | 25 +- .../src/app/views/ReceiptsView.tsx | 2 +- .../src/app/views/SettingsView.tsx | 6 + .../src/app/views/VerifyView.tsx | 14 +- 13 files changed, 385 insertions(+), 38 deletions(-) create mode 100644 apps/contract-verification/src/app/Verifiers/RoutescanVerifier.ts 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"}> From ada29e24bac2741f11149b631193d1b3bfc1f5e9 Mon Sep 17 00:00:00 2001 From: Manuel Wedler Date: Wed, 30 Oct 2024 15:20:04 +0100 Subject: [PATCH 2/4] verification plugin: Fix Matomo event to only send once per enabled verifier --- apps/contract-verification/src/app/views/VerifyView.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/contract-verification/src/app/views/VerifyView.tsx b/apps/contract-verification/src/app/views/VerifyView.tsx index 1939712b9b..755659a400 100644 --- a/apps/contract-verification/src/app/views/VerifyView.tsx +++ b/apps/contract-verification/src/app/views/VerifyView.tsx @@ -67,10 +67,7 @@ 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.Routescan) await sendToMatomo('verify', "verifyWithRoutescan On: " + selectedChain?.chainId + " IsProxy: " + (hasProxy && proxyAddress)) + await sendToMatomo('verify', `verifyWith${verifierId} On: ${selectedChain?.chainId} IsProxy: ${hasProxy && proxyAddress}`) } const newSubmittedContract: SubmittedContract = { From 3dfc291b9524db3ed07d0d66f50698345ed34c2f Mon Sep 17 00:00:00 2001 From: Manuel Wedler Date: Mon, 4 Nov 2024 12:19:35 +0100 Subject: [PATCH 3/4] Generate default Routescan API and explorer URLs dynamically --- .../src/app/utils/default-apis.json | 432 +++++------------- .../src/app/utils/default-settings.ts | 11 +- 2 files changed, 120 insertions(+), 323 deletions(-) diff --git a/apps/contract-verification/src/app/utils/default-apis.json b/apps/contract-verification/src/app/utils/default-apis.json index b20059f57b..207f9cc389 100644 --- a/apps/contract-verification/src/app/utils/default-apis.json +++ b/apps/contract-verification/src/app/utils/default-apis.json @@ -574,327 +574,115 @@ } }, "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" - } + "mainnetExplorerUrl": "https://routescan.io", + "testnetExplorerUrl": "https://testnet.routescan.io", + "apiUrl": "https://api.routescan.io/v2/network/${CHAIN_TYPE}/evm/${CHAIN_ID}/etherscan", + "8453": { "type": "mainnet" }, + "167000": { "type": "mainnet" }, + "357": { "type": "mainnet" }, + "1": { "type": "mainnet" }, + "19": { "type": "mainnet" }, + "10": { "type": "mainnet" }, + "81457": { "type": "mainnet" }, + "53935": { "type": "mainnet" }, + "432204": { "type": "mainnet" }, + "480": { "type": "mainnet" }, + "14": { "type": "mainnet" }, + "5000": { "type": "mainnet" }, + "254": { "type": "mainnet" }, + "43114": { "type": "mainnet" }, + "7777777": { "type": "mainnet" }, + "324": { "type": "mainnet" }, + "7560": { "type": "mainnet" }, + "185": { "type": "mainnet" }, + "888888888": { "type": "mainnet" }, + "34443": { "type": "mainnet" }, + "88888": { "type": "mainnet" }, + "20240603": { "type": "mainnet" }, + "6119": { "type": "mainnet" }, + "291": { "type": "mainnet" }, + "252": { "type": "mainnet" }, + "1088": { "type": "mainnet" }, + "8008": { "type": "mainnet" }, + "288": { "type": "mainnet" }, + "65536": { "type": "mainnet" }, + "424": { "type": "mainnet" }, + "183": { "type": "mainnet" }, + "33979": { "type": "mainnet" }, + "10849": { "type": "mainnet" }, + "2044": { "type": "mainnet" }, + "8888": { "type": "mainnet" }, + "1853": { "type": "mainnet" }, + "56288": { "type": "mainnet" }, + "710420": { "type": "mainnet" }, + "4337": { "type": "mainnet" }, + "333000333": { "type": "mainnet" }, + "3011": { "type": "mainnet" }, + "1234": { "type": "mainnet" }, + "504441": { "type": "mainnet" }, + "7887": { "type": "mainnet" }, + "7979": { "type": "mainnet" }, + "10507": { "type": "mainnet" }, + "5566": { "type": "mainnet" }, + "151": { "type": "mainnet" }, + "62707": { "type": "mainnet" }, + "70953": { "type": "mainnet" }, + "64165": { "type": "testnet" }, + "49321": { "type": "testnet" }, + "80084": { "type": "testnet" }, + "84532": { "type": "testnet" }, + "70805": { "type": "testnet" }, + "421614": { "type": "testnet" }, + "11155111": { "type": "testnet" }, + "1946": { "type": "testnet" }, + "17000": { "type": "testnet" }, + "11155420": { "type": "testnet" }, + "16": { "type": "testnet" }, + "168587773": { "type": "testnet" }, + "919": { "type": "testnet" }, + "999999999": { "type": "testnet" }, + "4801": { "type": "testnet" }, + "2233": { "type": "testnet" }, + "114": { "type": "testnet" }, + "4460": { "type": "testnet" }, + "2522": { "type": "testnet" }, + "20241133": { "type": "testnet" }, + "233": { "type": "testnet" }, + "28122024": { "type": "testnet" }, + "10888": { "type": "testnet" }, + "80008": { "type": "testnet" }, + "3397901": { "type": "testnet" }, + "9728": { "type": "testnet" }, + "1687": { "type": "testnet" }, + "28882": { "type": "testnet" }, + "88882": { "type": "testnet" }, + "43113": { "type": "testnet" }, + "164": { "type": "testnet" }, + "111557560": { "type": "testnet" }, + "167009": { "type": "testnet" }, + "920637907288165": { "type": "testnet" }, + "153": { "type": "testnet" }, + "335": { "type": "testnet" }, + "432201": { "type": "testnet" }, + "9270": { "type": "testnet" }, + "7589": { "type": "testnet" }, + "686669576": { "type": "testnet" }, + "431234": { "type": "testnet" }, + "3939": { "type": "testnet" }, + "26659": { "type": "testnet" }, + "3012": { "type": "testnet" }, + "555666": { "type": "testnet" }, + "7210": { "type": "testnet" }, + "173750": { "type": "testnet" }, + "7222": { "type": "testnet" }, + "779672": { "type": "testnet" }, + "749": { "type": "testnet" }, + "167008": { "type": "testnet" }, + "31335": { "type": "testnet" }, + "80085": { "type": "testnet" }, + "10880": { "type": "testnet" }, + "55551": { "type": "testnet" }, + "25043": { "type": "testnet" }, + "8082": { "type": "testnet" } } } diff --git a/apps/contract-verification/src/app/utils/default-settings.ts b/apps/contract-verification/src/app/utils/default-settings.ts index be818cae3c..e570f969db 100644 --- a/apps/contract-verification/src/app/utils/default-settings.ts +++ b/apps/contract-verification/src/app/utils/default-settings.ts @@ -14,7 +14,16 @@ export function mergeChainSettingsWithDefaults(chainId: string, userSettings: Co if (verifierId === 'Sourcify') { defaultsForVerifier = DEFAULT_APIS['Sourcify'] } else if (verifierId === 'Routescan') { - defaultsForVerifier = { ...DEFAULT_APIS['Routescan'][chainId], explorerUrl: DEFAULT_APIS['Routescan'].explorerUrl } + const routescanDefaults = DEFAULT_APIS['Routescan'] + + if (!routescanDefaults[chainId]) { + defaultsForVerifier = {} + + } else { + const explorerUrl = routescanDefaults[chainId]?.type === 'mainnet' ? routescanDefaults.mainnetExplorerUrl : routescanDefaults.testnetExplorerUrl + const apiUrl = routescanDefaults.apiUrl.replace('${CHAIN_TYPE}', routescanDefaults[chainId]?.type).replace('${CHAIN_ID}', chainId) + defaultsForVerifier = { explorerUrl, apiUrl } + } } else { defaultsForVerifier = DEFAULT_APIS[verifierId][chainId] ?? {} } From 71abc4796424c8fd9afda813e4745a93826389da Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 4 Nov 2024 15:51:45 +0100 Subject: [PATCH 4/4] increase timeout --- apps/remix-ide-e2e/nightwatch-chrome.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/nightwatch-chrome.ts b/apps/remix-ide-e2e/nightwatch-chrome.ts index 235fe625bb..f1b95992eb 100644 --- a/apps/remix-ide-e2e/nightwatch-chrome.ts +++ b/apps/remix-ide-e2e/nightwatch-chrome.ts @@ -21,7 +21,7 @@ module.exports = { 'default': { globals: { waitForConditionTimeout: 10000, - asyncHookTimeout: 120000 + asyncHookTimeout: 10000000 }, screenshots: { enabled: true,