<a id="deposit-pathusd-to-a-tempo-zone-on-testnet" />

# Deposit OUSD to a Tempo Zone on testnet

Deposit tokens from your public Tempo balance into a private Zone. This example uses `OUSD` test tokens and a Zone on Tempo Testnet named **Zone A**. Submit a public-chain deposit first, then wait for the Zone to credit the net amount after fees.

A public account signs a plaintext or encrypted deposit, the Zone A portal locks OUSD, and Zone A later imports the deposit and credits the private balance.

The deposit is accepted through `ZonePortal` on the public chain. You need private zone authorization to read the resulting zone balance, because those reads are only exposed to the authenticated account.

<a id="depositing-pathusd-to-zone-a" />

## Depositing OUSD to Zone A

By the end of this guide you will have deposited `OUSD` into `Zone A` and confirmed the balance update.

**Interactive demo: Deposit to Zone A**

1. Deposit to zone

## Code examples

These snippets assume you already have a signed-in `rootClient` on the public chain and the usual token and zone constants in scope.

On this legacy testnet deployment, use the plaintext flow when revealing the recipient and memo is acceptable, or the encrypted flow to hide those fields from public-chain observers. Current Zone portals require encrypted deposits and a Tempo refund recipient; neither legacy call signature below applies to those portals. See the [testnet compatibility notes](https://tempo.xyz/developers/docs/guide/private-zones#testnet-compatibility) before adapting these SDK calls to another Zone.

### Plaintext

```ts
import { parseUnits } from 'viem'
import { Actions } from 'viem/tempo'

const depositAmount = parseUnits('100', 6)

const { receipt } = await Actions.zone.depositSync(rootClient, {
  account: rootClient.account,
  amount: depositAmount,
  token: ousd,
  zoneId: ZONE_A.id,
})

console.log(receipt.blockNumber)
```

### Encrypted

```ts
import { parseUnits } from 'viem'
import { Actions } from 'viem/tempo'

const depositAmount = parseUnits('100', 6)

const { receipt } = await Actions.zone.encryptedDepositSync(rootClient, { // [!code focus]
  account: rootClient.account,
  amount: depositAmount,
  token: ousd,
  zoneId: ZONE_A.id,
})

console.log(receipt.blockNumber)
```

## What Happens During a Deposit

A zone deposit settles in two phases.

First, you submit a public Tempo transaction depositing to the `ZonePortal`. The Zone Portal contract locks the token, deducts the deposit fee in the same token, and records the net deposit in its deposit queue. Later, the zone sequencer processes that queue and credits the recipient inside the zone.

That means your public transaction receipt and your zone balance do not update at the same time. The Tempo transaction confirms that the deposit request was accepted. The zone balance changes only after the zone has processed that deposit, and it reflects the post-fee amount rather than the full amount you passed into `deposit(...)`.

:::warning
If you need a specific net amount inside the zone, account for the portal deposit fee first. The amount minted on the zone is `amount - depositFee`.
:::
