> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nullark.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Contract events

Use the current Nullark pool events to confirm bundle deposits, roots, withdrawals, fees, and administrative changes.

Index events only from the configured pool and deployment block. A log counts only when its transaction receipt succeeded.

## Value-flow events

| Event | Indexed fields | What it confirms |
| --- | --- | --- |
| `CommitmentInserted` | `commitment`, `leafIndex` | Deposit amount, bundle commitment, tree position, and encrypted recovery payload |
| `Withdrawal` | `nullifier`, `destination` | Gross amount, net amount, fee, and encrypted cover payload for one spent child |

`Withdrawal` is the settlement event and carries the nullifier. There is no separate spent-nullifier event and no withdrawal output commitment.

## Tree events

| Event | Meaning |
| --- | --- |
| `RootAccepted(root, previousRoot, insertedCommitment)` | A commitment insertion produced a new accepted tree state |
| `RootExpired(root)` | The bounded root history no longer accepts proofs against that root |

An expired root leaves the deposit intact. Rebuild membership against a newer accepted root that still contains the same bundle commitment.

## Fee and control events

| Event | Meaning |
| --- | --- |
| `FeeBpsDecreased` | A lower withdrawal fee became active |
| `FeeBpsIncreaseScheduled` | A higher fee entered its delay window |
| `FeeBpsIncreaseExecuted` | The scheduled fee became active |
| `FeeBpsIncreaseCancelled` | The scheduled increase was removed |
| `ProtocolFeesSwept` | Accrued fees moved to the chosen destination |
| `ExcessBalanceRecovered` | Unaccounted excess ETH moved by the owner |
| `OwnershipTransferred` | Pool ownership changed |
| `FeeControllerUpdated` | Fee authority changed |
| `NewDepositsClosed` | This pool stopped accepting new deposits in favor of another runtime |

## When a flow is complete

For a deposit, match a successful receipt at the configured pool with `CommitmentInserted` for the prepared commitment, amount, payload, and leaf index. `RootAccepted` should identify that same commitment.

For a withdrawal, match a successful receipt with the pool's spent-nullifier mapping and one `Withdrawal` event containing the intended nullifier, destination, gross amount, net amount, fee, and payload.

Completion requires a successful receipt and the expected event. If either is missing, keep the original request identity and reconcile before trying again.
