]> git.ardis.lu - solc-metadata/commitdiff
Check for `viaIR` Solidity prologue
authorArdis Lu <ardisglu@gmail.com>
Fri, 5 Jun 2026 06:16:07 +0000 (23:16 -0700)
committerArdis Lu <ardisglu@gmail.com>
Fri, 5 Jun 2026 06:16:07 +0000 (23:16 -0700)
index.js

index 4c3024ec9f32fe620f14ecf56df757f81944a1d9..dbd375757234985bc1960399d03c4db7084497dd 100644 (file)
--- 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') {
This page took 0.035638 seconds and 4 git commands to generate.