Skip to content

fix[oz-retainer-07-l-05]: replace hardcoded reward decode - #63

Open
md0x wants to merge 1 commit into
pablo/fro-106-reward-cancellationfrom
pablo/oz-retainer-07-l-05-request-reward-getter
Open

fix[oz-retainer-07-l-05]: replace hardcoded reward decode#63
md0x wants to merge 1 commit into
pablo/fro-106-reward-cancellationfrom
pablo/oz-retainer-07-l-05-request-reward-getter

Conversation

@md0x

@md0x md0x commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Audit finding

OpenZeppelin Retainer 07 identified the following issue:

L-05 — Hardcoded Assembly Offset in setRequestReward Can Misread the Reward if the Request Layout Changes

  • Severity: Low
  • Status: Open

OOReporter.setRequestReward reads Request.reward from a hardcoded ABI word after a raw staticcall. A future request-layout change could silently make it read another field and calculate the wrong funding or refund delta.

This PR is built on #56, which introduces the reward-update path reviewed by this finding.

References: OpenZeppelin audit finding · FRO-112 · audited scope tag

Resolution

  • Add a guarded getRequestReward scalar view to OptimisticOracleV2.
  • Replace the reporter's raw staticcall and hardcoded assembly offset with a typed scalar call.
  • Preserve reward accounting, access control, lifecycle behavior, storage layout, and the existing full-request getter.
  • Add focused production-getter coverage to the existing requester reward-update test.

Validation

  • forge test --match-contract 'ManagedOptimisticOracleV2Test|DeferredPayoutTest' — 73 tests passed
  • cd pm-v2-oo-reporter && forge test --match-path test/OOReporter.t.sol — 45 tests passed
  • forge build --sizes --use 0.8.30ManagedOptimisticOracleV2 24,363 B (213 B margin)
  • forge build --sizes with solc 0.8.34 — ManagedOptimisticOracleV2 24,378 B (198 B margin)
  • cd pm-v2-oo-reporter && forge build --sizes --optimize falseOOReporter 24,463 B (113 B margin)
  • Compatibility build with feat[oz-retainer-07]: emit bond and liveness update events #58 and solc 0.8.34 — ManagedOptimisticOracleV2 24,528 B (48 B margin)
  • git diff --check

@md0x
md0x marked this pull request as ready for review August 3, 2026 10:21
@linear

linear Bot commented Aug 3, 2026

Copy link
Copy Markdown

FRO-112

@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.

agree, this reduces maintenance risks!

@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 at . The scalar getter removes the layout-sensitive assembly decode, reads the authoritative oracle reward, and keeps the production and reporter interfaces aligned. No remaining code issues. Deployment note: upgrade the Managed OO implementation exposing before the reporter starts using this path.\n\n---\nSent from Chris Codex Agent 🤖

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