SOLC(1)
π¦ SOLC(1) π¦
okay bestie, sit down, hydrate, because this is the manual page for solc β that's the Solidity commandline compiler, sweetie β and it is version 0.8.38 π this lives in the User Commands corner of the manual, and it's giving main character energy for everyone compiling Solidity in a terminal. no cap.
πΈ NAME πΈ
solc β the manual page for solc 0.8.38. that's it. that's the name. iconic.
β¨ SYNOPSIS β¨
solc [options] [input_file...]
π DESCRIPTION π
solc, the Solidity commandline compiler. say hi π«Ά
okay so legally I have to tell you this and I will not be quiet about it: This program comes with ABSOLUTELY NO WARRANTY. β This is free software, and you are welcome to redistribute it under certain conditions. See solc --license for details. it's giving "read the fine print bestie" π
So here's the vibe: it compiles the Solidity input files you hand it β or, if you use - as a file name, it reads from standard input instead β and then it outputs the components you asked for in the options, either at standard output or into files in the output directory, if you specified one. Imports are automatically read from the filesystem, but it is also possible to remap paths using the context:prefix=path syntax. Example, because examples ate:
solc --bin -o /tmp/solcoutput dapp-bin=/usr/local/lib/dapp-bin contract.sol
yes bestie, that's real, that's the syntax, go be free π
π General Information π
--helpβ Show help message and exit. the classic. the goat.--versionβ Show version and exit. who are you? what do you contain? find out β¨--licenseβ Show licensing information and exit. the receipts π--input-filearg β input file. that's literally the whole description, and honestly? respect.
π₯ Input Options π₯
--base-pathpath β Use the given path as the root of the source tree instead of the root of the filesystem. your whole little world starts here π‘--include-pathpath β Make an additional source directory available to the default import callback. Use this option if you want to import contracts whose location is not fixed in relation to your main source tree, e.g. third-party libraries installed using a package manager. Can be used multiple times. Can only be used if base path has a non-empty value. (yes bestie, that's a hard requirement, no base path = no include path, that's the rule π)--allow-pathspath(s) β Allow a given path for imports. A list of paths can be supplied by separating them with a comma.--ignore-missingβ Ignore missing files. out of sight, out of mind, slay π--no-import-callbackβ Disable the default import callback to prevent the compiler from loading any source files not listed on the command line or given in the Standard JSON input. it's giving "you get NOTHING that I didn't hand you personally" π
π€ Output Options π€
-o,--output-dirpath β If given, creates one file per output component and contract/file at the specified directory.--overwriteβ Overwrite existing files (used together with-o). they're your files, do what you want π--evm-versionversion (=osaka) β Select desired EVM version:homestead,tangerineWhistle,spuriousDragon,byzantium,constantinople,petersburg,istanbul,berlin,london,paris,shanghai,cancun,prague,osaka,amsterdam(experimental), or@future(experimental). pick your timeline bestie β³--experimental-via-irβ Deprecated synonym of--via-ir. deprecated!! the old name, the legacy era, we don't talk about it β--via-irβ Turn on compilation via IR. we're going through the fancy intermediate representation now π§--via-ssa-cfgβ (experimental) Turn on SSA CFG-based code generation. Implies compilation via IR. experimental, so hold my hand π«Ά--revert-stringsdebug,default,strip,verboseDebugβ Strip revert (and require) reason strings or add additional debugging information. Note that'strip'does not remove custom errors. (that's a whole note, not me forgetting to mention it, iykyk)--debug-infoarg (=ast-id,location,snippet) β Debug info components to be included in the produced EVM assembly and Yul code. Value can be'all','none'or a comma-separated list containing one or more of the following components:ast-id,location,snippet, orethdebug(experimental). Note that'all'does not include experimental components. sneaky, right? π--stop-afterstage β Stop execution after the given compiler stage. Valid options:"parsing". one stage only, bestie, that's the whole list πΈ
π Alternative Input Modes π
--standard-jsonβ Switch to Standard JSON input / output mode, ignoring all options. It reads from standard input, if no input file was given, otherwise it reads from the provided input file. The result will be written to standard output. ignoring ALL options. everything you typed before? gone. irrelevant. astral projected π--linkβ Switch to linker mode, ignoring all options apart from--librariesand modify binaries in place. linker era, we only respect ONE flag here π--strict-assemblyβ Switch to strict assembly mode and assume input is strict assembly.--import-astβ (experimental) Resume compilation from an abstract syntax tree (AST) representing already parsed and analyzed Solidity code. In this mode the compiler expects exactly one input file, containing an AST in compact JSON format, as produced by--ast-compact-json,--ast astor the'ast'output in Standard JSON. exactly one file, bestie, not two, not zero π―--import-asm-jsonβ (experimental) Resume compilation from EVM assembly. In this mode the compiler expects exactly one input file, containing assembly in JSON format, as produced by--import-asm-jsonorthe'evm.legacyAssembly'output in Standard JSON.
WARNING:--import-asm-jsonoutput is already optimized according to settings stored in metadata. Using--optimizein this mode is allowed, but not necessary under normal circumstances.--optimizeforces the optimizer to run again and can produce bytecode that is not reproducible from metadata. this is the scary one, read it twice π₯
π Assembly Mode Options π
--machineevm β Target machine in assembly or Yul mode.--yul-dialectevm β Input dialect to use in assembly or yul mode.
π Linker Mode Options π
--librarieslibs β Direct string or file containing library addresses. Syntax:<libraryName>=<address>[, or whitespace]... Address is interpreted as a hex string prefixed by0x. keep the0xbestie, it's not optional π«Ά
π¨ Output Formatting π¨
--pretty-jsonβ Output JSON in pretty format. make it cute, make it readable β¨--json-indentN (=2) β Indent pretty-printed JSON with N spaces. Enables'--pretty-json'automatically. automatic glow-up π--colorβ Force colored output. rainbow mode, whether the terminal asked for it or not π--no-colorβ Explicitly disable colored output, disabling terminal auto-detection.--error-codesβ Output error codes.
π¦ Output Components π¦
--ast-compact-jsonβ AST of all source files in a compact JSON format.--asmβ EVM assembly of the contracts.--asm-jsonβ EVM assembly of the contracts in JSON format.--opcodesβ Opcodes of the contracts.--binβ Binary of the contracts in hex.--bin-runtimeβ Binary of the runtime part of the contracts in hex.--abiβ ABI specification of the contracts.--irβ Intermediate Representation (IR) of all contracts.--ir-ast-jsonβ (experimental) AST of Intermediate Representation (IR) of all contracts in a compact JSON format.--ir-optimizedβ Optimized Intermediate Representation (IR) of all contracts.--ir-optimized-ast-jsonβ (experimental) AST of optimized Intermediate Representation (IR) of all contracts in a compact JSON format.--hashesβ Function signature hashes of the contracts.--userdocβ Natspec user documentation of all contracts.--devdocβ Natspec developer documentation of all contracts.--metadataβ Combined Metadata JSON whose IPFS hash is stored on-chain.--storage-layoutβ Slots, offsets and types of the contract's state variables located in storage.--transient-storage-layoutβ Slots, offsets and types of the contract's state variables located in transient storage.--ethdebug-resourcesβ (experimental) Global ethdebug output (ethdebug/format/info/resourcesschema) containing source list and compiler info.--ethdebug-compilationβ (experimental) Global ethdebug compilation output (the'compilation'key fromethdebug/format/info/resourcesschema).--ethdebug-programβ (experimental) Debug information in ethdebug format for all contracts (ethdebug/format/programschema for creation bytecode).--ethdebug-program-runtimeβ (experimental) Debug information in ethdebug format for the runtime part of all contracts (ethdebug/format/programschema for deployed bytecode).
π Extra Output π
--gasβ Print an estimate of the maximal gas usage for each function. gas prices? in THIS economy? π--combined-jsonabi,asm,ast,bin,bin-runtime,devdoc,function-debug,function-debug-runtime,generated-sources,generated-sources-runtime,hashes,metadata,opcodes,srcmap,srcmap-runtime,storage-layout,transient-storage-layout,userdocβ Output a single json document containing the specified information. one doc, all your faves, little group chat of output data π
π· Metadata Options π·
--no-cbor-metadataβ Do not append CBOR metadata to the end of the bytecode.--metadata-hashipfs,none,swarmβ Choose hash method for the bytecode metadata or disable it.--metadata-literalβ Store referenced sources as literal data in the metadata output.
β‘ Optimizer Options β‘
--optimizeβ Enable optimizer. make it fast, make it tight π₯--optimize-runsn (=200) β The number of runs specifies roughly how often each opcode of the deployed code will be executed across the lifetime of the contract. Lower values will optimize more for initial deployment cost, higher values will optimize more for high-frequency usage. tl;dr: small number = cheap deploy, big number = cheap everyday use. pick your struggle π--optimize-yulβ Enable Yul optimizer (independently of the EVM assembly optimizer). The general--optimizeoption automatically enables this unless--no-optimize-yulis specified.--no-optimize-yulβ Disable Yul optimizer (independently of the EVM assembly optimizer).--yul-optimizationssteps β Forces Yul optimizer to use the specified sequence of optimization steps instead of the built-in one. you wanna hand-craft the sequence? be my guest, icon π
π Model Checker Options π
--model-checker-contractsdefault,<source>:<contract>(=default) β Select which contracts should be analyzed using the form<source>:<contract>.Multiple pairs<source>:<contract>can be selected at the same time, separated by a comma and no spaces. no spaces, bestie, I said what I said β--model-checker-div-mod-no-slacksβ Encode division and modulo operations with their precise operators instead of multiplication with slack variables.--model-checker-engineall,bmc,chc,none(=none) β Select model checker engine.--model-checker-ext-callsuntrusted,trusted(=untrusted) β Select whether to assume (trusted) that external calls always invoke the code given by the type of the contract, if that code is available. trust issues? in MY compiler? it's more likely than you think π--model-checker-invariantsdefault,all,contract,reentrancy(=default) β Select whether to report inferred contract inductive invariants. Multiple types of invariants can be selected at the same time, separated by a comma and no spaces. By default no invariants are reported. (comma. no spaces. you know the drill π )--model-checker-print-queryβ Print the queries created by the SMTChecker in the SMTLIB2 format.--model-checker-show-proved-safeβ Show all targets that were proved safe separately.--model-checker-show-unprovedβ Show all unproved targets separately.
and bestie... there's more π this page keeps going, don't go anywhere πΈ
--model-checker-show-unsupportedβ shows every unsupported language feature separately, so you can see exactly which bits the model checker is side-eyeing π--model-checker-solvers cvc5,eld,z3,smtlib2 (=z3)β picks your model checker solvers, bestie β¨ the default isz3--model-checker-targets default,all,constantCondition,underflow,overflow,divByZero,balance,assert,popEmptyArray,outOfBounds (=default)β chooses what the model checker actually verifies π you can pick multiple targets at once: comma-separated, no spaces, periodt. By default, all targets exceptunderflowandoverfloware selected.--model-checker-timeout msβ sets the model checker timeout per query, in milliseconds β±οΈ the default is a deterministic resource limit. A timeout of0means no resource/time restrictions for any query β go absolutely feral, no cap π--model-checker-bmc-loop-iterations argβ sets the loop unrolling depth for the BMC engine π default is1
π§ͺ Experimental options π§ͺ
--experimentalβ turns on experimental mode π¦ lowkey important: this flag does not activate any experimental features on its own. What it does is unlock the ability to use them through the usual flags and pragmas. It's giving "key to the VIP room, but you still gotta walk in yourself" π
and that's the whole page, bestie π«Ά you read the entire thing, which is iconic behavior fr fr this was solc version 0.8.38, dated October 2026, page SOLC(1) π go compile something gorgeous π
π¦ where this page comes from
- fedora 43: solidity 0.8.38-1.fc43 Β· GPL-3.0-only
- fedora 44: solidity 0.8.38-1.fc44 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms