AntonioPMCS/predictionmarket

Settle on a way to define the questionId

Opened this issue · 0 comments

The questionId is a 32byte string stored in hexadecimal (which means 64 char string). It is the parameter used to generate all the other ID's in a Market. From the [CT documentation]:(https://docs.gnosis.io/conditionaltokens/docs/ctftutorial03/):

A question ID: 32 bytes of data used to uniquely identify a question. Note that the contract has no knowledge of how to interpret the question ID, it is just used as an input for distinguishing different conditions. However, many front ends choose to interpret the question ID in very specific ways. For example, when they have a database where entries of the database may be identified by this question ID.

To get a condition ID, we'll use the getConditionId() function from the conditional tokens contract. It requires the three parameters mentioned above: oracle address, questionId bytes32, and outcomeSlotCount uint256.

This 32byte string needs to be passed to the contract upon market creation and can have semantic meaning:

  • The hash of the English sentence which represents the question of the market.
  • An ID in a database
  • An index
  • A hash that combines multiple information

Right now, in this admin platform, the questionID is generated by converting from ASCII to HEX a 32 character string input by the user (it can be a shortform of the market question). My suggestion is to interpret it in one of the ways described above.