> For the complete documentation index, see [llms.txt](https://docs.baas.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.baas.sh/baas-console/contracts/read-and-write.md).

# Read and write functions

Call any function of a registered deployment, with inline results for reads and transactions sent with a key from your Vault for writes.

Every registered deployment can be called straight from the Contracts page, with no wallet and no code. You do it in the **Executor** panel: read a value, or send a transaction with a key from your Vault. In this guide, you check a `MyToken` balance, then send a transfer.

## Select a deployment

Expand a class, then a version, and click a deployment. The **Executor** opens on it, its header showing the class, the address, and the network.

## The function cards

The panel has two tabs, each with a count:

* **Read** lists functions that only return data.
* **Write** lists functions that change on-chain state.

Every function gets its own card, open and ready, headed by its full signature. Each argument has a field named after the parameter, and the placeholder tells you what it expects. Overloaded functions, same name and different arguments, get one card each.

## Read a value

On the **Read** tab, fill in any arguments and click **Query**. The result appears right under the button, and so does an error if the call fails.

A result that carries a [unit](/baas-console/contracts/units.md) shows the formatted amount, with a badge to switch to the raw integer. Any number without a unit stays exactly as the chain returned it.

In our example, find `balanceOf`, paste a holder's address, and click **Query**. `MyToken` carries the ERC-20 `token` unit, so a balance of `5000000000000000000` reads as `5.0`, with `10^18` on the badge.

## Smart unit amounts

An argument measured in a unit holds a **Smart unit** switch inside its field, shown as **SU** where there is no room for the words. An amount nested inside a tuple or an array gets no switch. Type it raw.

The switch starts off, so the field takes the raw integer your contract expects. Turn it on and you type the amount the way you say it, `12.5`, which BaaS converts before the call goes out. Reading goes the other way round: a result opens formatted.

{% hint style="info" %}
**Switching clears the field.** The same digits mean a different amount in each mode.
{% endhint %}

## Write with a key

Writes are signed and sent for you by a **key** from your [Vault](/baas-console/vault.md), so no browser wallet is involved. On the **Write** tab:

{% stepper %}
{% step %}

### Fill the arguments

Enter each argument in its field: in our example, `transfer` takes an address and an amount. A payable function also shows a **Value (ETH)** field for the native currency sent with the call, with a **Float** and **Wei** toggle of its own.
{% endstep %}

{% step %}

### Pick a key

Open the **Key** selector and choose one. The network is the deployment's, so the keys set up on that network are offered. None fits? Set one up there in the [Vault](/baas-console/vault.md), or click **Add key** to add one in the Dashboard: it opens in a new tab, and the list refreshes when you come back.
{% endstep %}

{% step %}

### Execute

Click the execute button. Once the transaction is queued, the card confirms it with the transaction hash, shown as "Tx: ...". Until the hash is known, it shows the submission id instead, as "Queued: ...".
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
**Accepted is not confirmed.** Success means the transaction is queued for sending, not that it is mined. And with no simulation beforehand, a transaction that will revert is accepted just the same, then fails on-chain.
{% endhint %}

## Next

* [Explorer](/baas-console/contracts/explorer.md): browse the values BaaS keeps and every transaction it decodes.
* [Transaction action](/baas-console/automations/actions/transaction.md): call a write function automatically from an automation.
* [Units](/baas-console/contracts/units.md): see where the amounts you read and type get their decimals.
