Overview
The UMA CTF Adapter provides several admin-only functions to manage question lifecycle, handle edge cases, and intervene when necessary. All functions require the caller to have admin privileges via theonlyAdmin modifier.
Flag
Flags a market for manual resolution, pausing automatic resolution through the Optimistic Oracle.Function Signature
Parameters
questionID- The unique identifier of the question to flag
Behavior
- Sets
manualResolutionTimestamptoblock.timestamp + SAFETY_PERIOD(1 hour) - Pauses the question to prevent automatic resolution
- Emits
QuestionFlaggedevent
Requirements
- Question must be initialized
- Question must not already be flagged
- Question must not be resolved
Use Cases
- Disputed outcomes requiring human review
- Ambiguous question wording
- External events affecting question validity
- Optimistic Oracle malfunction or manipulation concerns
Example
Unflag
Removes the manual resolution flag, allowing automatic resolution to proceed.Function Signature
Parameters
questionID- The unique identifier of the question to unflag
Behavior
- Resets
manualResolutionTimestampto 0 - Unpauses the question
- Emits
QuestionUnflaggedevent
Requirements
- Question must be initialized
- Question must be flagged
- Question must not be resolved
- Safety period must not have passed (
block.timestamp <= manualResolutionTimestamp)
Use Cases
- False alarm - automatic resolution is safe to proceed
- Issue resolved without manual intervention
- Optimistic Oracle dispute resolved favorably
Example
Reset
Manually resets a question by sending out a new price request to the Optimistic Oracle.Function Signature
Parameters
questionID- The unique identifier of the question to reset
Behavior
- Refunds the reward to the question creator if necessary
- Updates
requestTimestampto currentblock.timestamp - Sets
resetflag totrue - Sends a new price request to the Optimistic Oracle
- Admin pays for the new price request
- Emits
QuestionResetevent
Requirements
- Question must be initialized
- Question must not be resolved
Use Cases
- Failsafe when
priceDisputedcallback reverts during execution - Recovery from Optimistic Oracle errors
- Resubmitting questions after technical issues
- Manual intervention when automatic reset fails
Important Notes
- The admin calling
resetpays for the new price request - The original reward is refunded to the question creator
- This ensures at most 2 concurrent OO requests per question
Example
Resolve Manually
Allows an admin to manually resolve a CTF market with specified payouts.Function Signature
Parameters
questionID- The unique identifier of the questionpayouts- Array of position payouts for the question (e.g.,[1, 0]for YES,[0, 1]for NO,[1, 1]for 50/50)
Behavior
- Validates the payout array
- Marks question as
resolved - Refunds reward to creator if necessary
- Reports payouts to the CTF
- Emits
QuestionManuallyResolvedevent
Requirements
- Question must be initialized
- Question must be flagged
- Safety period must have passed (
block.timestamp >= manualResolutionTimestamp) - Payout array must be valid (validated by
PayoutHelperLib.isValidPayoutArray)
Valid Payout Arrays
[1, 0]- YES outcome[0, 1]- NO outcome[1, 1]- 50/50 split (UNKNOWN/invalid outcome)
Use Cases
- Resolving questions after the safety period when automatic resolution fails
- Implementing community governance decisions
- Handling edge cases not covered by Optimistic Oracle
- Resolving after external arbitration
Safety Period
TheSAFETY_PERIOD constant is set to 1 hour. This provides:
- Time for stakeholders to review the flagging decision
- Window to unflag if the issue is resolved
- Protection against hasty manual resolution
Example
Pause
Pauses market resolution, preventing theresolve() function from being called.
Function Signature
Parameters
questionID- The unique identifier of the question to pause
Behavior
- Sets
pausedflag totrue - Emits
QuestionPausedevent
Requirements
- Question must be initialized
- Question must not be resolved
Use Cases
- Temporary halt during investigation
- Preventing resolution while gathering more information
- Coordination with external stakeholders
- Emergency stop during suspected manipulation
Example
Unpause
Unpauses market resolution, allowing theresolve() function to be called.
Function Signature
Parameters
questionID- The unique identifier of the question to unpause
Behavior
- Sets
pausedflag tofalse - Emits
QuestionUnpausedevent
Requirements
- Question must be initialized
Use Cases
- Resuming resolution after investigation complete
- Lifting temporary halt
- Allowing resolution to proceed after external coordination
Example
Admin Function Workflow
Typical workflows for using admin functions:Investigation Workflow
pause(questionID)- Stop resolution during investigation- Review question data and external information
- Decision point:
- If automatic resolution is safe:
unpause(questionID) - If manual intervention needed:
flag(questionID)
- If automatic resolution is safe:
Manual Resolution Workflow
flag(questionID)- Flag for manual resolution (sets 1-hour safety period)- Review period (1 hour minimum)
- Decision point:
- If automatic resolution is now safe:
unflag(questionID)(within safety period) - If manual resolution required: Wait for safety period to pass
- If automatic resolution is now safe:
resolveManually(questionID, payouts)- Resolve with determined payouts
Reset Recovery Workflow
- Detect that
priceDisputedcallback failed reset(questionID)- Manually reset the question- Monitor new OO price request
- Normal resolution proceeds
Security Considerations
Safety Period
The 1-hour safety period for manual resolution provides:- Protection against immediate manual resolution
- Time for community review and potential unflagging
- Reduced risk of admin error or malicious action
Admin Privileges
All these functions requireonlyAdmin access. Admins should:
- Use multi-signature wallets
- Document all admin actions
- Follow governance procedures for manual resolutions
- Maintain transparency with stakeholders
State Transitions
Understanding valid state transitions is critical:- Paused: Can be unpaused or flagged
- Flagged: Can be unflagged (within safety period) or manually resolved (after safety period)
- Resolved: Final state, no further actions possible
- Reset: New price request initiated, can be resolved normally