> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Call Contract

> 
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**

| Estimate         | Operation Type                                                                                               | Mirror Node Version                     |
| -------------    | -----------------------------------------------------------------------------------------------------------  | ----------------------------------------|
| false            | static contract state reads for non precompile functions                                                     | 0.78+                                   |
|                  | static contract state reads for precompile functions except allowance/isApprovedForAll                       | 0.78+                                   |
|                  | static contract state reads for precompile functions with allowance                                          | 0.79+                                   |
|                  | static contract state reads for precompile functions with isApprovedForAll                                   | 0.81+                                   |
|                  | non-static contract state reads for non precompile functions                                                 | 0.83+                                   |
|                  | non-static contract state reads for precompile read only functions                                           | 0.83+                                   |
| true             | non-static contract state reads and modifications for non precompile functions except lazy account creation  | 0.83+                                   |
|                  | non-static contract state reads and modifications for associate precompile functions                         | 0.83+                                   |
|                  | non-static contract state reads and modifications for non precompile functions with lazy account creation    | 0.84+                                   |
|                  | non-static contract state reads and modifications for precompile functions except associate                  | Not supported                           |

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


Invoke a smart contract.

This method will use `100` [Compute Units](/nodeapi/about/billing).

***


## OpenAPI

````yaml nodeapi/openapi/hedera-openapi-5.json POST /api/v1/contracts/call
openapi: 3.0.0
info:
  title: Hedera Mirror Node REST API
  version: 0.85.1
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  description: >-
    The Mirror Node REST API offers the ability to query cryptocurrency
    transactions and account information from a Hedera managed mirror node.


    Base url: [/api/v1](/api/v1)


    OpenAPI Spec: [/api/v1/docs/openapi.yml](/api/v1/docs/openapi.yml)
  contact:
    name: Hedera Mirror Node Team
    email: mirrornode@hedera.com
    url: https://github.com/hashgraph/hedera-mirror-node
servers:
  - url: https://{network}.hedera.validationcloud.io/v1/{API_KEY}
    variables:
      API_KEY:
        default: YOUR_API_KEY
        description: API key for the user.
      network:
        default: mainnet
        description: The Hedera network in use
        enum:
          - mainnet
          - testnet
security: []
tags:
  - name: accounts
    description: >-
      The accounts object represents the information associated with an account
      entity and returns a list of account information.
    externalDocs:
      url: >-
        https://docs.hedera.com/guides/docs/mirror-node-api/cryptocurrency-api#accounts
  - name: balances
    description: >-
      The balance object represents the balance of accounts on the Hedera
      network.
    externalDocs:
      url: >-
        https://docs.hedera.com/guides/docs/mirror-node-api/cryptocurrency-api#balances
  - name: contracts
    description: >-
      The contracts objects represents the information associated with contract
      entities.
  - name: schedules
    description: >-
      The schedules object represents the information associated with a schedule
      entity.
  - name: transactions
    description: >-
      The transaction object represents the transactions processed on the Hedera
      network.
    externalDocs:
      url: >-
        https://docs.hedera.com/guides/docs/mirror-node-api/cryptocurrency-api#transactions
  - name: topics
    description: >-
      The topics object represents the information associated with a topic
      entity and returns topic messages information.
    externalDocs:
      url: >-
        https://docs.hedera.com/guides/docs/mirror-node-api/cryptocurrency-api#topic-messages
  - name: tokens
    description: >-
      The tokens object represents the information associated with a token
      entity and returns a list of token information.
externalDocs:
  description: Hedera REST API Docs
  url: https://docs.hedera.com/guides/docs/mirror-node-api/cryptocurrency-api
