Usage: forc call [OPTIONS] [FUNCTION] [FUNCTION_ARGS]...
Options:
--abi
<ABI>
Path or URI to a JSON ABI file Required when making function calls or listing functions
--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
, --devnet
, --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
, --devnet
, --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.
--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
-h
, --help
Print help (see a summary with '-h')
-V
, --version
Print version
CONTRACT:
--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
<ADDRESS> The contract ID to call
FUNCTION: [FUNCTION] The function selector to call. The function selector is the name of the function to call (e.g. "transfer"). Not required when --list-functions is specified or when --amount is provided for direct transfer
[FUNCTION_ARGS]... Arguments to pass to the function
ACCOUNT OPTIONS:
--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
CALL PARAMETERS:
--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
EXECUTION:
--mode
<MODE>
Execution mode - determines if state changes are applied - dry-run
: No state changes, no gas fees, wallet is not used or validated - simulate
: No state changes, estimates gas, wallet is used but not validated - live
: State changes, gas fees apply, wallet is used and validated
[default: dry-run]
Possible values:
OPERATION:
--list-functions
List all available functions in the contract
OUTPUT:
-o
, --output
<OUTPUT>
Output format for the call result
[default: default]
Possible values:
-v...
Set verbosity levels; currently only supports max 2 levels - -v=1
: Print decoded logs - -v=2
: Additionally print receipts and script json
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--abi`
./contract-abi.json \
get_balance 0x0087675439e10a8351b1d5e4cf9d0ea6da77675623ff6b16470b5e3c58998423
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--abi`
./contract-abi.json \
get_balance 0x0087675439e10a8351b1d5e4cf9d0ea6da77675623ff6b16470b5e3c58998423 \
`-vv`
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--abi`
./contract-abi.json \
get_name
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--abi`
./contract-abi.json \
transfer 0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07 \
`--contracts`
0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--abi`
./contract-abi.json \
add 1 2 \
`--mode`
simulate
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--node-url`
"http://127.0.0.1:4000/v1/graphql" \
`--signing-key`
0x... \
`--abi`
./contract-abi.json \
add 1 2 \
`--mode`
dry-run
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--testnet`
\
`--wallet`
\
`--abi`
./contract-abi.json \
add 1 2 \
`--mode`
live
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--abi`
./contract-abi.json \
transfer 0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07 \
`--mode`
live \
`--amount`
100
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--abi`
./contract-abi.json \
transfer 0xf8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07 \
`--amount`
100 \
`--asset-id`
0x0087675439e10a8351b1d5e4cf9d0ea6da77675623ff6b16470b5e3c58998423 \
`--live`
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--abi`
./contract-abi.json \
`--list-functions`
forc call 0x0dcba78d7b09a1f77353f51367afd8b8ab94b5b2bb6c9437d9ba9eea47dede97 \
`--amount`
100 \
`--mode`
live