Skip to content

Commit

Permalink
Merge branch 'master' into k1-r1-f4
Browse files Browse the repository at this point in the history
  • Loading branch information
IGI-111 authored Mar 1, 2025
2 parents 262fce3 + 2097380 commit e725b3c
Show file tree
Hide file tree
Showing 18 changed files with 205 additions and 214 deletions.
5 changes: 4 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

111 changes: 0 additions & 111 deletions docs/book/src/forc/plugins/forc_client/forc_call.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,116 +55,6 @@ Where the following arguments are required:
- `SELECTOR` is the function name (selector) you want to call
- `ARGS` are the arguments to pass to the function

## CLI Reference

<details>
<summary><b>Forc Call CLI reference</b></summary>

```sh
forc call --help
```

```output
Perform Fuel RPC calls from the comfort of your command line
Usage: forc call [OPTIONS] --abi <ABI> <CONTRACT_ID> <FUNCTION> [FUNCTION_ARGS]...
Arguments:
<CONTRACT_ID>
The contract ID to call
<FUNCTION>
The function signature to call. When ABI is provided, this should be a selector (e.g. "transfer") When no ABI is provided, this should be the full function signature (e.g. "transfer(address,u64)")
[FUNCTION_ARGS]...
Arguments to pass into the function to be called
Options:
--abi <ABI>
Path or URI to a JSON ABI file
--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>
Preset configurations for using a specific target.
You can also use `--node-url`, `--testnet`, or `--mainnet` to specify the Fuel node.
Possible values are: [local, testnet, mainnet]
--mainnet
Use preset configuration for mainnet.
You can also use `--node-url`, `--target`, or `--testnet` to specify the Fuel node.
--testnet
Use preset configuration for testnet.
You can also use `--node-url`, `--target`, or `--mainnet` to specify the Fuel node.
--devnet
Use preset configuration for devnet.
You can also use `--node-url`, `--target`, or `--testnet` to specify the Fuel node.
--signing-key <SIGNING_KEY>
Derive an account from a secret key to make the call
[env: SIGNING_KEY=]
--wallet
Use forc-wallet to make the call
--amount <AMOUNT>
Amount of native assets to forward with the call
[default: 0]
--asset-id <ASSET_ID>
Asset ID to forward with the call
--gas-forwarded <GAS_FORWARDED>
Amount of gas to forward with the call
--mode <MODE>
The execution mode to use for the call; defaults to dry-run; possible values: dry-run, simulate, live
[default: dry-run]
--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
--tip <TIP>
The tip for the transaction
--external-contracts <EXTERNAL_CONTRACTS>
The external contract addresses to use for the call If none are provided, the call will automatically populate external contracts by making a dry-run calls to the node, and extract the contract addresses based on the revert reason
--output <OUTPUT>
The output format to use; possible values: default, raw
[default: default]
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
```

</details>

## Type Encoding

When passing arguments to contract functions, values are encoded according to their Sway types.
Expand Down Expand Up @@ -313,7 +203,6 @@ forc call <CONTRACT_ID> --abi <PATH> update_params 42 --live

The following features are planned for future releases:

- Decode and display logs for contract calls
- Support direct transfer of asset(s) to addresses
- Function signature based calls without ABI
- Raw calldata input support
Expand Down
2 changes: 1 addition & 1 deletion forc-pkg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ byte-unit.workspace = true
cid.workspace = true
flate2.workspace = true
forc-tracing.workspace = true
forc-util.workspace = true
forc-util = { workspace = true }
fuel-abi-types.workspace = true
futures.workspace = true
git2 = { workspace = true, features = ["vendored-libgit2", "vendored-openssl"] }
Expand Down
2 changes: 1 addition & 1 deletion forc-plugins/forc-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ forc.workspace = true
forc-pkg.workspace = true
forc-tracing.workspace = true
forc-tx.workspace = true
forc-util.workspace = true
forc-util = { workspace = true, features = ["tx"] }
forc-wallet.workspace = true
fuel-abi-types.workspace = true
fuel-core-client = { workspace = true, features = ["subscriptions"] }
Expand Down
4 changes: 4 additions & 0 deletions forc-plugins/forc-client/src/cmd/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ pub struct Command {
/// The output format to use; possible values: default, raw
#[clap(long, default_value = "default")]
pub output: OutputFormat,

/// Output call receipts
#[clap(long, short = 'r', alias = "receipts")]
pub show_receipts: bool,
}

fn parse_abi_path(s: &str) -> Result<Either<PathBuf, Url>, String> {
Expand Down
Loading

0 comments on commit e725b3c

Please sign in to comment.