Oracle is the only contract authorised to call ConditionalTokens.reportPayouts for PredictStreet binary markets. Neg-risk markets settle through NegRiskOracle, which reports through NegRiskAdapter.
Both oracles are deployed behind ERC1967 UUPS upgradeable proxies (OracleProxy and NegRiskOracleProxy) and emit monotonically increasing sequence counters (seq) on every state event.
Key constants (testnet defaults)
| Parameter | Default |
|---|---|
bondAmount | 10 USDC (live value: bondAmount()) |
challengeWindow | 7200s (2 hours; bounds [15m, 24h]) |
rewardAmount | 0 USDC |
revenueWallet | Set at deploy |
emergencyClearTimelock | 604800s (7 days) |
Write surface
Every binary call exceptproposeOutcome and voidUnproposedMarket is keyed by the market’s conditionId, not its questionId. On NegRiskOracle, calls are keyed by negRiskMarketId.
| Function | Access | Purpose |
|---|---|---|
proposeOutcome(questionId, payouts[]) | onlyProposer or resolver | Starts the challenge window. Snapshots current bondAmount and rewardAmount into proposal. |
finalizeOutcome(conditionId) | Permissionless (anyone) | Once challengeDeadline elapses without challenge, reports payouts to ConditionalTokens and unlocks redemptions. |
challengeOutcome(conditionId) | Anyone holding bond | Posts snapshotted bond to dispute proposal. Halts trading on exchange via oraclePauseMarket. |
challengeOutcome(conditionId, expectedProposalHash) | Anyone holding bond | Overload with proposal hash binding; reverts if the proposal changed before mining. |
resolveChallengeConfirm(conditionId) | onlyResolver | Confirms original proposal payouts after challenge window elapses; forfeits challenger bond. |
resolveChallengeOverride(conditionId, newPayouts[]) | onlyResolver | Overturns proposal after challenge window; refunds bond + pays reward to challenger; updates payouts on ConditionalTokens. |
voidMarket(conditionId) | onlyResolver | Voids market with standard [1, 1] equal payout vector; refunds challenger bond. |
voidMarketWithPayouts(conditionId, payouts[], reasonHash) | onlyResolver | Voids market with explicit custom payout vector (fair price / make-whole). |
voidUnproposedMarket(questionId, outcomeSlotCount) | onlyResolver | Voids abandoned market before any proposal was made. |
markDelayed(conditionId) / undelay(conditionId) | onlyResolver | Halts or resumes market settlement while waiting for secondary data sources; syncs exchange pause flag. |
initiateProposalClear(conditionId) | onlyResolver | Starts 7-day timelock to clear stuck or erroneous proposal. |
executeProposalClear(conditionId) | onlyResolver | Executes clear after 7 days; wipes proposal, unpauses exchange, refunds challenger bond. |
executeProposalClearWithConsent(...) | Resolver + Guardian signatures | Instant proposal clear bypassing 7-day timelock with co-signature from emergencyClearGuardian. |
proposeAndFinalize(questionId) | Resolver; others only once public proposing is open (otherwise reverts PublicProposeNotOpen) | Atomic single-tx settlement for verified-source markets with locked 0-second challenge windows. |
withdrawBondPayout(address to) | Anyone with credit | Pull-payment claim for refunded bonds and override rewards from pendingBondPayouts. |
Read surface (anyone)
| Function | Returns |
|---|---|
getProposal(conditionId) | (proposer, challenged, finalized, proposedAt, challengeDeadline, bondSnapshot, rewardSnapshot, questionId, payouts). proposedAt == 0 indicates no proposal. |
challenger(conditionId) | Address of the challenger (address(0) if unchallenged) |
resolved(conditionId) / delayed(conditionId) | bool |
effectiveChallengeWindow(conditionId) | Challenge window in seconds for this condition |
bondAmount() | Current bond requirement for new proposals (USDC, 6 decimals) |
pendingBondPayouts(address) | Refunded bond + reward accrued and waiting to be claimed |
challengeProposalHash(conditionId) | Current proposal hash for bound challenge verification |
Events
All events embed a monotonicuint64 seq counter:
event OutcomeProposed(uint64 seq, bytes32 indexed conditionId, bytes32 questionId, address indexed proposer, uint256[] payouts, uint64 challengeDeadline);
event OutcomeChallenged(uint64 seq, bytes32 indexed conditionId, bytes32 questionId, address challenger, uint256 bondAmount);
event OutcomeFinalized(uint64 seq, bytes32 indexed conditionId, bytes32 questionId, address finalizer, uint256[] payouts);
event ChallengeConfirmed(uint64 seq, bytes32 indexed conditionId, bytes32 questionId, address challenger, uint256[] payouts);
event ChallengeUpheld(uint64 seq, bytes32 indexed conditionId, bytes32 questionId, address challenger, uint256[] newPayouts, uint256 reward);
event MarketVoided(uint64 seq, bytes32 indexed conditionId, bytes32 questionId, address challenger);
event MarketVoidedWithPayouts(uint64 seq, bytes32 indexed conditionId, bytes32 questionId, address challenger, uint256[] payouts, bytes32 reasonHash);
event VoidedWithoutChallenge(uint64 seq, bytes32 indexed conditionId, bytes32 questionId);
event MarketDelayed(uint64 seq, bytes32 indexed conditionId);
event MarketUndelayed(uint64 seq, bytes32 indexed conditionId);
event ProposalClearInitiated(uint64 seq, bytes32 indexed conditionId, uint256 executableAfter);
event ProposalClearExecuted(uint64 seq, bytes32 indexed conditionId);
event ProposalClearExecutedByConsent(uint64 seq, bytes32 indexed conditionId, address indexed backendSigner, address indexed guardianSigner, bytes32 reasonHash);
event EmergencyClearGuardianSet(uint64 seq, address indexed previous, address indexed next);
event BondPayoutQueued(uint64 seq, address indexed recipient, uint256 amount);
event BondPayoutWithdrawn(uint64 seq, address indexed recipient, address indexed to, uint256 amount);
event BondAmountSet(uint64 seq, uint256 bondAmount);
event ChallengeWindowSet(uint64 seq, uint256 challengeWindow);
event ConditionChallengeWindowSet(uint64 seq, bytes32 indexed conditionId, uint32 windowSeconds);
event ResolutionSourceLocked(uint64 seq, bytes32 indexed questionId, address source);
event ProposerRotated(uint64 seq, address indexed previous, address indexed next);
Challenging from a partner integration
import { Contract } from 'ethers';
// ORACLE_ADDRESS / USDC_ADDRESS from GET /api/platform/contracts
const oracle = new Contract(ORACLE_ADDRESS, [
'function getProposal(bytes32 conditionId) view returns (tuple(address proposer, bool challenged, bool finalized, uint64 proposedAt, uint64 challengeDeadline, uint256 bondSnapshot, uint256 rewardSnapshot, bytes32 questionId, uint256[] payouts))',
'function challengeProposalHash(bytes32 conditionId) view returns (bytes32)',
'function challengeOutcome(bytes32 conditionId, bytes32 expectedProposalHash)',
'function withdrawBondPayout(address to)',
], signer);
const usdc = new Contract(USDC_ADDRESS, [
'function approve(address spender, uint256 amount) returns (bool)',
], signer);
// 1. Read the hash first, then the proposal it must match
const expectedHash = await oracle.challengeProposalHash(conditionId);
const proposal = await oracle.getProposal(conditionId);
// 2. Approve oracle to transfer bondSnapshot USDC
await (await usdc.approve(ORACLE_ADDRESS, proposal.bondSnapshot)).wait();
// 3. Submit bonded challenge with proposal hash binding
await (await oracle.challengeOutcome(conditionId, expectedHash)).wait();
proposal.bondSnapshot USDC via transferFrom. If your challenge is upheld or the market is voided, the bond (plus any reward) is credited to pendingBondPayouts(yourAddress). Claim it to any address via oracle.withdrawBondPayout(to).
Source
0x346f4065f9aA3CE51F06bAfff3e657bc2FbD209b on
Blockscout
(testnet).