Document doubOwedForBuy mutability and TWAP usage (#315) #459
No reviewers
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega!459
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-315-doub-owed-preview"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
GitLab #315: document and harden
doubOwedForBuyfor integrators and the buy router.doubOwedForBuy(charmWad)and_sampleCharmAnchor()are nowview— safe foreth_call/staticcall(no state writes on the preview path).doubOwedForBuy == buyDOUB pull within epoch and at the Last Buy hard-reset boundary.contracts/PARAMETERS.md,docs/integrations/kumbaya.md,docs/testing/invariants-and-business-logic.md(INV-TIME-ARENA-DOUB-OWED-PREVIEW),skills/play-time-arena-doub/SKILL.md.Acceptance checklist
doubOwedForBuy/_sampleCharmAnchor;PARAMETERS.md;kumbaya.md§315doubOwedForBuyisviewcd contracts && forge test --match-contract TimeArenaEpochCharmPricedoubOwedForBuycd contracts && forge test --match-contract TimeArenaBuyRouterVerification checklist (third parties)
cd contracts && forge test --match-contract TimeArenaEpochCharmPrice— expect 9/9 PASS includingtest_doubOwedForBuy_matches_buy_at_hard_reset_boundary.cd contracts && forge test --match-contract TimeArenaBuyRouter— expect all PASS.docs/integrations/kumbaya.md— confirmdoubOwedForBuyvseffectiveCharmPriceWadsection and router invariant row.bash scripts/verify-time-arena-buy-router-anvil.shif exercising live Anvil router paths.Follow-ups
effectiveCharmPriceWadonly; at the hard-reset band UI quotes may lag until a follow-up switches todoubOwedForBuy(router onchain path is already correct).changed the description
changed the description
Security review — MR !459
Commit reviewed:
1e966591d1f0036158c16009907e0984170eae8eBase:
a0d325c5797067494af8ef2f7666856dd39131f0Scope
Onchain diff:
TimeArena.doubOwedForBuy/_sampleCharmAnchormarkedview(logic unchanged vs base); NatSpec + Forge parity tests at hard-reset boundary; docs/invariants only elsewhere.TimeArenaBuyRouterunchanged (already sizes fromdoubOwedForBuy).Method
Traced attacker-controlled inputs (
charmWad, oracle/TWAP reads) through preview (doubOwedForBuy) vs execution (_buyDoub→_prepareBuyBeforeTimer→_pullDoubExact) and router atomic path (buyViaKumbaya→ swap →buyFor). Ranforge test --match-contract TimeArenaEpochCharmPriceandTimeArenaBuyRouter— PASS.Findings
FINDINGS: 0 medium+
No inline threads (nothing to anchor).
Notes (out of scope / not introduced here)
ArenaCharmPriceTwapenforces 15m window, min observation cardinality, and 500 bps spot/TWAP deviation — not new in this diff.eth_callthen laterbuy) is inherent oracle latency; same-tx router path re-readsdoubOwedForBuybefore swap +buyFor, so no atomic mismatch.effectiveCharmPriceWad(documented follow-up) — UX/quoting gap, not a contract authz or fund-loss bug in this MR.Outcome: Security review: no medium+ findings on this diff. Safe to merge from a security perspective.
approved this merge request
mentioned in commit
97d56f93ff