ethereum / solc-js

Javascript bindings for the Solidity compiler
https://soliditylang.org
MIT License
1.45k stars 469 forks source link

Handle standard JSON transalation with `outputSelection` for `=<0.4.19` #690

Open kuzdogan opened 1 year ago

kuzdogan commented 1 year ago

We've come across an issue while recompiling a contract with 0.4.19 as laid out here: https://github.com/ethereum/sourcify/issues/1017

TLDR: The compiler gives empty JSON output without throwing because the outputSelection fields were introduced in 0.4.18 and updated in 0.4.19.

I believe the outputSelection field needs to be handled by the JSON translator translate.ts of solc-js for the earlier versions.