> For the complete documentation index, see [llms.txt](https://ola-2.gitbook.io/ola-developer-documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ola-2.gitbook.io/ola-developer-documents/quick_start/invoke_contract.md).

# Interacting with a Smart Contract

## Prerequisites

Ensure Olatte is installed correctly:

```shell
olatte --version
```

If this command fails, see [Setting up your environment.](/ola-developer-documents/quick_start/setup_environment.md)

## Introduction

Olatte enables interaction with smart contracts via two primary methods:

* **call**: for read-only functions.
* **invoke**: for write functions that modify the state.

## Call a function

The call command can query a smart contract function without sending a transaction.

As an example you can use the get\_proposer function which expect index of the proposal and returns the address of the proposer:

```shell
olatte call --network=pre-alpha vote_simple_abi.json  \
    0x444b2e790621ac6b74923f7ad92....\
    winningProposal
```

> * vote\_simple\_abi.json is the smart contract's abi file.
> * 0x444b.. is the contract address
> * winningProposal is function name. For functions with parameters, enter the function's inputs after the function name.

This will return the winner proposal:

```shell
    0
```

## Invoke a function

when we need to modify the state of the smart contract, we need to send a transaction. This requires the use of the invoke command in Olatte, which sends a transaction to the Ola network.

In this example, we are sending a transaction to vote for proposal 7.

```shell
olatte invoke --network pre-alpha vote_simple_abi.json \
0x444b2e790621ac6b74923f7ad92.... \
vote 7
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://ola-2.gitbook.io/ola-developer-documents/quick_start/invoke_contract.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
