ApeWorX / py-solc-x

Python wrapper and version management tool for the solc Solidity compiler.
https://solcx.readthedocs.io/
MIT License
141 stars 49 forks source link

returning bytecode by setting output_values #139

Open john012343210 opened 2 years ago

john012343210 commented 2 years ago

hi ,

>>> import solcx
>>> solcx.compile_source(
...     "contract Foo { function bar() public { return; } }",
...     output_values=["abi", "bin-runtime"],
...     
... )
``` works fine

but ,

import solcx solcx.compile_source( ... "contract Foo { function bar() public { return; } }", ... output_values=["abi", "bytecode"], ...
... )

is not ok

pacrob commented 2 years ago

Available output_values are parsed from the solc help file. For solc v0.8.11, the line is:

--combined-json abi,asm,ast,bin,bin-runtime,devdoc,function-debug,function-debug-runtime,generated-sources,generated-sources-runtime,hashes,metadata,opcodes,srcmap,srcmap-runtime,storage-layout,userdoc

No bytcode there - maybe you want bin?