solc-js icon indicating copy to clipboard operation
solc-js copied to clipboard

Why is `solc.lowlevel.compileCallback` `null` on solc 0.8.12?

Open Y-Zeus opened this issue 3 years ago • 3 comments

const solc = require('solc');

if (typeof solc.lowlevel.compileSingle != 'function') {
		console.log('Low-level compileSingle interface not implemented by this compiler version.');
}

result:

TypeError: solc.lowlevel.compileCallback is not a function

solc version 0.8.12 why?

Y-Zeus avatar Mar 09 '22 09:03 Y-Zeus

These low-level functions were superseded by compile() and are no longer needed (https://github.com/ethereum/solidity/issues/3452). They were removed from the binary in 0.5.0 (https://github.com/ethereum/solidity/pull/5105).

The only reason they're still present under lowlevel is that solc-js is meant to support all compiler binaries, including the ones older than 0.5.0. The check will succeed if you use it with such a binary. For newer ones they're null.

But you have a point in that it's not explained in the README. We should make it clearer.

cameel avatar Mar 11 '22 22:03 cameel

thanks

Y-Zeus avatar Mar 14 '22 02:03 Y-Zeus

I'll keep this open. I think we should add something about it to the README.

cameel avatar Mar 14 '22 11:03 cameel

Fixed by https://github.com/ethereum/solc-js/pull/658.

r0qs avatar Mar 09 '23 16:03 r0qs