paths:
  /api/v1/contracts/call:
    post:
      tags:
        - contracts
      summary: Invoke a smart contract
      description: >

        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**


        | Estimate         | Operation
        Type                                                                                              
        | Mirror Node Version                     |

        | -------------    |
        ----------------------------------------------------------------------------------------------------------- 
        | ----------------------------------------|

        | false            | static contract state reads for non precompile
        functions                                                     |
        0.78+                                   |

        |                  | static contract state reads for precompile
        functions except allowance/isApprovedForAll                       |
        0.78+                                   |

        |                  | static contract state reads for precompile
        functions with allowance                                          |
        0.79+                                   |

        |                  | static contract state reads for precompile
        functions with isApprovedForAll                                   |
        0.81+                                   |

        |                  | non-static contract state reads for non precompile
        functions                                                 |
        0.83+                                   |

        |                  | non-static contract state reads for precompile read
        only functions                                           |
        0.83+                                   |

        | true             | non-static contract state reads and modifications
        for non precompile functions except lazy account creation  |
        0.83+                                   |

        |                  | non-static contract state reads and modifications
        for associate precompile functions                         |
        0.83+                                   |

        |                  | non-static contract state reads and modifications
        for non precompile functions with lazy account creation    |
        0.84+                                   |

        |                  | non-static contract state reads and modifications
        for precompile functions except associate                  | Not
        supported                           |


        The operations types which are not currently supported should return 501
        error status.
      operationId: contractsCall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContractCallRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractCallResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '415':
          description: Unsupported media type error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Generic error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: Not implemented error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ContractCallRequest:
      type: object
      properties:
        block:
          description: >-
            Hexadecimal block number or the string "latest", "pending",
            "earliest". Defaults to "latest".
          example: latest
          nullable: true
          pattern: ^((0x)?[0-9a-fA-F]+|(earliest|pending|latest))$
          type: string
        data:
          description: Hexadecimal method signature and encoded parameters.
          example: >-
            0x0198489200000000000000000000000000000000000000000000000000000000000003ee
          format: binary
          maxLength: 12288
          nullable: true
          pattern: ^(0x)?[0-9a-fA-F]+$
          type: string
        estimate:
          description: Whether gas estimation is called. Defaults to false.
          example: true
          nullable: true
          type: boolean
        from:
          description: The 20-byte hexadecimal EVM address the transaction is sent from.
          example: '00000000000000000000000000000000000004e2'
          format: binary
          maxLength: 42
          minLength: 40
          nullable: true
          pattern: ^(0x)?[A-Fa-f0-9]{40}$
          type: string
        gas:
          description: Gas provided for the transaction execution. Defaults to 120000000.
          example: 120000000
          format: int64
          minimum: 0
          nullable: true
          type: integer
        gasPrice:
          description: Gas price used for each paid gas.
          example: 100000000
          format: int64
          minimum: 0
          nullable: true
          type: integer
        to:
          description: The 20-byte hexadecimal EVM address the transaction is directed to.
          example: '0x00000000000000000000000000000000000003f4'
          format: binary
          maxLength: 42
          minLength: 40
          nullable: false
          pattern: ^(0x)?[A-Fa-f0-9]{40}$
          type: string
        value:
          description: Value sent with this transaction. Defaults to 0.
          example: 0
          format: int64
          minimum: 0
          nullable: true
          type: integer
      required:
        - to
    ContractCallResponse:
      type: object
      properties:
        result:
          description: Result in hexadecimal from executed contract call.
          example: '0x94c4d54535f6e616d6500'
          format: binary
          nullable: false
          pattern: ^0x[0-9a-fA-F]+$
          type: string
    Error:
      type: object
      properties:
        _status:
          type: object
          properties:
            messages:
              type: array
              items:
                type: object
                properties:
                  data:
                    description: Error message in hexadecimal
                    example: '0x3000'
                    format: binary
                    nullable: true
                    pattern: ^0x[0-9a-fA-F]+$
                    type: string
                  detail:
                    description: Detailed error message
                    example: Generic detailed error message
                    nullable: true
                    type: string
                  message:
                    description: Error message
                    example: Generic error message
                    nullable: false
                    type: string

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.