Call Contract

Invoke a smart contract.

This method will use 100 Compute Units.


Invoke a smart contract

post

Returns a result from EVM execution such as cost-free execution of read-only smart contract queries, gas estimation, and transient simulation of read-write operations. If estimate field is set to true gas estimation is executed. Currently we support only latest block.

The table below defines the restrictions and support for the endpoint

EstimateOperation TypeMirror Node Version
falsestatic contract state reads for non precompile functions0.78+
static contract state reads for precompile functions except allowance/isApprovedForAll0.78+
static contract state reads for precompile functions with allowance0.79+
static contract state reads for precompile functions with isApprovedForAll0.81+
non-static contract state reads for non precompile functions0.83+
non-static contract state reads for precompile read only functions0.83+
truenon-static contract state reads and modifications for non precompile functions except lazy account creation0.83+
non-static contract state reads and modifications for associate precompile functions0.83+
non-static contract state reads and modifications for non precompile functions with lazy account creation0.84+
non-static contract state reads and modifications for precompile functions except associateNot supported

The operations types which are not currently supported should return 501 error status.

Body
blockstring · nullableOptional

Hexadecimal block number or the string "latest", "pending", "earliest". Defaults to "latest".

Example: latestPattern: ^((0x)?[0-9a-fA-F]+|(earliest|pending|latest))$
datastring · binary · max: 12288 · nullableOptional

Hexadecimal method signature and encoded parameters.

Example: 0x0198489200000000000000000000000000000000000000000000000000000000000003eePattern: ^(0x)?[0-9a-fA-F]+$
estimateboolean · nullableOptional

Whether gas estimation is called. Defaults to false.

Example: true
fromstring · binary · min: 40 · max: 42 · nullableOptional

The 20-byte hexadecimal EVM address the transaction is sent from.

Example: 00000000000000000000000000000000000004e2Pattern: ^(0x)?[A-Fa-f0-9]{40}$
gasinteger · int64 · nullableOptional

Gas provided for the transaction execution. Defaults to 120000000.

Example: 120000000
gasPriceinteger · int64 · nullableOptional

Gas price used for each paid gas.

Example: 100000000
tostring · binary · min: 40 · max: 42Required

The 20-byte hexadecimal EVM address the transaction is directed to.

Example: 0x00000000000000000000000000000000000003f4Pattern: ^(0x)?[A-Fa-f0-9]{40}$
valueinteger · int64 · nullableOptional

Value sent with this transaction. Defaults to 0.

Example: 0
Responses
chevron-right
200

OK

application/json
resultstring · binaryOptional

Result in hexadecimal from executed contract call.

Example: 0x94c4d54535f6e616d6500Pattern: ^0x[0-9a-fA-F]+$
post
/api/v1/contracts/call

Last updated

Was this helpful?