The Low-Level Process Wrapper¶
Along with the main compiler functions, you can also directly call solc
using the low-level wrapper.
-
solc_wrapper
(solc_binary=None, stdin=None, source_files=None, import_remappings=None, success_return_code=None, **kwargs)¶ Wrapper function for calling to
solc
.Returns the process
stdout
as a string,stderr
as a string, the full command executed as a list of strings, and the completedPopen
object used to callsolc
.Arguments
solc_binary
: Path | str- Location of the
solc
binary. If not given, the current default binary is used. stdin
: str- Input to pass to
solc
via stdin source_files
List | Path | str- Solidity source file, or list of source files, to be compiled. Files may be given as strings or
Path
objects. import_remappings
: Dict | List | str- Path remappings. May be given as a string or list of strings formatted as
"prefix=path"
or a dict of{"prefix": "path"}
success_return_code
: int- Expected exit code. Raises
SolcError
if the process returns a different value. Defaults to0
. **kwargs
AnyFlags to be passed to solc. Keywords are converted to flags by prepending
--
and replacing_
with-
, for example the keywordevm_version
becomes--evm-version
. Values may be given in the following formats:False
orNone
: The flag is ignoredTrue
: The flag is passed to the compiler without any argumentsstr
: The value is given as an argument without any modificationint
: The value is converted to a stringPath
: The value is converted to a string viaPath.as_posix
List
orTuple
: Elements in the sequence are converted to strings and joined with,