- Ask reality questions.
- Prepare condition.
- Create new erc20 outcome tokens.
- Initialize a new market contract.
Variables
CreateMarketParams
Workaround “stack too deep” errors.InternalMarketConfig
Workaround “stack too deep” errors.REALITY_UINT_TEMPLATE
REALITY_SINGLE_SELECT_TEMPLATE
REALITY_MULTI_SELECT_TEMPLATE
questionTimeout
arbitrator
realitio
wrapped1155Factory
conditionalTokens
collateralToken
realityProxy
markets
market
Events
NewMarket
Functions
constructor
createCategoricalMarket
Return Values
Logic
- Validate outcomes length (>= 2).
- Encode 1 reality question.
- Call
createMarket.
createMultiCategoricalMarket
Return Values
Logic
- Validate outcomes length (>=2).
- Encode 1 reality question.
- Call
createMarket.
createScalarMarket
Return Values
Logic
- Validate
upperBoundandlowerBound. - Validate outcomes length (2).
- Encode 1 reality question.
- Call
createMarket.
createMultiScalarMarket
Return Values
Logic
- Validate outcomes length (>=2).
- Encode reality questions, one for each outcome.
-
Instead of using
params.marketName, encode a newmarketName. -
Call
createMarket.
createMarket
Return Values
Logic
- Ask reality questions.
- Prepare condition.
- Create new erc20 outcome tokens.
- Initialize a new market contract.
createNewMarketParams
Return Values
encodeRealityQuestionWithOutcomes
Return Values
encodeRealityQuestionWithoutOutcomes
Return Values
askRealityQuestion
Return Values
prepareCondition
Return Values
Pre-condition
- Reality questions asked and return
questionsIds. questionIdis hashed from all the values thatRealityProxy.resolve()uses to resolve a market (questionsIds,outcomes.length,templateId,lowerBound,upperBound).
- It will check if there is a prepared condition on
ConditionalTokens, and callconditionalTokens.prepareCondition()if there isn’t any.
deployERC20Positions
Return Values
Logic
- It will call
wrapped1155Factory.requireWrapped1155to create an ERC20 token contract for each position. The new tokens addresses and data is saved inMarketcontract.
toString31
Return Values