# Guest exports

> Entry points a NeuroWASM contract exports — call, init and the planned query, migrate, sudo and reply — how the VM invokes them and where call input is placed in memory.

Source: https://docs.nro.world/neurowasm/exports

Functions the contract **exports** for the VM to invoke. (Functions the contract *imports* from the host are in the other pages of this section.)

Every contract must also export its linear **`memory`**.

## `call` <Badge type="tip" text="live" />

```text
call(input_ptr: i32, input_len: i32)
```

The entry point for every contract call, read or write.

- The VM writes the call data (the JSON payload, see [ABI & call data](/build/abi)) into the contract's memory **at offset 64**, then calls `call(64, len)`.
- A contract without parameters, `call()`, is also accepted; it then cannot read the input.
- The result is whatever the contract last passed to `set_return`.
- The whole call tree commits only if nothing traps.

::: warning Keep offset 64 free
Because the input is copied to `memory[64 .. 64 + len]`, a contract must not keep data it needs there. With the Rust toolchain's default layout (stack first, growing down from the top of the first megabyte) this holds for inputs of normal size.
:::

**Analogs:** CosmWasm `execute` and `query`, NEAR `@call` / `@view`.

## `init` <Badge type="tip" text="live" />

```text
init()
```

Constructor, run once when the contract is deployed — if the module exports it; a missing `init` is not an error. It may write storage and emit events.

`init` receives no input, and **`get_caller()` returns nothing inside it**. To record an owner or take parameters, handle an `initialize` function in `call` instead: the deploy transaction calls it with the deployer as caller when `init_args` are given (see [Deploy](/build/deploy#_4-what-every-validator-does)). Guard it so it runs only once.

**Analogs:** CosmWasm `instantiate`, NEAR `#[init]`.

## `query` <Badge type="info" text="planned" />

A read-only entry point the runtime would forbid from writing. Until then, read through `call` with `dry_run: true` (`POST /api/v1/contracts/:address/call`).

## `migrate` <Badge type="info" text="planned" />

Runs after replacing the bytecode at the same `.app` address, gated by the owner or governance.

## `sudo` <Badge type="info" text="planned" />

Protocol and governance actions only (pause, parameter injection) — never reachable from a user transaction.

## `reply` <Badge type="info" text="planned" />

Receives the result `(id, result)` of an asynchronous sub-message. Needs asynchronous cross-contract calls, which are not implemented yet.

**Analogs:** CosmWasm `reply`, NEAR promise callbacks.
