Skip to content

Commit

Permalink
Update forc README for recent out/ and lock file changes
Browse files Browse the repository at this point in the history
Related PRs #825, #796.
  • Loading branch information
mitchmindtree committed Mar 4, 2022
1 parent df01d1d commit ea4edbb
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions forc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,24 @@ A `tests/` directory is also created. The `Cargo.toml` in the root directory con

## Build (`forc build`)

Compiles Sway files.
Compile the sway files of the current project.

```console
$ forc build
Compiled script "my-fuel-project".
Bytecode size is 28 bytes.
```

The output produced will depend on the project's program type. Building script, predicate and contract projects will produce their bytecode in binary format `<project-name>.bin`. Building contracts and libraries will also produce the public ABI in JSON format `<project-name>-abi.json`.

By default, these artifacts are placed in the `out/` directory.

If a `Forc.lock` file did not yet exist, it will be created in order to pin each of the dependencies listed in `Forc.toml` to a specific commit or version.

## Update (`forc update`)

Updates each of the dependencies so that they point to the latest suitable commit or version given their dependency declaration. The result is written to the `Forc.lock` file.

## Test (`forc test`)

You can write tests in Rust using our [Rust SDK](https://github.com/FuelLabs/fuels-rs). These tests can be run using `forc test`, which will look for Rust tests under the `tests/` directory (which is created automatically with `forc init`).
Expand Down Expand Up @@ -147,10 +157,6 @@ let compiled = Contract::compile_sway_contract("./", salt).unwrap();
let (client, contract_id) = Contract::launch_and_deploy(&compiled).await.unwrap();
```

## Update (`forc update`)

Update dependencies in the Forc dependencies directory.

## Format (`forc fmt`)

Format all Sway files of the current project.
Expand Down

0 comments on commit ea4edbb

Please sign in to comment.