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

# ConditionalTokens

> Polymarket-compatible ERC-1155 position tokens.

Standard Gnosis / Polymarket conditional token framework. Unchanged
from upstream — PredictStreet uses it as the settlement substrate.

## Key concepts

* **Condition** — an `(oracle, questionId, outcomeSlotCount)` tuple.
* **Position** — an ERC-1155 balance of a specific outcome slot within
  a condition.
* **Redemption** — once the oracle reports payouts, holders call
  `redeemPositions` to exchange winning tokens for USDC.

## Prepare a condition

```solidity theme={null}
function prepareCondition(
    address oracle,
    bytes32 questionId,
    uint256 outcomeSlotCount
) external;
```

Called by oracle-service as part of market deployment.

## Redeem winning positions

```solidity theme={null}
function redeemPositions(
    IERC20 collateralToken,
    bytes32 parentCollectionId,
    bytes32 conditionId,
    uint256[] calldata indexSets
) external;
```

## Redeeming via the contract

Partners can either call `ConditionalTokens.redeemPositions` directly
from their own client (this page describes that signature), or hand
the job to the platform via
[`POST /api/me/redemptions`](/concepts/settlement/flow#redemption) —
the off-chain helper queues a submitter-executed redemption against
your vault. Either path lands the same `PayoutRedemption` event
on-chain. The off-chain ledger picks it up via chain-watcher and
credits `/api/me/balances.collateral` accordingly; no extra API call
is required to "claim" winnings beyond the initial redemption.

## Events

```solidity theme={null}
event ConditionPreparation(bytes32 indexed conditionId, address indexed oracle, ...);
event ConditionResolution(bytes32 indexed conditionId, ...);
event PositionSplit(address indexed stakeholder, ...);
event PositionsMerge(address indexed stakeholder, ...);
event PayoutRedemption(address indexed redeemer, bytes32 indexed conditionId, ...);
```

## Source

`0x66Ed938E9Dec9A1df6033d66560d5fe6117EE744` on
[Blockscout](https://blockscout.ab.testnet.adifoundation.ai/address/0x66Ed938E9Dec9A1df6033d66560d5fe6117EE744)
(testnet).

Tracks upstream Gnosis `ConditionalTokens` v1.0.1 with only build-system changes.
