Skip to content

feat[oz-retainer-07]: add automatic Polymarket report callback - #57

Open
md0x wants to merge 2 commits into
unaudited-pm-v2-oo-reporterfrom
pablo/oz-retainer-07-polymarket-report-callback
Open

feat[oz-retainer-07]: add automatic Polymarket report callback#57
md0x wants to merge 2 commits into
unaudited-pm-v2-oo-reporterfrom
pablo/oz-retainer-07-polymarket-report-callback

Conversation

@md0x

@md0x md0x commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Audit remediation feature

The Polymarket V2 integration expects UMA settlement to trigger OOReporterModule.report(requestId). The audited reporter currently only stores the raw UMA outcome, leaving reporting to a separate transaction.

References: FRO-108 · audited scope tag

Resolution

  • Add an integration hook after a final non-P4 outcome is stored.
  • Add PolymarketOOReporter, which calls report(requestId) on the module that registered the request.
  • Commit resolved state before the external call so the module can read the outcome during reporting.
  • Wrap reporting in try/catch so a downstream revert does not block Managed OO settlement; emit ReportCallbackFailed for permissionless retry.
  • Skip reporting for P4, stale, unknown, and already-resolved callbacks.
  • Keep payout translation and finalize() in the Polymarket contracts.
  • Enable the package optimizer so both reporter implementations remain below EIP-170.

Validation

  • cd pm-v2-oo-reporter && forge fmt --check
  • cd pm-v2-oo-reporter && forge test — 43 tests passed
  • cd pm-v2-oo-reporter && forge build --sizes --forcePolymarketOOReporter 14,847 bytes
  • git diff --check

@linear

linear Bot commented Jul 29, 2026

Copy link
Copy Markdown

FRO-95

FRO-108

@md0x
md0x marked this pull request as ready for review July 29, 2026 17:12
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@md0x
md0x requested review from Reinis-FRP and chrismaree July 30, 2026 11:29

@chrismaree chrismaree left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against FRO-108 and the live Polymarket module contract. Reporter state is committed before the external callback, callback failure is isolated for permissionless retry, and P4/stale/unknown/already-resolved paths do not report. The base storage/external ABI remains unchanged and the integration boundary is documented.


Sent from Chris Codex Agent 🤖

@Reinis-FRP Reinis-FRP left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!


/// @dev Keeps Managed OO settlement nonblocking when the downstream Polymarket report reverts.
function _onRequestResolved(bytes32 requestId, address requester) internal override {
try IOOReporterModule(requester).report(requestId) {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this succeeds do we want to also emit something? like ReportCallbackSent or something like this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Since OOReporterModule is Polymarket-owned, our reporter should expose its own success signal rather than rely on downstream events. I added ReportCallbackSucceeded, emitted only after report(requestId) returns without reverting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants