SOLC(1)

πŸ“¦
version 0.8.38 Β· 4 versions
, in fedora 43, fedora 44

πŸ¦‹ 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-file arg β€” input file. that's literally the whole description, and honestly? respect.

πŸ“₯ Input Options πŸ“₯

  • --base-path path β€” 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-path path β€” 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-paths path(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-dir path β€” 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-version version (=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-strings debug,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-info arg (=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, or ethdebug (experimental). Note that 'all' does not include experimental components. sneaky, right? πŸ’€
  • --stop-after stage β€” 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 --libraries and 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 ast or 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-jsonor the 'evm.legacyAssembly' output in Standard JSON.
WARNING: --import-asm-json output is already optimized according to settings stored in metadata. Using --optimize in this mode is allowed, but not necessary under normal circumstances. --optimize forces 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 πŸ› 

  • --machine evm β€” Target machine in assembly or Yul mode.
  • --yul-dialect evm β€” Input dialect to use in assembly or yul mode.

πŸ”— Linker Mode Options πŸ”—

  • --libraries libs β€” Direct string or file containing library addresses. Syntax: <libraryName>=<address> [, or whitespace] ... Address is interpreted as a hex string prefixed by 0x. keep the 0x bestie, it's not optional 🫢

🎨 Output Formatting 🎨

  • --pretty-json β€” Output JSON in pretty format. make it cute, make it readable ✨
  • --json-indent N (=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/resources schema) containing source list and compiler info.
  • --ethdebug-compilation β€” (experimental) Global ethdebug compilation output (the 'compilation' key from ethdebug/format/info/resources schema).
  • --ethdebug-program β€” (experimental) Debug information in ethdebug format for all contracts (ethdebug/format/program schema for creation bytecode).
  • --ethdebug-program-runtime β€” (experimental) Debug information in ethdebug format for the runtime part of all contracts (ethdebug/format/program schema for deployed bytecode).

🎁 Extra Output 🎁

  • --gas β€” Print an estimate of the maximal gas usage for each function. gas prices? in THIS economy? 😭
  • --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,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-hash ipfs,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-runs n (=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 --optimize option automatically enables this unless --no-optimize-yul is specified.
  • --no-optimize-yul β€” Disable Yul optimizer (independently of the EVM assembly optimizer).
  • --yul-optimizations steps β€” 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-contracts default,<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-engine all,bmc,chc,none (=none) β€” Select model checker engine.
  • --model-checker-ext-calls untrusted,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-invariants default,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 is z3
  • --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 except underflow and overflow are selected.
  • --model-checker-timeout ms β€” sets the model checker timeout per query, in milliseconds ⏱️ the default is a deterministic resource limit. A timeout of 0 means 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 is 1

πŸ§ͺ 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