Call a smart contract function
Last updated
Last updated
The transaction calls a function of the given smart contract instance, giving it functionParameters
as its input. The call can use at maximum the given amount of gas – the paying account will not be charged for any unspent gas.
If this function results in data being stored, an amount of gas is calculated that reflects this storage burden.
The amount of gas used, as well as other attributes of the transaction, e.g. size, and number of signatures to be verified, determine the fee for the transaction – which is charged to the paying account.
Transaction Signing Requirements
The key of the transaction fee-paying account
Transaction Fees
Please see the transaction and query fees table for the base transaction fee
Please use the Hedera fee estimator to estimate your transaction fee cost
Method | Type | Description | Requirement |
---|---|---|---|
setContractId(<contractId>)
ContractID
The ID of the contract to call.
Required
setFunction(<name, params>)
String, ContractFunctionParameters
Which function to call and the parameters to pass to the function.
Required
setGas(<gas>)
long
The maximum amount of gas to use for the call.
Required
setPayableAmount(<amount>)
Hbar
Number of HBARs sent (the function must be payable if this is nonzero)
Optional