Skip to main content

ContractCallLocalQuery

Call a function of the given smart contract instance, giving it functionParameters as its inputs. It will consume the entire given amount of gas.
FieldTypeDescription
headerQueryHeaderStandard info sent from client to node, including the signed payment, and what kind of response is requested (cost, state proof, both, or neither). The payment must cover the fees and all of the gas offered.
contractIDContractIDThe contract to make a static call against
gasint64The amount of gas to use for the call. All of the gas offered will be charged for.
functionParametersbytesWhich function to call, and the parameters to pass to the function
maxResultSizeint64Max number of bytes that the result might include. The run will fail if it would have returned more than this number of bytes. [deprecated 0.20.0]

ContractCallLocalResponse

Response when the client sends the node ContractCallLocalQuery
FieldTypeDescription
headerResponseHeaderstandard response from node to client, including the requested fields: cost, or state proof, or both, or neither
functionResultContractFunctionResultthe value returned by the function (if it completed and didn’t fail)

ContractFunctionResult

The result returned by a call to a smart contract function. This is part of the response to a ContractCallLocal query, and is in the record for a ContractCall or ContractCreateInstance transaction. The ContractCreateInstance transaction record has the results of the call to the constructor.
FieldTypeDescription
contractIDContractIDThe smart contract instance whose function was called
contractCallResultbytesThe result returned by the function
errorMessagestringThe message in case there was an error during smart contract execution
bloombytesBloom filter for record
gasUseduint64Units of gas used to execute contract
logInfoContractLoginfoThe log info for events returned by the function
createdContractIDsrepeated ContractIDThe list of smart contracts that were created by the function call [deprecated]
stateChangesrepeated ContractStateChangeThe list of state reads and changes caused by this function call
evm_addressbytes

The 20-byte EVM address of the contract to call. Only populated after release 0.23, where each created contract will have its own record. There will be seperate chld record for each created contract.

Every contract has an EVM address determined by its shard.realm.num id. This address is as follows:

The first 4 bytes are the big-endian representation of the shard.

The next 8 bytes are the big-endian representation of the realm.

The final 8 bytes are the big-endian representation of the number.

Contracts created via CREATE2 have an additional, primary address that is derived from the EIP-1014 specification, and does not have a simple relation to a shard.realm.num id.

(Please do note that CREATE2 contracts can also be referenced by the three-part EVM address described above.)

gasint64The amount of gas available for the call, aka the gasLimit. This field should only be populated when the paired TransactionBody in the record stream is not a ContractCreateTransactionBody or a ContractCallTransactionBody.
amountint64Number of tinybars sent (the function must be payable if this is nonzero). This field should only be populated when the paired TransactionBody in the record stream is not a ContractCreateTransactionBody or a ContractCallTransactionBody.
functionParametersbytesThe parameters passed into the contract call. This field should only be populated when the paired TransactionBody in the record stream is not a ContractCreateTransactionBody or a ContractCallTransactionBody.
signerNonceint64The value of the signer account nonce. This value can be null.

ContractLoginfo

The log information for an event returned by a smart contract function call. One function call may return several such events.
FieldTypeDescription
contractIDContractIDAddress of a contract that emitted the event
bloombytesBloom filter for a particular log
topicrepeated bytesTopics of a particular event
databytesEvent data

ContractStateChange

The storage changes to a smart contract’s storage as a side effect of the function call.
FieldTypeDescription
contractIDContractIDThe contract to which the storage changes apply to
storageChangesrepeated StorageChangeThe list of storage changes

StorageChange

A storage slot change description.
FieldTypeDescription
slotbytesThe storage slot changed. Up to 32 bytes, big-endian, zero bytes left trimmed
valueReadbytesThe value read from the storage slot. Up to 32 bytes, big-endian, zero bytes left trimmed. Because of the way SSTORE operations are charged the slot is always read before being written to
valueWrittengoogle.protobuf.BytesValueThe new value written to the slot. Up to 32 bytes, big-endian, zero bytes left trimmed. If a value of zero is written the valueWritten will be present but the inner value will be absent. If a value was read and not written this value will not be present.