Polymarket Conditional Tokens
Polygon PoS Polymarket0x4d97dcd97ec945f40cf65f87097ace5ea0476045
Solidity v0.5.10+commit.5a6ea5b1
Admin & Risk
Who can change the rules?
No admin risk controls detected from the verified ABI.
Architecture
Polymarket contract role
Polymarket Conditional Tokens
Holds Polymarket outcome balances as ERC-1155 conditional tokens and stores the final payout vector for resolved conditions.
Overview
Read Functions
Get the ERC-1155 balance of a specific outcome token id for a given owner.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | Address owning the outcome tokens.✨ AI |
| id | uint256 | ERC-1155 token id encoding the condition and outcome index.✨ AI |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | The number of outcome tokens the owner holds for the specified id.✨ AI |
Reports whether the contract implements a given ERC-165 interface ID.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| interfaceId | bytes4 | Interface identifier to query, as defined by ERC-165.✨ AI |
Returns
| Name | Type | Description |
|---|---|---|
| — | bool | True if the contract implements the interface with the given id, otherwise false.✨ AI |
Return the payout numerator for a specific condition and outcome.✨ AI
Polymarket context Stores each outcome's share of the final payout vector for a resolved condition.
Parameters
| Name | Type | Description |
|---|---|---|
| — | bytes32 | |
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | The uint256 payout numerator for the given condition and outcome.✨ AI |
Compute the ERC-1155 position id for a collateral token and an outcome collection.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| collateralToken | address | Collateral token which backs the position. |
| collectionId | bytes32 | ID of the outcome collection associated with this position. |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | The ERC-1155 position id that uniquely identifies the position for the given collateral and collection.✨ AI |
Returns balances for multiple owners and token ids in a single call.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| owners | address[] | The addresses of the token holders |
| ids | uint256[] | IDs of the tokens |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256[] | Balances for each owner and token id pair |
Compute the unique condition id used to identify a condition from oracle, questionId, and outcomeSlotCount.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| oracle | address | The account assigned to report the result for the prepared condition. |
| questionId | bytes32 | An identifier for the question to be answered by the oracle. |
| outcomeSlotCount | uint256 | The number of outcome slots which should be used for this condition. Must not exceed 256. |
Returns
| Name | Type | Description |
|---|---|---|
| — | bytes32 | bytes32 condition id computed from oracle, questionId, and outcomeSlotCount.✨ AI |
Compute the collection id for a conditional tokens collection.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| parentCollectionId | bytes32 | Collection ID of the parent outcome collection, or bytes32(0) if there's no parent. |
| conditionId | bytes32 | Condition ID of the outcome collection to combine with the parent outcome collection. |
| indexSet | uint256 | Index set of the outcome collection to combine with the parent outcome collection. |
Returns
| Name | Type | Description |
|---|---|---|
| — | bytes32 | bytes32 collection id derived from parentCollectionId, conditionId, and indexSet.✨ AI |
Return the number of outcome slots defined for a given condition.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| conditionId | bytes32 | ID of the condition. |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | Number of outcome slots associated with a condition, or zero if condition has not been prepared yet. |
Get the payout denominator for the given condition ID.✨ AI
Polymarket context Non-zero means the condition has a final on-chain payout vector and can be audited from CTF state.
Parameters
| Name | Type | Description |
|---|---|---|
| — | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | The payout denominator for the condition, used to scale the payout vector (uint256).✨ AI |
Queries the approval status of an operator for a given owner.
Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | The owner of the Tokens |
| operator | address | Address of authorized operator |
Returns
| Name | Type | Description |
|---|---|---|
| — | bool | True if the operator is approved, false if not |
Write Functions
Redeem conditional token positions for a resolved condition and receive the underlying collateral.✨ AI
Polymarket context Redeems winning or partially winning outcome tokens after a condition has resolved.
Parameters
| Name | Type | Description |
|---|---|---|
| collateralToken | address | Address of the ERC20 token used as collateral for the condition.✨ AI |
| parentCollectionId | bytes32 | ID of the parent collection grouping related partitioned positions.✨ AI |
| conditionId | bytes32 | ID of the resolved condition whose payouts are being redeemed.✨ AI |
| indexSets | uint256[] | Array of index sets specifying which outcome position tokens to burn and redeem.✨ AI |
Transfers multiple conditional outcome ERC-1155 tokens from one account to another in a single call.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| from | address | Source address |
| to | address | Target address |
| ids | uint256[] | IDs of each token type |
| values | uint256[] | Transfer amounts per token type |
| data | bytes | Data forwarded to `onERC1155Received` if `to` is a contract receiver |
Split a collateral position into outcome tokens for a specified condition partition.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| collateralToken | address | The address of the positions' backing collateral token. |
| parentCollectionId | bytes32 | The ID of the outcome collections common to the position being split and the split target positions. May be null, in which only the collateral is shared. |
| conditionId | bytes32 | The ID of the condition to split on. |
| partition | uint256[] | An array of disjoint index sets representing a nontrivial partition of the outcome slots of the given condition. E.g. A|B and C but not A|B and B|C (is not disjoint). Each element's a number which, together with the condition, represents the outcome collection. E.g. 0b110 is A|B, 0b010 is B, etc. |
| amount | uint256 | The amount of collateral or stake to split. |
Merge multiple conditional token positions into a single position for the specified condition and collateral.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| collateralToken | address | Address of the ERC20 token used as collateral for the positions.✨ AI |
| parentCollectionId | bytes32 | Parent collection id that identifies the collection receiving merged tokens.✨ AI |
| conditionId | bytes32 | Identifier of the condition whose outcome positions are merged.✨ AI |
| partition | uint256[] | Array of outcome index sets (uint256[]) specifying which positions to merge.✨ AI |
| amount | uint256 | Amount of each position to merge, denominated in the collateral token.✨ AI |
Authorize or revoke an operator to manage all of the caller's conditional token balances.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| operator | address | address to set the approval |
| approved | bool | representing the status of the approval to be set |
Report final payouts for a resolved question and store its outcome payout vector.✨ AI
Polymarket context Writes the final outcome payout vector into Conditional Tokens after oracle resolution.
Parameters
| Name | Type | Description |
|---|---|---|
| questionId | bytes32 | The question ID the oracle is answering for |
| payouts | uint256[] | The oracle's answer |
Register a new conditional market so outcome ERC-1155 tokens can be created for a given oracle and question.✨ AI
Polymarket context Creates the CTF condition that will later hold outcome payout data for a Polymarket market.
Parameters
| Name | Type | Description |
|---|---|---|
| oracle | address | The account assigned to report the result for the prepared condition. |
| questionId | bytes32 | An identifier for the question to be answered by the oracle. |
| outcomeSlotCount | uint256 | The number of outcome slots which should be used for this condition. Must not exceed 256. |
Safely transfers a specified amount of a conditional outcome ERC-1155 token from one address to another.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| from | address | Source address |
| to | address | Target address |
| id | uint256 | ID of the token type |
| value | uint256 | Transfer amount |
| data | bytes | Data forwarded to `onERC1155Received` if `to` is a contract receiver |
Events
Polymarket context A new Conditional Tokens condition was prepared for a market.
| Name | Type | Indexed | Description |
|---|---|---|---|
| conditionId | bytes32 | ✓ | The condition's ID. This ID may be derived from the other three parameters via ``keccak256(abi.encodePacked(oracle, questionId, outcomeSlotCount))``. |
| oracle | address | ✓ | The account assigned to report the result for the prepared condition. |
| questionId | bytes32 | ✓ | An identifier for the question to be answered by the oracle. |
| outcomeSlotCount | uint256 | The number of outcome slots which should be used for this condition. Must not exceed 256. |
Polymarket context A condition received its final on-chain payout vector.
| Name | Type | Indexed | Description |
|---|---|---|---|
| conditionId | bytes32 | ✓ | |
| oracle | address | ✓ | |
| questionId | bytes32 | ✓ | |
| outcomeSlotCount | uint256 | ||
| payoutNumerators | uint256[] |
| Name | Type | Indexed | Description |
|---|---|---|---|
| stakeholder | address | ✓ | |
| collateralToken | address | ||
| parentCollectionId | bytes32 | ✓ | |
| conditionId | bytes32 | ✓ | |
| partition | uint256[] | ||
| amount | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| stakeholder | address | ✓ | |
| collateralToken | address | ||
| parentCollectionId | bytes32 | ✓ | |
| conditionId | bytes32 | ✓ | |
| partition | uint256[] | ||
| amount | uint256 |
Polymarket context Outcome tokens were redeemed after resolution.
| Name | Type | Indexed | Description |
|---|---|---|---|
| redeemer | address | ✓ | |
| collateralToken | address | ✓ | |
| parentCollectionId | bytes32 | ✓ | |
| conditionId | bytes32 | ||
| indexSets | uint256[] | ||
| payout | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| operator | address | ✓ | |
| from | address | ✓ | |
| to | address | ✓ | |
| id | uint256 | ||
| value | uint256 |
| Name | Type | Indexed | Description |
|---|---|---|---|
| operator | address | ✓ | |
| from | address | ✓ | |
| to | address | ✓ | |
| ids | uint256[] | ||
| values | uint256[] |
| Name | Type | Indexed | Description |
|---|---|---|---|
| owner | address | ✓ | |
| operator | address | ✓ | |
| approved | bool |
| Name | Type | Indexed | Description |
|---|---|---|---|
| value | string | ||
| id | uint256 | ✓ |