Overview
TheQuestionData struct stores all the parameters and state information for a question initialized in the UMA CTF Adapter. This struct is stored in the questions mapping indexed by questionID (computed as keccak256(ancillaryData)).
Struct Definition
Fields
Request timestamp, set when a request is made to the Optimistic Oracle. Used to identify the request and NOT used by the DVM to determine validity. This timestamp is updated when a question is reset.
Reward offered to a successful proposer who provides the correct answer to the Optimistic Oracle. This reward is denominated in the
rewardToken.Additional bond required by Optimistic Oracle proposers and disputers. If set to 0 during initialization, the default OO bond is used. Higher bonds are recommended for questions securing large amounts of value.
Custom liveness period in seconds for the Optimistic Oracle price request. If set to 0 during initialization, the default liveness period of 2 hours is used. Longer periods are recommended for high-value questions to allow adequate time for disputes.
Manual resolution timestamp, set when a market is flagged for manual resolution by an admin. When a question is flagged, this is set to
block.timestamp + SAFETY_PERIOD (1 hour). A value of 0 indicates the question is not flagged.Flag marking whether a question has been resolved. Once set to true, the question cannot be resolved again and the underlying CTF market has been settled with payouts.
Flag marking whether a question is paused. When paused, the question cannot be resolved. This can be set through the
pause() admin function or automatically when flagging a question.Flag marking whether a question has been reset. A question can only be reset once. Resetting occurs when:
- A price is disputed in the Optimistic Oracle
- An admin manually calls the
reset()function - The Optimistic Oracle returns an ignore price
Flag marking whether a question’s reward should be refunded to the creator. This is set when a dispute occurs and the reward remains on the Adapter contract. The refund is processed when the question is eventually resolved or manually resolved.
ERC20 token address used for payment of rewards, proposal bonds, and fees. Must be on the collateral whitelist managed by the UMA Finder contract.
The address of the question creator who initiated the question through the
initialize() function. Rewards are refunded to this address if necessary.Data used to resolve a condition. This contains the question details and resolution criteria. The
questionID is computed as keccak256(ancillaryData). The ancillary data is appended with the creator address during initialization and must not exceed MAX_ANCILLARY_DATA (8139 bytes).Usage
Retrieving QuestionData
You can retrieve the fullQuestionData struct for a question using the getQuestion() function:
Accessing Individual Fields
Thequestions mapping is public, allowing direct access to individual fields:
Question States
A question’s state can be determined by examining its fields:- Initialized:
ancillaryData.length > 0 - Flagged:
manualResolutionTimestamp > 0 - Ready to resolve: Initialized, not paused, not resolved, and has a price available from the OO
- Resolved:
resolved == true - Paused:
paused == true - Reset:
reset == true
isInitialized(questionID)- Check if initializedisFlagged(questionID)- Check if flaggedready(questionID)- Check if ready to resolve