feat[oz-retainer-07]: add automatic Polymarket report callback - #57
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
chrismaree
left a comment
There was a problem hiding this comment.
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 🤖
|
|
||
| /// @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) {} |
There was a problem hiding this comment.
if this succeeds do we want to also emit something? like ReportCallbackSent or something like this?
There was a problem hiding this comment.
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.
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
PolymarketOOReporter, which callsreport(requestId)on the module that registered the request.try/catchso a downstream revert does not block Managed OO settlement; emitReportCallbackFailedfor permissionless retry.finalize()in the Polymarket contracts.Validation
cd pm-v2-oo-reporter && forge fmt --checkcd pm-v2-oo-reporter && forge test— 43 tests passedcd pm-v2-oo-reporter && forge build --sizes --force—PolymarketOOReporter14,847 bytesgit diff --check