# Calling a smart contract function

Contracts can be called by their address. There are various pieces of data one can/should pass to a contract call in order to make it succeed.

The general syntax of a contract call is executed as follows:

```
docker run --rm qanplatform/qvmctl call \
    -m $RAM_BYTES \
    -t $TIMEOUT_MILLISEC \
    -r $DB_READ_SLOTS \
    -w $DB_WRITE_SLOTS_COUNT \
    --privkey $PRIVKEY_PATH \
    $CONTRACT_ADDR
    $ARG1 $ARG2 $ARGN
```

The arguments prepended with a **$** sign mean the following:

* $RAM\_BYTES: How much RAM the contract needs to execute the requested operation successfully
* $TIMEOUT\_MILLISEC: How much time the contract needs to execute the requested operation successfully
* $DB\_READ\_SLOTS: The Database fields to be read and passed to the execution environment, separated by commas
* $DB\_WRITE\_SLOTS\_COUNT: How many database fields this operation will write to after successful execution
* $PRIVKEY\_PATH: Path to a file which contains the private key for a wallet which has enough funds to execute the call
* $CONTRACT\_ADDR: Address of the smart contract to be called
* $ARG{N}: Arguments passed to the smart contract binary during execution


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.qanplatform.com/developers/qvm-multi-language-smart-contracts/generic-workflow/calling-a-smart-contract-function.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
