apps/docs/src/guide/contracts/call-parameters.md
When interacting with contracts, you can configure specific parameters for contract calls using the callParams method. The available call parameters are:
forwardgasLimitNote: Setting transaction parameters is also available when calling contracts. More information on this can be found at Transaction Parameters.
The contract in use in this section has the following implementation:
<<< @/../../docs/sway/return-context/src/main.sw#return-context-contract{rust:line-numbers}
The forward parameter allows the sending of a specific amount of coins to a contract when a function is called. This is useful when a contract function requires coins for its execution, such as transferring funds to another account or contract.
The forward parameter helps you control the resources allocated to the contract call and offers protection against potentially costly operations.
<!-- forward:example:end --><<< @./snippets/call-parameters/forward.ts#forward{ts:line-numbers}
The gasLimit refers to the maximum amount of gas that can be consumed specifically by the contract call itself, separate from the rest of the transaction.
<<< @./snippets/call-parameters/gas-fee.ts#gas-fee{ts:line-numbers}
gasLimit vs Transaction Parameter gasLimitThe call parameter gasLimit sets the maximum gas allowed for the actual contract call, whereas the transaction parameter gasLimit (see Transaction Parameters) sets the maximum gas allowed for the entire transaction and constrains the gasLimit call parameter. If the call parameter gasLimit is set to a value greater than the available transaction gas, then the entire available transaction gas will be allocated for the contract call execution.
If you don't set the gasLimit for the call, the transaction gasLimit will be applied.
You can set both call parameters and transaction parameters within the same contract function call.
<<< @./snippets/call-parameters/setting-both-parameters.ts#setting-both-parameters{ts:line-numbers}