ConditionalTokens
Last updated
Last updated
Emitted upon the successful preparation of a condition.
Parameters
Name | Type | Description |
---|---|---|
Emitted when a position is successfully split.
Emitted when positions are successfully merged.
This function prepares a condition by initializing a payout vector associated with the condition.
Parameters
Called by the oracle for reporting results of conditions. Will set the payout vector for the condition with the ID keccak256(abi.encodePacked(oracle, questionId, outcomeSlotCount))
, where oracle is the message sender, questionId is one of the parameters of this function, and outcomeSlotCount is the length of the payouts parameter, which contains the payoutNumerators for each outcome slot of the condition.
Parameters
This function splits a position. If splitting from the collateral, this contract will attempt to transfer amount
collateral from the message sender to itself. Otherwise, this contract will burn amount
stake held by the message sender in the position being split worth of EIP 1155 tokens. Regardless, if successful, amount
stake will be minted in the split target positions. If any of the transfers, mints, or burns fail, the transaction will revert. The transaction will also revert if the given partition is trivial, invalid, or refers to more slots than the condition is prepared with.
Parameters
Gets the outcome slot count of a condition.
Parameters
Return Values
Constructs a condition ID from an oracle, a question ID, and the outcome slot count for the question.
Parameters
Constructs an outcome collection ID from a parent collection and an outcome collection.
Parameters
Constructs a position ID from a collateral token and an outcome collection. These IDs are used as the ERC-1155 ID for this contract.
Parameters
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | 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.
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.
questionId
bytes32
The question ID the oracle is answering for
payouts
uint256[]
The oracle's answer
collateralToken
contract IERC20
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.
conditionId
bytes32
ID of the condition.
[0]
uint256
Number of outcome slots associated with a condition, or zero if condition has not been prepared yet.
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.
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.
collateralToken
contract IERC20
Collateral token which backs the position.
collectionId
bytes32
ID of the outcome collection associated with this position.