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
stdoutas a string,stderras a string, the full command executed as a list of strings, and the completedPopenobject used to callsolc.Arguments
solc_binary: Path | str- Location of the
solcbinary. If not given, the current default binary is used. stdin: str- Input to pass to
solcvia stdin source_filesList | Path | str- Solidity source file, or list of source files, to be compiled. Files may be given as strings or
Pathobjects. 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
SolcErrorif the process returns a different value. Defaults to0. **kwargsAnyFlags to be passed to solc. Keywords are converted to flags by prepending
--and replacing_with-, for example the keywordevm_versionbecomes--evm-version. Values may be given in the following formats:FalseorNone: 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_posixListorTuple: Elements in the sequence are converted to strings and joined with,