Skip to main content
Futarchy factory is used to create price-based futarchy markets. Market creation logic:
  1. Ask reality questions.
  2. Prepare condition.
  3. Create new erc20 outcome tokens.
  4. Initialize a new market contract.

Variables

CreateProposalParams

REALITY_SINGLE_SELECT_TEMPLATE

Template for categorical markets.

questionTimeout

Reality question timeout.

arbitrator

Arbitrator contract.

realitio

Reality.eth contract.

wrapped1155Factory

Wrapped1155Factory contract.

conditionalTokens

Conditional Tokens contract.

collateralToken

Conditional Tokens collateral token contract.

realityProxy

Oracle contract.

proposals

Proposals created by this factory.

proposal

Proposal contract.

Events

NewProposal

To be emitted when a new proposal is created. Parameters

Functions

constructor

Constructor.

createProposal

Creates a price-based futarchy market and deploys the wrapped ERC20 tokens. Parameters Return Values Logic
  1. Ask reality questions.
  2. Prepare condition.
  3. Create new erc20 outcome tokens.
  4. Initialize a new proposal contract.

createNewProposalParams

Creates the structures needed to initialize the new proposal. Parameters Return Values

getOutcomesAndTokens

Creates the outcomes and token names. Parameters Return Values

encodeRealityQuestion

Encodes the question, category and language following the Reality structure. If any parameter has a special character like quotes, it must be properly escaped. Parameters Return Values

askRealityQuestion

Asks a question on reality. Parameters Return Values

prepareCondition

Prepares the CTF condition and returns the conditionId. Parameters Return Values Pre-condition
  1. Reality question asked and return questionsId.
Logic
  1. It will check if there is a prepared condition on ConditionalTokens, and call conditionalTokens.prepareCondition() if there isn’t any.

deployERC20Positions

Wraps the ERC1155 outcome tokens to ERC20. Parameters Return Values Logic
  1. It will call wrapped1155Factory.requireWrapped1155 to create an ERC20 token contract for each position. The new tokens addresses and data are saved in Proposal contract.

toString31

Encodes a short string (less than than 31 bytes long) as for storage as expected by Solidity. See https://github.com/gnosis/1155-to-20/pull/4#discussion_r573630922. Parameters Return Values

allMarkets

Returns all the proposals created by this factory. Return Values

marketsCount

Returns the amount of proposals created by this factory. Return Values