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

# OO Scripts

> oo-propose, oo-finalize.

## `oo-propose`

Calls `oo_resolution::propose<T>` against an OO `MarketLink` with a DUSDC bond.

```bash theme={"system"}
pnpm oo:propose \
  --market-link <SPORTS_OO_MARKET_LINK_ID> \
  --outcome 1 \
  --bond 50 \
  --execute
```

**Flags**

| Flag            | Required | Description                                             |
| --------------- | -------- | ------------------------------------------------------- |
| `--market-link` | yes      | OO `MarketLink` id (from `.env`)                        |
| `--outcome`     | yes      | `1` = YES, `2` = NO                                     |
| `--bond`        | yes      | Whole DUSDC bond. Must be >= `OO_MIN_BOND` (50 default) |
| `--execute`     | no       | Sign + submit                                           |

Returns the new `Proposal` id. Finalizable after the 30-min challenge window.

## `oo-finalize`

Calls `oo_resolution::finalize_auto<T>` (no dispute) or `finalize_vote<T>` (post-DAO-vote). Pre-flight reads the `Proposal` and prints time-remaining instead of letting the Move call abort early.

```bash theme={"system"}
pnpm oo:finalize --proposal 0x… --mode auto --execute
```

**Flags**

| Flag         | Required | Description        |
| ------------ | -------- | ------------------ |
| `--proposal` | yes      | Proposal object id |
| `--mode`     | yes      | `auto` or `vote`   |
| `--execute`  | no       | Sign + submit      |

**Errors:**

* `EChallengeWindowOpen`. Challenge deadline not reached. Script prints time-remaining instead.
* `EVoteWindowOpen`. Vote deadline not reached.
* `EWrongState`. Trying `finalize_auto` on a `DISPUTED` proposal, or `finalize_vote` on an `OPEN` one.

The finalize PTB has a **multi-return pattern** (returns proposer bond, disputer bond, and an address); the script transferObjects-es both bond coins to sender and drops the address return.
