Polymarket UMA Adapter
Polygon PoS Polymarket0x2f5e3684cb1f318ec51b00edba38d79ac2c0aa9d
Solidity v0.8.15+commit.e14f2714
Admin & Risk
Who can change the rules?
Detected pausable controls from the verified ABI.
Architecture
Polymarket contract role
Polymarket UMA Adapter
Connects Polymarket questions to UMA's optimistic oracle, including initialization, disputes, and final answers.
Overview
Read Functions
Block #87,442,580 · just nowReturn the contract's emergency safety period in seconds.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | Duration of the emergency safety period, in seconds, used to limit actions during emergency scenarios.✨ AI |
Return the maximum allowed ancillary data size for UMA oracle requests.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | Maximum allowed ancillary data length in bytes (uint256).✨ AI |
Returns the UMA identifier the adapter uses for yes/no (binary) questions.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | bytes32 | bytes32 UMA identifier used to represent the Yes/No (binary) outcome for oracle requests.✨ AI |
Get the stored admin value for the specified address.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| — | address |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256 | Unsigned integer stored for that address in admins mapping representing admin state.✨ AI |
Returns the address of the collateral whitelist used to validate allowed collateral.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | address | The address of the collateral whitelist contract used to verify allowed collateral tokens.✨ AI |
Returns the address of the CTF contract used for final payout and claim processing.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | address | The address of the CTF contract that receives payouts and handles claims.✨ AI |
Retrieves the expected payout array of the question
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID of the question |
Returns
| Name | Type | Description |
|---|---|---|
| — | uint256[] |
Gets the latest update for a questionID and owner
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID |
| owner | address | - The address of the question initializer |
Returns
| Name | Type | Description |
|---|---|---|
| — | tuple |
Gets the QuestionData for the given questionID
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID |
Returns
| Name | Type | Description |
|---|---|---|
| — | tuple |
Gets all updates for a questionID and owner
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID |
| owner | address | - The address of the question initializer |
Returns
| Name | Type | Description |
|---|---|---|
| — | tuple[] |
Checks if an address is an admin
Parameters
| Name | Type | Description |
|---|---|---|
| addr | address | - The address to be checked |
Returns
| Name | Type | Description |
|---|---|---|
| — | bool |
Checks if a question has been flagged for emergency resolution
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID |
Returns
| Name | Type | Description |
|---|---|---|
| — | bool |
Checks if a question is initialized
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID |
Returns
| Name | Type | Description |
|---|---|---|
| — | bool |
Returns the address of the UMA optimistic oracle used by this adapter.✨ AI
Returns
| Name | Type | Description |
|---|---|---|
| — | address | Address of the UMA optimistic oracle contract used for proposals, disputes, and final answers.✨ AI |
Return metadata and current status for a Polymarket UMA question identified by a bytes32 id.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| — | bytes32 |
Returns
| Name | Type | Description |
|---|---|---|
| requestTimestamp | uint256 | requestTimestamp: uint256 - timestamp when the UMA request for this question was created✨ AI |
| reward | uint256 | reward: uint256 - amount offered as reward for providing the answer✨ AI |
| proposalBond | uint256 | proposalBond: uint256 - bond required to propose an answer to the UMA oracle✨ AI |
| liveness | uint256 | liveness: uint256 - dispute liveness period in seconds for proposed answers✨ AI |
| emergencyResolutionTimestamp | uint256 | emergencyResolutionTimestamp: uint256 - timestamp after which emergency resolution is allowed✨ AI |
| resolved | bool | resolved: bool - whether the question has a final resolved answer✨ AI |
| paused | bool | paused: bool - whether question actions are currently paused✨ AI |
| reset | bool | reset: bool - whether the question has been reset after a dispute✨ AI |
| refund | bool | refund: bool - whether the reward is eligible for refunding✨ AI |
| rewardToken | address | rewardToken: address - ERC20 token address used for the reward (zero address for ETH)✨ AI |
| creator | address | creator: address - address that created the question✨ AI |
| ancillaryData | bytes | ancillaryData: bytes - ancillary data submitted to the UMA optimistic oracle✨ AI |
Checks whether a questionID is ready to be resolved
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID |
Returns
| Name | Type | Description |
|---|---|---|
| — | bool |
Fetch the latest UMA optimistic oracle update for a given Polymarket question.✨ AI
Parameters
| Name | Type | Description |
|---|---|---|
| — | bytes32 | |
| — | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| timestamp | uint256 | timestamp: Unix timestamp of the returned update.✨ AI |
| update | bytes | update: ABI-encoded update payload containing the answer and related metadata.✨ AI |
Write Functions
Adds an Admin
Parameters
| Name | Type | Description |
|---|---|---|
| admin | address | - The address of the admin |
Allows an admin to resolve a CTF market in an emergency
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID of the question |
| payouts | uint256[] | - Array of position payouts for the referenced question |
Flags a market for emergency resolution
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID of the question |
Initializes a question Atomically adds the question to the Adapter, prepares it on the ConditionalTokens Framework and requests a price from the OO. If a reward is provided, the caller must have approved the Adapter as spender and have enough rewardToken to pay for the price request. Prepares the condition using the Adapter as the oracle and a fixed outcome slot count = 2.
Parameters
| Name | Type | Description |
|---|---|---|
| ancillaryData | bytes | - Data used to resolve a question |
| rewardToken | address | - ERC20 token address used for payment of rewards and fees |
| reward | uint256 | - Reward offered to a successful OO proposer. Must be chosen carefully, to properly economically incentize OO proposers. |
| proposalBond | uint256 | - Bond required to be posted by OO proposers/disputers. If 0, the default OO bond is used. Must be chosen carefully, to properly economically incentize OO proposers and disputers. Questions expected to secure a large amount of value should consider a larger proposal bond. |
| liveness | uint256 | - OO liveness period in seconds. If 0, the default liveness period of 2 hours is used. Must be chosen carefully, depending on the value backed by the question. Questions expected to secure a large amount of value should consider a longer liveness period. |
Returns
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 |
Allows an admin to pause market resolution in an emergency
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID of the question |
Post an update for the question Anyone can post an update for any questionID, but users should only consider updates posted by the question creator
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID |
| update | bytes | - The update for the question |
Callback which is executed on dispute Resets the question and sends out a new price request to the OO
Parameters
| Name | Type | Description |
|---|---|---|
| — | bytes32 | |
| — | uint256 | |
| ancillaryData | bytes | - Ancillary data of the request |
| — | uint256 |
Removes an admin
Parameters
| Name | Type | Description |
|---|---|---|
| admin | address | - The address of the admin to be removed |
Renounces Admin privileges from the caller
Allows an admin to reset a question, sending out a new price request to the OO. Failsafe to be used if the priceDisputed callback reverts during execution.
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID |
Resolves a question Pulls price information from the OO and resolves the underlying CTF market. Reverts if price is not available on the OO Resets the question if the price returned by the OO is the Ignore price
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID of the question |
Unflags a market for emergency resolution
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID of the question |
Allows an admin to unpause market resolution in an emergency
Parameters
| Name | Type | Description |
|---|---|---|
| questionID | bytes32 | - The unique questionID of the question |
Events
Emitted when an ancillary data update is posted
| Name | Type | Indexed | Description |
|---|---|---|---|
| questionID | bytes32 | ✓ | |
| owner | address | ✓ | |
| update | bytes |
Emitted when a new admin is added
| Name | Type | Indexed | Description |
|---|---|---|---|
| admin | address | ✓ | |
| newAdminAddress | address | ✓ |
Emitted when a question is emergency resolved
| Name | Type | Indexed | Description |
|---|---|---|---|
| questionID | bytes32 | ✓ | |
| payouts | uint256[] |
Emitted when a question is flagged by an admin for emergency resolution
Polymarket context A UMA question was flagged for review, the on-chain signal Polymarket uses for disputed or abnormal resolution flow.
| Name | Type | Indexed | Description |
|---|---|---|---|
| questionID | bytes32 | ✓ |
Emitted when a questionID is initialized
Polymarket context A market question entered the UMA adapter resolution flow.
| Name | Type | Indexed | Description |
|---|---|---|---|
| questionID | bytes32 | ✓ | |
| requestTimestamp | uint256 | ✓ | |
| creator | address | ✓ | |
| ancillaryData | bytes | ||
| rewardToken | address | ||
| reward | uint256 | ||
| proposalBond | uint256 |
Emitted when a question is paused by an authorized user
| Name | Type | Indexed | Description |
|---|---|---|---|
| questionID | bytes32 | ✓ |
Emitted when a question is reset
| Name | Type | Indexed | Description |
|---|---|---|---|
| questionID | bytes32 | ✓ |
Emitted when a question is resolved
Polymarket context The UMA adapter finalized an answer and can drive market settlement.
| Name | Type | Indexed | Description |
|---|---|---|---|
| questionID | bytes32 | ✓ | |
| settledPrice | int256 | ✓ | |
| payouts | uint256[] |
Emitted when a question is unflagged by an admin
| Name | Type | Indexed | Description |
|---|---|---|---|
| questionID | bytes32 | ✓ |
Emitted when a question is unpaused by an authorized user
| Name | Type | Indexed | Description |
|---|---|---|---|
| questionID | bytes32 | ✓ |
Emitted when an admin is removed
| Name | Type | Indexed | Description |
|---|---|---|---|
| admin | address | ✓ | |
| removedAdmin | address | ✓ |