When the Starknet compiler is installed, you can view this command-line help in a terminal by entering the following command:
starknet-compile --help
starknet-compile [-h] [--abi ABI] [--disable_hint_validation]
[--account_contract] [--dont_filter_identifiers] [-v]
[--prime PRIME] [--cairo_path CAIRO_PATH]
[--preprocess] [--output OUTPUT] [--no_debug_info]
[--debug_info_with_source]
[--cairo_dependencies CAIRO_DEPENDENCIES]
[--no_opt_unused_functions]
file [file ...]
The following example compiles the file contract.cairo. It generates two files:
contract_compiled.json
The contract class. This file contains the bytecode and all other information necessary to execute a contract. For information on contract classes, see Contract classes.
contract_abi.json
The contract’s ABI.
starknet-compile contract.cairo \
--output contract_compiled.json \
--abi contract_abi.json
A tool to compile Starknet contracts.
File names.
Show this help message and exit.
Output the contract’s ABI.
Disable the hint validation.
Compile as account contract.
Disable the filter-identifiers-optimization.If True, all the identifiers will be kept, instead of just the ones mentioned in hints or 'with_attr' statements.
show program’s version number and exit
The size of the finite field.
A list of directories, separated by ":" to resolve import paths. The full list will consist of directories defined by this argument, followed by the environment variable CAIRO_PATH, the working directory and the standard library path.
Stop after the preprocessor step and output the preprocessed program.
The output file name (default: stdout).
Don’t include debug information in the compiled file.
Include debug information with a copy of the source code.
Output a list of the Cairo source files used during the compilation as a CMake file.
Disables unused function optimization.
