Generate default Routescan API and explorer URLs dynamically

pull/5372/head
Manuel Wedler 3 weeks ago committed by Aniket
parent ada29e24ba
commit 3dfc291b95
  1. 432
      apps/contract-verification/src/app/utils/default-apis.json
  2. 11
      apps/contract-verification/src/app/utils/default-settings.ts

@ -574,327 +574,115 @@
} }
}, },
"Routescan": { "Routescan": {
"explorerUrl": "https://routescan.io", "mainnetExplorerUrl": "https://routescan.io",
"8453": { "testnetExplorerUrl": "https://testnet.routescan.io",
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/8453/etherscan" "apiUrl": "https://api.routescan.io/v2/network/${CHAIN_TYPE}/evm/${CHAIN_ID}/etherscan",
}, "8453": { "type": "mainnet" },
"167000": { "167000": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/167000/etherscan" "357": { "type": "mainnet" },
}, "1": { "type": "mainnet" },
"357": { "19": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/357/etherscan" "10": { "type": "mainnet" },
}, "81457": { "type": "mainnet" },
"1": { "53935": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/1/etherscan" "432204": { "type": "mainnet" },
}, "480": { "type": "mainnet" },
"19": { "14": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/19/etherscan" "5000": { "type": "mainnet" },
}, "254": { "type": "mainnet" },
"10": { "43114": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/10/etherscan" "7777777": { "type": "mainnet" },
}, "324": { "type": "mainnet" },
"81457": { "7560": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/81457/etherscan" "185": { "type": "mainnet" },
}, "888888888": { "type": "mainnet" },
"53935": { "34443": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/53935/etherscan" "88888": { "type": "mainnet" },
}, "20240603": { "type": "mainnet" },
"432204": { "6119": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/432204/etherscan" "291": { "type": "mainnet" },
}, "252": { "type": "mainnet" },
"480": { "1088": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/480/etherscan" "8008": { "type": "mainnet" },
}, "288": { "type": "mainnet" },
"14": { "65536": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/14/etherscan" "424": { "type": "mainnet" },
}, "183": { "type": "mainnet" },
"5000": { "33979": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/5000/etherscan" "10849": { "type": "mainnet" },
}, "2044": { "type": "mainnet" },
"254": { "8888": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/254/etherscan" "1853": { "type": "mainnet" },
}, "56288": { "type": "mainnet" },
"43114": { "710420": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan" "4337": { "type": "mainnet" },
}, "333000333": { "type": "mainnet" },
"7777777": { "3011": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/7777777/etherscan" "1234": { "type": "mainnet" },
}, "504441": { "type": "mainnet" },
"324": { "7887": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/324/etherscan" "7979": { "type": "mainnet" },
}, "10507": { "type": "mainnet" },
"7560": { "5566": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/7560/etherscan" "151": { "type": "mainnet" },
}, "62707": { "type": "mainnet" },
"185": { "70953": { "type": "mainnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/185/etherscan" "64165": { "type": "testnet" },
}, "49321": { "type": "testnet" },
"888888888": { "80084": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/888888888/etherscan" "84532": { "type": "testnet" },
}, "70805": { "type": "testnet" },
"34443": { "421614": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/34443/etherscan" "11155111": { "type": "testnet" },
}, "1946": { "type": "testnet" },
"88888": { "17000": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/88888/etherscan" "11155420": { "type": "testnet" },
}, "16": { "type": "testnet" },
"20240603": { "168587773": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/20240603/etherscan" "919": { "type": "testnet" },
}, "999999999": { "type": "testnet" },
"6119": { "4801": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/6119/etherscan" "2233": { "type": "testnet" },
}, "114": { "type": "testnet" },
"291": { "4460": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/291/etherscan" "2522": { "type": "testnet" },
}, "20241133": { "type": "testnet" },
"252": { "233": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/252/etherscan" "28122024": { "type": "testnet" },
}, "10888": { "type": "testnet" },
"1088": { "80008": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan" "3397901": { "type": "testnet" },
}, "9728": { "type": "testnet" },
"8008": { "1687": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/8008/etherscan" "28882": { "type": "testnet" },
}, "88882": { "type": "testnet" },
"288": { "43113": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/288/etherscan" "164": { "type": "testnet" },
}, "111557560": { "type": "testnet" },
"65536": { "167009": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/65536/etherscan" "920637907288165": { "type": "testnet" },
}, "153": { "type": "testnet" },
"424": { "335": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/424/etherscan" "432201": { "type": "testnet" },
}, "9270": { "type": "testnet" },
"183": { "7589": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/183/etherscan" "686669576": { "type": "testnet" },
}, "431234": { "type": "testnet" },
"33979": { "3939": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/33979/etherscan" "26659": { "type": "testnet" },
}, "3012": { "type": "testnet" },
"10849": { "555666": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/10849/etherscan" "7210": { "type": "testnet" },
}, "173750": { "type": "testnet" },
"2044": { "7222": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/2044/etherscan" "779672": { "type": "testnet" },
}, "749": { "type": "testnet" },
"8888": { "167008": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/8888/etherscan" "31335": { "type": "testnet" },
}, "80085": { "type": "testnet" },
"1853": { "10880": { "type": "testnet" },
"apiUrl": "https://api.routescan.io/v2/network/mainnet/evm/1853/etherscan" "55551": { "type": "testnet" },
}, "25043": { "type": "testnet" },
"56288": { "8082": { "type": "testnet" }
"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"
}
} }
} }

@ -14,7 +14,16 @@ export function mergeChainSettingsWithDefaults(chainId: string, userSettings: Co
if (verifierId === 'Sourcify') { if (verifierId === 'Sourcify') {
defaultsForVerifier = DEFAULT_APIS['Sourcify'] defaultsForVerifier = DEFAULT_APIS['Sourcify']
} else if (verifierId === 'Routescan') { } 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 { } else {
defaultsForVerifier = DEFAULT_APIS[verifierId][chainId] ?? {} defaultsForVerifier = DEFAULT_APIS[verifierId][chainId] ?? {}
} }

Loading…
Cancel
Save