Gnosis Developer Portal Conditional Tokens

Gnosis Developer Portal Conditional Tokens

  • Introduction
  • Use Case
  • Documentation
  • Tutorials
  • Support

›Developer Guide

Developer Guide

  • Getting Started
  • Preparing a Condition
  • Outcome Collection
  • Defining Positions
  • Splitting and Merging Positions
  • Querying and Transferring Stake
  • Redeeming Positions

Redeeming Positions

Before this is possible, the payout vector must be set by the oracle:

function reportPayouts (bytes32 questionId, uint[] calldata payouts)external

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:

  • questionId – The question ID the oracle is answering for
  • payouts – The oracle’s answer

This will emit the following event:

event ConditionResolution (bytes32 indexed conditionId, address indexed oracle, bytes32 indexed questionId, uint outcomeSlotCount, uint[] payoutNumerators)

Then positions containing this condition can be redeemed via:

function redeemPositions (IERC20 collateralToken, bytes32 parentCollectionId, bytes32 conditionId, uint[] calldata indexSets)external

This will trigger the following event:

event PayoutRedemption (address indexed redeemer, IERC20 indexed collateralToken, bytes32 indexed parentCollectionId, bytes32 conditionId, uint[] indexSets, uint payout)

Also look at this chart:

← Querying and Transferring Stake
Gnosis Ltd.
ImprintCopyright
© 2020 Gnosis LTD
Privacy Policy
Copyright © 2025 Gnosis LTD