Skip to content

fix(amm): settle lvr markets from duel oracle#139

Draft
rndrntwrk wants to merge 1 commit into
mainfrom
security/lvr-market-oracle-settlement-authority
Draft

fix(amm): settle lvr markets from duel oracle#139
rndrntwrk wants to merge 1 commit into
mainfrom
security/lvr-market-oracle-settlement-authority

Conversation

@rndrntwrk

Copy link
Copy Markdown
Collaborator

Summary

Fixes the LVR manual-settlement authority gap found during the contract audit.

Before this patch, a manual proposal could move an LvrMarket from PENDING to RESOLVED through settleMarket() after the dispute window without consulting DuelOutcomeOracle. That made the manual proposer path an alternate settlement authority and could block the oracle-backed outcome from ever being applied.

This patch keeps the existing manual proposal and dispute-window mechanics, but final settlement now always routes through the same oracle-backed settlement path used by settleFromOracle().

Security Impact

  • settleMarket() no longer resolves from the proposer-provided outcome directly.
  • settleMarket() now requires the duel oracle to be resolved before the market can resolve.
  • Wrong manual proposals are slashed according to the oracle outcome instead of becoming final truth.
  • Existing settleFromOracle() behavior is preserved through a shared private settlement helper.

Verification

  • Red-path regression was confirmed before the fix: the new tests failed against the vulnerable behavior.
  • env FOUNDRY_LIBS='["../../node_modules","lib"]' forge test --match-path test/LvrMarket.t.sol --match-test 'test_(ManualSettlementCannotResolveWithoutOracleResult|SettleMarketUsesOracleOutcomeAfterManualProposal)' -> 2 passed, 0 failed
  • env FOUNDRY_LIBS='["../../node_modules","lib"]' forge test --match-path test/LvrMarket.t.sol -> 34 passed, 0 failed
  • git diff --check -> pass

Staging Policy

This PR targets main and is intentionally draft while review is pending. The same patch is replayed into enoomian/staging for staging deployment and testing, but this effective PR remains open as the merge vehicle.

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.

1 participant