forc-deploy

Build profile options

USAGE:

forc deploy [OPTIONS] [SIGNING_KEY]

ARGS:

<SIGNING_KEY> Set the key to be used for signing

OPTIONS:

--ast

Print the generated Sway AST (Abstract Syntax Tree)

--build-profile <BUILD_PROFILE>

Name of the build profile to use.

If unspecified, forc will use debug build profile.

--dca-graph

Print the computed Sway DCA graph

--error-on-warnings

Treat warnings as errors

--finalized-asm

Print the finalized ASM.

This is the state of the ASM with registers allocated and optimisations applied.

-g, --output-debug <DEBUG_FILE>

If set, outputs source file mapping in JSON format

--gas-limit <LIMIT>

Gas limit for the transaction

[default: 100000000]

--gas-price <PRICE>

Gas price for the transaction

[default: 0]

-h, --help

Print help information

--intermediate-asm

Print the generated ASM.

This is the state of the ASM prior to performing register allocation and other ASM optimisations.

--ir

Print the generated Sway IR (Intermediate Representation)

--json-abi

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-abi-with-callpaths

Outputs json abi with callpaths instead of names for struct and enums

--json-storage-slots

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

--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

--maturity <MATURITY>

Block height until which tx cannot be included

[default: 0]

--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 [crate::default::NODE_URL]

[env: FUEL_NODE_URL=]

-o, --output-bin <BIN_FILE>

If set, outputs a binary file representing the script bytes

--offline

Offline mode, prevents Forc from using the network when managing dependencies. Meaning it will only try to use previously downloaded dependencies

--output-directory <OUTPUT_DIRECTORY>

The directory in which the sway compiler output artifacts are placed.

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

-p, --path <PATH>

Path to the project, if not specified, current working directory will be used

--random-salt

Generate a random salt for the contract. Useful for testing or deploying examples to a shared network

--release

Use release build plan. If a custom release plan is not specified, it is implicitly added to the manifest file.

If --build-profile is also provided, forc omits this flag and uses provided build-profile.

--salt <SALT>

Added salt used to derive the contract ID.

By default, this is 0x0000000000000000000000000000000000000000000000000000000000000000.

-t, --terse

Terse mode. Limited warning and error output

--time-phases

Output the time elapsed over each part of the compilation process

--unsigned

Do not sign the transaction

-V, --version

Print version information

EXAMPLE

You can use forc deploy, which triggers a contract deployment transaction and sends it to a running node.

Alternatively, you can deploy your Sway contract programmatically using fuels-rs, our Rust SDK.

You can find an example within our fuels-rs book.