From: Ardis Lu Date: Fri, 5 Jun 2026 06:16:07 +0000 (-0700) Subject: Check for `viaIR` Solidity prologue X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=e64bb1ba42db2aa0ba6a30d227ebbdc31e269a38;p=solc-metadata Check for `viaIR` Solidity prologue --- diff --git a/index.js b/index.js index 4c3024e..dbd3757 100644 --- a/index.js +++ b/index.js @@ -32,9 +32,11 @@ async function fetchBytecode(address, rpc) { */ function detectLanguage(bytecode) { const prefix = bytecode.replace('0x', '').substring(0, 10); + const viaIRPrefix = bytecode.replace('0x', '').substring(0, 12); // https://github.com/banteg/erigon-kv/blob/5584ada83c75b244e611641d100ccc647a7f6791/examples/compilers.py#L17 - if (prefix === '6060604052' || prefix === '6080604052') { + // viaIRPrefix happens when optimizer viaIR=true + if (prefix === '6060604052' || prefix === '6080604052' || viaIRPrefix === '608080604052') { return 'solidity'; } else if (prefix === '6004361015' || prefix === '341561000a') {