# Cross-contract (env)

> Synchronous cross-contract calls in NeuroWASM — call_contract, caller identity in nested calls, shared journal and depth limit.

Source: https://docs.nro.world/neurowasm/cross-contract

Phase A: **synchronous** CPI. Parent storage flushed into the shared journal before nested call (read-your-writes). `MAX_CALL_DEPTH = 8`.

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

```text
call_contract(addr_ptr, addr_len, input_ptr, input_len, result_ptr, result_max) → i32
```

Invoke another `.app`. Nested `get_caller` = this contract. Writes result bytes to `result_ptr`.

**Returns:** bytes written, or `-1` (depth exceeded / no dispatcher / bad args).

**Analogs:** CosmWasm `WasmMsg::Execute` (queued there), NEAR `promise_create` (async there).

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

Same + attach uNRO for child’s attached deposit.
