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

# Call Function

> Call a read-only function on a smart contract. In Solidity, these are functions with the state mutability set to `view`.

  <Note>
  Currently only works on EVM compatible chains.
  </Note>



## OpenAPI

````yaml /openapi.yaml post /networks/{network}/call-function
openapi: 3.1.0
info:
  version: 1.807.0
  title: Dfns
servers:
  - url: https://api.dfns.io
    description: Default - Europe
  - url: https://api.uae.dfns.io
    description: UAE
  - url: https://api.dfns.ninja
    description: <Deprecated> Staging
security: []
paths:
  /networks/{network}/call-function:
    post:
      tags:
        - Networks
      summary: Call Function
      description: >-
        Call a read-only function on a smart contract. In Solidity, these are
        functions with the state mutability set to `view`.

          <Note>
          Currently only works on EVM compatible chains.
          </Note>
      parameters:
        - schema:
            type: string
            description: Network name formatted in kebab case
          required: true
          description: Network name formatted in kebab case
          name: network
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contract:
                  type: string
                  pattern: ^0x[0-9a-fA-F]{40}$
                  description: Address of the contract to call
                abi:
                  type: object
                  properties:
                    type:
                      type: string
                    name:
                      type: string
                    stateMutability:
                      type: string
                    inputs:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          type:
                            type: string
                          components:
                            type: array
                            items:
                              type: object
                        required:
                          - name
                          - type
                    outputs:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          type:
                            type: string
                          components:
                            type: array
                            items:
                              type: object
                        required:
                          - name
                          - type
                  required:
                    - type
                    - name
                    - stateMutability
                    - inputs
                    - outputs
                  description: ABI of the read-only function to invoke
                calldata:
                  type: object
                  properties: {}
                  description: Function call arguments
              required:
                - contract
                - abi
              additionalProperties: false
              description: Calls an on-chain read function.
              title: Call Function
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema: {}
      security:
        - authenticationToken: []
components:
  securitySchemes:
    authenticationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        **Bearer Token:** Used to authenticate API requests.

        More details how to generate the token: [Authentication
        flows](https://docs.dfns.co/api-reference/auth/login-flows)

````