Run

Usage: forc run [OPTIONS] [SIGNING_KEY]

Arguments: [SIGNING_KEY] Set the key to be used for signing

Options:

-p, --path <PATH>

Path to the project.

If not specified, current working directory will be used.

--offline

Offline mode.

Prevents Forc from using the network when managing dependencies. Meaning it will only try to use previously downloaded dependencies.

-t, --terse

Terse mode.

Limited warning and error output.

--output-directory <OUTPUT_DIRECTORY>

The directory in which Forc output artifacts are placed.

By default, this is <project-root>/out.

--locked

Requires that the Forc.lock file is up-to-date.

If the lock file is missing, or it needs to be updated, Forc will exit with an error.

--ipfs-node <IPFS_NODE>

The IPFS node to use for fetching IPFS sources.

[possible values: PUBLIC, LOCAL, <GATEWAY_URL>]

--json-abi

Minify JSON ABI files.

By default the JSON for ABIs is formatted for human readability. By using this option JSON output will be "minified", i.e. all on one line without whitespace.

--json-storage-slots

Minify JSON storage slot files.

By default the JSON for initial storage slots is formatted for human readability. By using this option JSON output will be "minified", i.e. all on one line without whitespace.

--ast

Print the generated Sway AST (Abstract Syntax Tree)

--dca-graph <DCA_GRAPH>

Print the computed Sway DCA (Dead Code Analysis) graph.

DCA graph is printed to the specified path. If specified '' graph is printed to the stdout.

--dca-graph-url-format <DCA_GRAPH_URL_FORMAT>

URL format to be used in the generated DCA graph .dot file.

Variables {path}, {line}, and {col} can be used in the provided format. An example for vscode would be: "vscode://file/{path}:{line}:{col}"

--asm <ASM>..>

Print the generated ASM (assembler).

Values that can be combined:

  • virtual: initial ASM with virtual registers and abstract control flow.
  • allocated: ASM with registers allocated, but still with abstract control flow.
  • abstract: short for both virtual and allocated ASM.
  • final: final ASM that gets serialized to the target VM bytecode.
  • all: short for virtual, allocated, and final ASM.

[possible values: virtual, allocated, abstract, final, all]

--bytecode

Print the bytecode.

This is the final output of the compiler.

--ir <IR>..>

Print the generated Sway IR (Intermediate Representation).

Values that can be combined:

  • initial: initial IR prior to any optimization passes.
  • final: final IR after applying all optimization passes.
  • : the name of an optimization pass. Prints the IR state after that pass.
  • all: short for initial, final, and all the optimization passes.
  • modified: print a requested optimization pass only if it has modified the IR.

[possible values: initial, final, all, modified, inline, simplify-cfg, sroa, dce, fn-dce, fn-dedup-release, fn-dedup-debug, mem2reg, memcpyopt, const-folding, arg-demotion, const-demotion, ret-demotion, misc-demotion]

--time-phases

Output the time elapsed over each part of the compilation process

--reverse-order

Output build errors and warnings in reverse order

--metrics-outfile <METRICS_OUTFILE>

Output compilation metrics into the specified file

--gas-price <PRICE>

Gas price for the transaction

--script-gas-limit <SCRIPT_GAS_LIMIT>

Gas limit for the transaction

--max-fee <MAX_FEE>

Max fee for the transaction

--maturity <MATURITY>

Block height until which tx cannot be included

[default: 0]

-o, --output-bin <BIN_FILE>

Create a binary file at the provided path representing the final bytecode

-g, --output-debug <DEBUG_FILE>

Create a file at the provided path containing debug information.

If the file extension is .json, JSON format is used. Otherwise, an .elf file containing DWARF format is emitted.

--build-profile <BUILD_PROFILE>

The name of the build profile to use

[default: debug]

--release

Use the release build profile.

The release profile can be customized in the manifest file.

--error-on-warnings

Treat warnings as errors

--node-url <NODE_URL>

The URL of the Fuel node to which we're submitting the transaction. If unspecified, checks the manifest's network table, then falls back to http://127.0.0.1:4000

You can also use --target, --testnet, or --mainnet to specify the Fuel node.

[env: FUEL_NODE_URL=]

--target <TARGET>

Use preset configurations for deploying to a specific target.

You can also use --node-url, --testnet, or --mainnet to specify the Fuel node.

Possible values are: [local, testnet, mainnet]

--testnet

Use preset configuration for testnet.

You can also use --node-url, --target, or --mainnet to specify the Fuel node.

--mainnet

Use preset configuration for mainnet.

You can also use --node-url, --target, or --testnet to specify the Fuel node.

-d, --data <DATA>

Hex string of data to input to script

--dry-run

Only craft transaction and print it out

-r, --pretty-print

Pretty-print the outputs from the node

--contract <CONTRACT>

32-byte contract ID that will be called during the transaction

--simulate

Execute the transaction and return the final mutated transaction along with receipts (which includes whether the transaction reverted or not). The transaction is not inserted in the node's view of the blockchain, (i.e. it does not affect the chain state)

--default-signer

Sign the transaction with default signer that is pre-funded by fuel-core. Useful for testing against local node

--unsigned

Deprecated in favor of --default-signer

--args <ARGS>

Arguments to pass into main function with forc run

--experimental <EXPERIMENTAL>

Comma separated list of all experimental features that will be enabled

[possible values: new_encoding]

--no-experimental <NO_EXPERIMENTAL>

Comma separated list of all experimental features that will be disabled

[possible values: new_encoding]

-h, --help

Print help (see a summary with '-h')

-V, --version

Print version